-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tables are empty #21
Comments
Welcome to Steampipe @daviewales 👋 !! I tried to reproduce the error without much success. I followed the steps mentioned in https://developer.atlassian.com/cloud/trello/guides/rest-api/authorization/ and generated a new API key along with the token. Could you please send a snapshot of the |
Thanks @misraved, my config is just the default:
|
I did some more testing. It works for my personal account, but not for my work account. Is there a way to enable debugging information so I can provide more details? |
The other strange thing is that the token and key for my work account do work with py-trello. For example, the following code works with my work account tokens, assuming you have first run import os
from trello import TrelloClient
api_key = os.getenv('TRELLO_API_KEY')
token = os.getenv('TRELLO_TOKEN')
client = TrelloClient(api_key=api_key, token=token)
print(client.list_boards()) But the same credentials return an empty table when I run:
|
I found the log files. I get the following error message when running the above query on my work account:
|
I found
|
Hello @daviewales, I have been looking into this issue and have successfully retrieved the details of the boards to which I have access. Currently, I have access to boards in two different workspaces. Here is the result:
Boards:
From the above boards, From the previous conversation:
I have two separate Trello accounts (Account-A and Account-B). I have invited a member to use the boards in Account-A. Using the invited user's credentials, I can successfully view the boards. Could you please explain more about the distinction between a 'personal account' and a 'work account'? Does this mean having two different accounts or workspaces? Additionally, it would be very helpful if you could provide the steps to set up our environment to reproduce the error. Thank You! |
@ParthaI, regarding 'personal account' vs 'work account', I mean that I have two separate accounts. I have created a personal account connected to my personal email address, and at work I have a completely separate account connected to my work email address. Using the Python library above, I can create a token with access to my personal account, and I can also create a token with access to my work account. (A token created for my work account cannot access my personal account and vice versa.) However, with steampipe, the token works for my personal account, but not for my work account. I also tried using the underlying adlio/trello go library directly, and this does work for my organization account: package main
import "fmt"
import "os"
import "github.com/adlio/trello"
func main() {
apiKey := os.Getenv("TRELLO_API_KEY")
token := os.Getenv("TRELLO_TOKEN")
member_id := os.Getenv("TRELLO_MEMBER_ID")
org_id := os.Getenv("TRELLO_ORG_ID")
client := trello.NewClient(apiKey, token)
member, err := client.GetMember(member_id, trello.Defaults())
if err != nil {
fmt.Println(err)
}
fmt.Println(member)
// Return boards I'm a member of
member_boards, err := member.GetBoards(trello.Defaults())
if err != nil {
fmt.Println(err)
}
for _, board := range member_boards {
fmt.Printf("%s\t%s\n", board.ID, board.Name)
}
// Return all boards I have access to in the organisation
org_boards, err := client.GetBoardsInOrganization(org_id)
if err != nil {
fmt.Println(err)
}
for _, board := range org_boards {
fmt.Printf("%s\t%s\n", board.ID, board.Name)
}
} |
Hello @daviewales, I believe I addressed this in my previous conversation.
We can create tokens for any account without any issue. Have you invited the member to join the boards from the work account to the personal account and vice versa? I believe that until the user invitation is sent and accepted, the user will not be able to access those workspaces. With my current setup, I am able to achieve the same results using Steampipe and the standalone code you shared. Could you please take a look at my previous conversation and let me know if there are any corrections needed in my environment setup? Thank you! |
TL;DR: I think this will be fixed by updating adlio/trello to v1.12.0 in go.mod. Debugging notes:Hi @ParthaI, I understand this is tricky to reproduce. I'm still trying to figure out the missing piece of the puzzle. I have discovered that only some tables return empty.
But the following tables return empty with my work account:
Interestingly, I see that I have three different organisation ids listed for the following query (not my real IDs, but the same structure as follows):
Finally, and I suspect this might be a good clue, the following query only works for 2 out of the 3 organisation, and returns an error for my primary organisation (not my real org id):
The interesting bit:
This is interesting, because the field has type
It turns out that this exact error was recently fixed in adlio/trello v1.12.0. So, I'm guessing all that needs to be done here is bump the version of adlio/trello to v1.12.0 in go.mod. |
Hello @daviewales, I appreciated your efforts in debugging the root cause. However, I'm unsure if the adlio/trello v1.12.0 version can fix our initial error with the Nonetheless, I've raised a PR that updates the Trello SDK version to Could you please test this in your environment? You can do so by pulling the changes from the PR branch Here are the steps:
Thank you again for your understanding and cooperation! |
Thanks @ParthaI, that's fixed every error described in this issue! With my work account, I no longer get an error when running:
I also now get the expected results when querying the following boards:
I think that perhaps the missing piece of the reproducibility puzzle is that we have a paid organisation-wide power up, which causes https://api.trello.com/1/organizations/a1b2c3 to return a non-empty list for the products and powerUps items:
If your organisation returns an empty list here, it will not trigger the bug. The bug is only triggered if these lists contain integers. |
Describe the bug
Tables are empty.
Steampipe version (
steampipe -v
)v0.23.2
Plugin version (
steampipe plugin list
)0.2.0
To reproduce
Set and export
TRELLO_TOKEN
andTRELLO_API_KEY
variables:Then query
trello_board
:Expected behavior
Expected to see list of Trello boards.
Additional context
I'm reasonably confident I'm copying the correct key and token, following the Trello instructions.
I also tried setting them in the config file (
~/.steampipe/config/trello.spc
), but had the same result.The text was updated successfully, but these errors were encountered: