Invalid Project ID

Locked
alt123
New here
Posts: 7
Joined: Wed Jun 01, 2016 10:57 pm

Invalid Project ID

Post by alt123 »

Hi all,
Trying to configure Google Cloud Storage on QNAP TS-670, app version 1.1.387

I go to Google Developer API
I create a new project, and get the project ID

I go to Credentials => Service Account Key
Service account => New Service Account (and give name)
Choose P12 and create (and download)

I then go to Projects => Manage All
Under 'Service ACcounts' I chose the one I jut created and copy the Service Account ID and copy that into the field like an email address
I enter the Project ID (which is part of service account ID as mentioned above) and I keep getting 'Invalid Project ID' no matter what. (I am getting Project ID from top right of screen, next to the project name is the project ID.

I'm stumped. Any ideas?
coupeborgward
Starting out
Posts: 45
Joined: Mon May 23, 2016 6:10 pm

Re: Invalid Project ID

Post by coupeborgward »

I had the same issue last week. I created a new project via the UI (web browser) with a simple name. After that it was working in my case

Good luck
osedok
First post
Posts: 1
Joined: Mon Jun 27, 2016 5:22 am

Re: Invalid Project ID

Post by osedok »

Hi Alt,
Did you manage to solve the problem - I am just having the same problem.
Tried to create few new projects already - still no luck.

Regards,
ANdrzej
User avatar
Jasran
First post
Posts: 1
Joined: Mon Sep 10, 2012 12:39 pm

Re: Invalid Project ID

Post by Jasran »

The procedure that I follow is below. I have not confirmed that any step is required, only that this works for me. The naming methods may be entirely unnecessary, but I always follow it when strange login errors happen (on any platform):
  1. If new to Google APIs / Google Cloud Platform, make sure you have activated your account or started the Free Trial period. Don't use any Project or credentials created before activation.
  2. Create a New Project. When creating the Project, Edit the Project ID (which is immediately below the Project Name) and remove any hyphens, underlines or special characters and I make it short as well. I avoid spaces in the Project Name as they convert to hyphens for the Project ID. Create Project.
  3. Create new Service Account:
    1. Select your Project and create a new Service Account for it, this is under Google APIs --> IAM & Admin --> Service accounts --> Create Service Account. Once again I avoid hyphens, underlines and special characters and I also edit the Service Account ID to remove those as well.
    2. If you are using the default settings for Google Cloud Platform, i.e. you haven't edited the Object Default Permissions for Buckets under Storage (most people just use the default settings), then it is important to set the Service Account's Role to Role --> Project --> Editor and not use Role --> Storage --> *ANY* or Role --> Other --> *ANY*.
    3. Check the box "Furnish a new private key" and select Key type P12 and click Create.
  4. Go to Google Cloud Platform and under Storage make a new bucket for your QNAP connection, select Create Bucket. I don't use the default Bucket that is created with the Project. You don't need to create a new Folder as any existing Folders can't be used by the QNAP (the QNAP App instructions say you can use a Folder if its empty, but even empty ones don't work for me).
  5. Back at the QNAP go to Google Cloud Storage App and then Account --> Create Account. Enter your new Project ID and the full Service Account ID. Click Browse to find your P12 file, select it and then click the Import button and then click OK.
  6. When you make your Backup Jobs, and you get the Configure Cloud step, make sure you select your new Bucket and here you can just enter the name of a new Folder and it is automatically created on Google. Click the Test button to make sure the Folder name is acceptable and available.
I used to have trouble all the time, but when I use this method it always works for me without any problem or error.

-Jasran
tkato
First post
Posts: 1
Joined: Fri Sep 30, 2016 1:50 pm

Re: Invalid Project ID

Post by tkato »

I had a same issue.
But resolved with Jasran-san's proceduer.
It helps me a lot. You are save my time! Thank You!!
shocksolution
First post
Posts: 1
Joined: Sun Jun 02, 2019 4:47 am

Re: Invalid Project ID

Post by shocksolution »

I know this is an old thread, but I recently encountered and solved the "Invalid project ID" error when setting up backups to Google. As of May 2019, QNAP backup & sync is able to handle Google's default project ID format and service account names. This error more commonly occurs when the service account being used has the wrong permissions.

First, it is possible that you actually have a problem with the way you entered project ID into Backup & Sync. Make sure you're pasting the project ID, which Google auto-generates with the form "heavy-shark-123456", and not the project name. Also make sure that you aren't pasting a hidden character, such as a space or linefeed, after the ID.

If you're sure the project ID is correct, check the privileges assigned to the service account you created in Google Cloud Platform. Go to the Google Cloud Console, Select IAM & Admin, and then IAM. Click the pencil to the right of the service account to see its privileges. By default, it has no privileges, which will not work. At a minimum, it needs the storage.buckets.list permission. The most secure way to add this permission is to create a custom role, add this one permission, and assign that role to your backup service account. Then, edit your bucket permissions to add the service account with the "Storage Object Admin" role. This configuration gives your service account the "minimum necessary" permissions. Should your service account be compromised, you've limited the damage that it can do. I have written up a detailed guide to configuring Google Cloud Platform to support QNAP Backup & Sync.

An easier solution is to give the service account the "Editor" role. This approach is easier, but riskier, because someone could compromise the service account and use your Cloud Platform account for all kinds of malicious purposes.
demod
Starting out
Posts: 20
Joined: Mon Sep 11, 2017 9:52 am

Re: Invalid Project ID

Post by demod »

Jasran wrote: Fri Aug 26, 2016 5:05 am The procedure that I follow is below. I have not confirmed that any step is required, only that this works for me. The naming methods may be entirely unnecessary, but I always follow it when strange login errors happen (on any platform):
Thanks for the great procedure. Can confirm this was required for me to get google cloud storage working on the new HBS.
Locked

Return to “Google Cloud Storage”