Skip to content
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

Missing Refresh Token Generation/Prompt #54

Open
emma-brainlabs opened this issue Aug 14, 2024 · 0 comments
Open

Missing Refresh Token Generation/Prompt #54

emma-brainlabs opened this issue Aug 14, 2024 · 0 comments

Comments

@emma-brainlabs
Copy link

I followed the Installation Instructions by Opening in Google Cloud shell and then running the command it prompts you to run (chmod 775 ./setup/install.sh && ./setup/install.sh). This errored with the following error (see screenshot / paste)
Screenshot

Error: Error creating SecretVersion: googleapi: Error 400: Field [payload] is required.
with google_secret manager_secret_version.refresh_token_latest,
on services. tf line 302, in resource "google_secret manager_ secret_version" "refresh_token_latest":
302: resource "google_secret _manager_secret_version"
"refresh_token_latest" !

Researching this, I think this is due to the refresh token being empty, therefore the payload in this command being empty. As far as I can tell it doesn't ask for a refresh token from you, or generate one:

    • The FAQs (Question 7, Bullet iv.) state that the installation script is supposed to Execute the oAuth2.0 flow to gain a refresh token., but this did not happen when I ran the installation script - there was no prompt or url to follow that would allow me to auth this and it generate a refresh token.
  • The installation script also does not ask you specifically to paste in a refresh token - it asks for client id, client secret, google ads developer token and google ads manager id, users to grant access, but not refresh token.

To solve this, I follow the instructions in FAQs (Question 7, Installation Failed, what are my options), in the same cloud terminal as the installation had just failed in. The command in these instructions asks you to specify a refresh token explicitly as part of step ii. I ran the commands it details and my installation set-up worked this time! My suspicion being that this time, I specified a refresh token as part of those manual commands!

So I think there is a bug where it is expecting to ask the user for a refresh token, but it never does?

Full logs of erroring version:

To set your Cloud Platform project in this session use “gcloud config set project [PROJECT_ID]”
emma@cloudshell:~$ cloudshell_open --repo_url "https://github.com/google-marketing-solutions/keyword_platform" --page "shell" --tutorial "setup/docs/install.md" --git_branch "main" --force_new_clone
2024/08/14 13:26:34 Cloning https://github.com/google-marketing-solutions/keyword_platform into /home/emma/cloudshell_open/keyword_platform-6
Cloning into '/home/emma/cloudshell_open/keyword_platform-6'...
remote: Enumerating objects: 2680, done.
remote: Counting objects: 100% (534/534), done.
remote: Compressing objects: 100% (264/264), done.
remote: Total 2680 (delta 342), reused 401 (delta 270), pack-reused 2146 (from 1)
Receiving objects: 100% (2680/2680), 1.16 MiB | 12.34 MiB/s, done.
Resolving deltas: 100% (1838/1838), done.
2024/08/14 13:26:35 Branch main already exists locally. Switching to that branch.
emma@cloudshell:~/cloudshell_open/keyword_platform-6$ chmod 775 ./setup/install.sh && ./setup/install.sh
mkdir: cannot create directory ‘/home/emma/.cloudshell’: File exists
mkdir: cannot create directory ‘/home/emma/.cloudshell/no-apt-get-warning’: File exists
********************************************************************************
You are running apt-get inside of Cloud Shell. Note that your Cloud Shell  
machine is ephemeral and no system-wide change will persist beyond session end. 

To suppress this warning, create an empty ~/.cloudshell/no-apt-get-warning file.
The command will automatically proceed in 5 seconds or on any key. 

