2

For the recent few days I have been struggling with the following problem on Google Colab enter image description here Upon entering the produced link and entering my credentials the usual text to copy is not there. Instead I get this windowenter image description here

Afterwards the connection to the google cloud storage looks like this enter image description here. The project number 522309567947 is not my project and I do not understand why its appearing there.

After entering my project ID I am able to connect to my google cloud storage account but the adc.json file with client_id, client_secret and refresh token is not produced. I need this file to connect my tensorflow to my google cloud storage.

The following code will create an error because the adc.json does not exist.

enter image description here

Is there any solution to my problem? Or any workaround to get the adc.json file?

2 Answers2

1

The following code, should fix the issue you see:

!gcloud auth application-default login --no-launch-browser

  • 1
    Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Jun 03 '22 at 15:31
1

The real hint is the project number 522309567947, which is probably the project number for the project Collab is hosted in. This means that it's not an authentication issue but a client project id or quota project id configuration issue.

Setting your quota project would probably resolve the issue:

!gcloud auth application-default set-quota-project your-project-id

The solution for me was to explicitly set the quota project id when creating the client:

from google.cloud import bigquery_datatransfer
from google.cloud import bigquery_datatransfer_v1
from google.api_core.client_options import ClientOptions

options = ClientOptions(quota_project_id="your-project-id")
transfer_client = bigquery_datatransfer.DataTransferServiceClient(client_options=options)

parent = transfer_client.common_location_path(project=project, location="europe")

configs = transfer_client.list_transfer_configs(parent=parent)
print("Got the following configs:")
for config in configs:
    print(f"\tID: {config.name}, Schedule: {config.schedule}")
jonaseck
  • 361
  • 3
  • 3