.clasp.json not taking ProjectId

61 views
Skip to first unread message

Jeremy Fairbanks

unread,
Apr 22, 2024, 10:44:57 PM4/22/24
to Google Apps Script Community
I want `clasp logs` to work, therefor, I need to specify the ProjectId in the .clasp.json file.

However, every time I think I enter it correctly, I get the errror:
`The projectid "google.com:gpor-dissenmination-prod" looks incorrect. Did you provide the correct projectId?`

I get this projectId straight from Pantheon on the Welcome page for this proejct!

I have tried all variants of this both with and without the `google.com:`.
Some referencesI found online say that the projectId should be in the format of "project-id-xxx" or others "sys-xxx". Nothing seems to work, I always get the above error.

I have tried both setting this directly in the file directly as well as from the CLI with:
`clasp setting projectId new-id` Same results

Is there something I am missing here?

Andrew Roberts

unread,
Apr 23, 2024, 5:22:35 AM4/23/24
to google-apps-sc...@googlegroups.com
I think you need the project ID in the URL of the script project:e,g,

https://script.google.com/u/3/home/projects/1sPTS0dc-DapRnEk8N0xxxxxxxxxxxxxx79TwxHsQElEcTVUIX1Id/edit

--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-c...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-script-community/ecfbd1e0-3c72-4acc-a871-433280db8ee7n%40googlegroups.com.

Jeremy Fairbanks

unread,
Apr 23, 2024, 9:20:49 AM4/23/24
to Google Apps Script Community
That is the scriptId and is already in the .clasp.json as "scriptId". I need "projectId" which is the Id of the GCP project being targeted

I cloned the clasp code from GitHub, extracted the regex that validates the projectId as coded, which is : 
^[a-z][-\da-z]{5,29}$
and ran my projectId through a regex tester. My projectId fails because it has both a period and a colon in it. This seems to be an unnecessary check. 

This screenshot shows my project name in the GCP console along with the projectId, plain as day.
My projectId was auto-prefixed with "google.com:" from the project name. so this format was not of my choosing.

Andrew Roberts

unread,
Apr 24, 2024, 2:03:53 AM4/24/24
to google-apps-sc...@googlegroups.com
Neither of those screenshots are accessible,

Have you tried using the project number?

Reply all
Reply to author
Forward
0 new messages