Visit https://cloud.google.com/shell/help for more information.                 
********************************************************************************
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
fzf is already the newest version (0.29.0-1).
0 upgraded, 0 newly installed, 0 to remove and 9 not upgraded.
Selected project: brainlabs-tech-testing
Setting Project ID: brainlabs-tech-testing
Updated property [core/project].
1) africa-south1              9) asia-southeast1          17) europe-west10            25) me-central1              33) us-east1
2) asia-east1                10) asia-southeast2          18) europe-west12            26) me-central2              34) us-east4
3) asia-east2                11) australia-southeast1     19) europe-west2             27) me-west1                 35) us-east5
4) asia-northeast1           12) australia-southeast2     20) europe-west3             28) northamerica-northeast1  36) us-south1
5) asia-northeast2           13) europe-central2          21) europe-west4             29) northamerica-northeast2  37) us-west1
6) asia-northeast3           14) europe-north1            22) europe-west6             30) southamerica-east1       38) us-west2
7) asia-south1               15) europe-southwest1        23) europe-west8             31) southamerica-west1       39) us-west3
8) asia-south2               16) europe-west1             24) europe-west9             32) us-central1              40) us-west4
Select a region: 32
Selected region: us-central1
Enter a name for a bucket used to store Keyword Platform files:
example
Enter an OAuth2.0 Web Client ID
example
Enter an OAuth2.0 Web Client Secret
example
Enter a Google Ads Developer Token:
example
Enter your Google Ads Login Customer ID (without hyphens):
example
Enter a comma-separated list of users to grant access to the solution:
example 
Do you want to opt out of sending usage information to Google? (N/n) n
You have not opted out.
Creating terraform state cloud storage bucket...
Creating gs://brainlabs-tech-testing-bucket-tfstate/...
ERROR: (gcloud.storage.buckets.create) HTTPError 409: Your previous request to create the named bucket succeeded and you already own it.
Updating gs://brainlabs-tech-testing-bucket-tfstate/...                                                                                          
  Completed 1                                                                                                                                    
