#Google Drive suddenly inaccessible

1 messages · Page 1 of 1 (latest)

vernal blaze
#

Hello! I've been using a composio connection to google drive with the DOWNLOAD_FILE action for the past several weeks successfully. Now I am trying to download a new file and it is suddenly inaccessible. I know that the user whos connection we've setup has access to the file and I can see it logged in as the user but I'm getting a 404 starting recently.

A recent example is

LOG ID
log_0SfceWtp5CQd

USER ID
67f520e362d29ee4a1d79c92

CONNECTION ID
ca_SFubyxTdZetC

Do you have any idea what might be wrong?

#

Google Drive suddenly inaccessible

timid hedgeBOT
#

Hi Kevin,

The 404 error you’re seeing might be due to the “File Not Found” error. Could you please confirm with the user if the file hasn’t been deleted or if any permissions have been modified? Please let me know if this isn’t the case. Thanks!

vernal blaze
#

Yes, I confirmed that the user hass access to the file and it is still with the correct id. Here's the code I'm seeing to replicate the error.

entity_id = "67f520e362d29ee4a1d79c92"
toolset = ComposioToolSet(
    api_key=api_key,
    entity_id=entity_id,
    )

res = toolset.execute_action(
    'GOOGLEDRIVE_DOWNLOAD_FILE',
    params={
        "file_id": "17l9yE2dRZe-LAbm3B4id7Mn9SDOUC9Pe"
    }
)

I get a 404 file not found.
However if I access the file directly (logged in as the connected account user for that entity_id) I can access the file directly here: https://docs.google.com/presentation/d/17l9yE2dRZe-LAbm3B4id7Mn9SDOUC9Pe/edit?usp=sharing&ouid=111869139614756691934&rtpof=true&sd=true

#

I've also tried making a custom tool call with some of the other google drive endpoints like this:

execute_request(
endpoint=f"/drive/v3/files/{file_id}/export?mimeType=application/pdf",
method="GET"
)
and it returns an empty dict saying it was successful: {'data': {}, 'error': None, 'logId': None, 'sessionInfo': {}, 'successful': True, 'successfull': True}

timid hedgeBOT
#

I didn't quite understand the "However if I access the file directly (logged in as the connected account user for that entity_id) I can access the file". Also, you can’t access someone else’s files unless they’ve enabled sharing to Anyone with link or a special invite. Make sure you have the right permissions to access the file.

By the way, I noticed you’re trying to download a presentation. Have you been able to download it before?

vernal blaze
#

I mean that I can view the presentation clicking on the link while I'm logged in as the connected account. The file is shared to the connected account, that's how I can view it.

Oh that may be an important point. The file is shared with the Google organization that the connected account is a part of. If I look at the share functionality on the google slide presentation there isn't a specific share but "General access Anyone in this group can find and view". Is that a problem?

#

No, this is a new connected user we're working on.

timid hedgeBOT
#

Ideally, if the file is accessible to the connected account, it shouldn’t throw a 404 error. You mentioned that you were able to run the Download File Tool successfully in the past. Could you please check what permissions have been enabled for the accounts in the group?

vernal blaze
timid hedgeBOT
#

I was referring to the permissions from Google Drive. Could you check if both the files are enabled with similar permissions and the new connected account is a part of the organization and has access?

vernal blaze
#

Oh, yes they are different google drive organizations but in both cases it was a google drive connected account accessing a slide presentation shared with the organization and not the specific connected account.

timid hedgeBOT
#

Just to confirm- The new connected account has enough access in the organization?

vernal blaze
#

Yes. The new connected account has access to the file in the organization but is still throwing a 404. I can download the file manually using the connected account but not through Composio.

timid hedgeBOT
#

That should ideally work. Could you try passing the connected_account_id directly in the code snippet instead of entity_id? You can pass it as a parameter in execute_action or when initiating ComposioToolSet.

vernal blaze
#

Hmmm, I'm having some trouble doing this. If I set the connection id directly like this then it throws an error: composio.exceptions.InvalidConnectedAccount: Invalid connected accounts found: [('GOOGLEDRIVE', 'ca_66ijRVZPelrW')]. This is the ID I took from the composio dashboard.

` toolset = ComposioToolSet(
api_key=api_key,
connected_account_ids={'GOOGLEDRIVE': "ca_66ijRVZPelrW"}
)

# Get the connected account ID

res = toolset.execute_action(
    "GOOGLEDRIVE_DOWNLOAD_FILE",
    params={
        "file_id": "17l9yE2dRZe-LAbm3B4id7Mn9SDOUC9Pe"
    }
)`

However this approach.

` entity_id = "67f520e362d29ee4a1d79c92"
toolset = ComposioToolSet(entity_id=entity_id, api_key=api_key)
conns = toolset.get_connected_accounts()
conns = [c for c in conns if c.appName == 'googledrive']
toolset = ComposioToolSet(
api_key=api_key,
connected_account_ids={'GOOGLEDRIVE': conns[0].id}
)

res = toolset.execute_action(
    "GOOGLEDRIVE_DOWNLOAD_FILE",
    params={
        "file_id": "17l9yE2dRZe-LAbm3B4id7Mn9SDOUC9Pe"
    }
)`

Then throws an error in execute_action. composio.exceptions.ConnectedAccountNotFoundError: No connected account found for app GOOGLEDRIVE; Run composio add googledrive to fix this

vernal blaze
#

I was able to figure this out. The file I was trying to access was is a share folder in a different drive so I needed to upgrade to the new sdk version and add the supportsAllDrives parameter.