Building backend service.
Creating temporary archive of 51 file(s) totalling 497.8 KiB before compression.
Uploading tarball of [./py] to [gs://brainlabs-tech-testing_cloudbuild/source/1723642097.651439-4f6b7d4df15a4345953b6f6e62897da8.tgz]
Created [https://cloudbuild.googleapis.com/v1/projects/brainlabs-tech-testing/locations/global/builds/210a5059-ec23-4ffc-b0ad-dd94c369af67].
Logs are available at [ https://console.cloud.google.com/cloud-build/builds/210a5059-ec23-4ffc-b0ad-dd94c369af67?project=136575615487 ].
Waiting for build to complete. Polling interval: 1 second(s).

=======
Omitted as too long
=======

Saved the plan to: /tmp/tfplan

To perform exactly these actions, run the following command to apply:
    terraform apply "/tmp/tfplan"
google_storage_bucket.glossary_bucket: Destroying... [id=brainlabs-tech-testing-glossaries]
google_secret_manager_secret_version.client_secret_latest: Destroying... [id=projects/136575615487/secrets/client_secret/versions/1]
google_pubsub_topic_iam_binding.binding: Creating...
google_secret_manager_secret_version.developer_token_latest: Destroying... [id=projects/136575615487/secrets/developer_token/versions/1]
google_secret_manager_secret_version.client_id_latest: Destroying... [id=projects/136575615487/secrets/client_id/versions/1]
google_secret_manager_secret_version.login_customer_id_latest: Destroying... [id=projects/136575615487/secrets/login_customer_id/versions/1]
google_secret_manager_secret_iam_member.client_id_access: Creating...
google_project_iam_binding.project_token_creator: Creating...
google_project_iam_member.cloudbuild_managed_sa_object_viewer: Creating...
google_project_iam_member.backend_sa_storage_object_admin: Creating...
google_secret_manager_secret_version.client_secret_latest: Destruction complete after 0s
google_project_iam_member.backend_sa_token_creator: Creating...
google_secret_manager_secret_version.client_id_latest: Destruction complete after 0s
google_project_iam_member.backend_sa_logging_viewer: Creating...
google_project_iam_member.backend_sa_logging_writer: Creating...
google_storage_bucket.glossary_bucket: Destruction complete after 1s
google_project_iam_member.backend_sa_vertexai_user: Creating...
google_secret_manager_secret_iam_member.refresh_token_access: Creating...
google_secret_manager_secret_version.developer_token_latest: Destruction complete after 1s
google_secret_manager_secret_iam_member.developer_token_access: Creating...
google_secret_manager_secret_version.login_customer_id_latest: Destruction complete after 1s
google_storage_bucket.output_bucket: Creating...
google_secret_manager_secret_version.refresh_token_latest: Creating...
google_secret_manager_secret_version.client_secret_latest: Creating...
google_secret_manager_secret_iam_member.login_customer_id_access: Creating...
google_project_iam_member.backend_builds_viewer: Creating...
google_storage_bucket.output_bucket: Creation complete after 2s [id=brainlabs-tech-testing-example]
google_secret_manager_secret_version.client_id_latest: Creating...
google_secret_manager_secret_version.client_id_latest: Creation complete after 2s [id=projects/136575615487/secrets/client_id/versions/2]
google_storage_bucket.glossary_bucket: Creating...
google_secret_manager_secret_version.developer_token_latest: Creating...
google_secret_manager_secret_version.client_secret_latest: Creation complete after 4s [id=projects/136575615487/secrets/client_secret/versions/2]
google_secret_manager_secret_version.login_customer_id_latest: Creating...
google_secret_manager_secret_iam_member.client_secret_access: Creating...
google_secret_manager_secret_version.developer_token_latest: Creation complete after 3s [id=projects/136575615487/secrets/developer_token/versions/2]
google_secret_manager_secret_version.login_customer_id_latest: Creation complete after 3s [id=projects/136575615487/secrets/login_customer_id/versions/2]
google_project_iam_member.backend_sa_logging_writer: Still creating... [10s elapsed]
google_project_iam_member.backend_sa_vertexai_user: Still creating... [10s elapsed]
google_project_iam_member.backend_builds_viewer: Still creating... [10s elapsed]
google_storage_bucket.glossary_bucket: Still creating... [10s elapsed]
google_storage_bucket.glossary_bucket: Still creating... [20s elapsed]
google_storage_bucket.glossary_bucket: Still creating... [30s elapsed]
google_storage_bucket.glossary_bucket: Still creating... [40s elapsed]
google_storage_bucket.glossary_bucket: Still creating... [50s elapsed]
google_storage_bucket.glossary_bucket: Still creating... [1m0s elapsed]
google_storage_bucket.glossary_bucket: Still creating... [1m10s elapsed]
google_storage_bucket.glossary_bucket: Still creating... [1m20s elapsed]
google_storage_bucket.glossary_bucket: Still creating... [1m30s elapsed]
google_storage_bucket.glossary_bucket: Still creating... [1m40s elapsed]
google_storage_bucket.glossary_bucket: Still creating... [1m50s elapsed]
google_storage_bucket.glossary_bucket: Still creating... [2m0s elapsed]
google_storage_bucket.glossary_bucket: Still creating... [2m10s elapsed]
google_storage_bucket.glossary_bucket: Still creating... [2m20s elapsed]
google_storage_bucket.glossary_bucket: Still creating... [2m30s elapsed]
google_storage_bucket.glossary_bucket: Creation complete after 2m37s [id=brainlabs-tech-testing-glossaries]
╷
│ Error: Error creating SecretVersion: googleapi: Error 400: Field [payload] is required.
│ 
│   with google_secret_manager_secret_version.refresh_token_latest,
│   on services.tf line 302, in resource "google_secret_manager_secret_version" "refresh_token_latest":
│  302: resource "google_secret_manager_secret_version" "refresh_token_latest" {
│ 
-----------------------------------------------------
Congrats! You successfully deployed Keyword Platform.
-----------------------------------------------------
emma@cloudshell:~/cloudshell_open/keyword_platform-6 (brainlabs-tech-testing)$
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant