I was trying to export some files from gcloud Firestore.
When I put
gcloud config set project project_id
It says Updated property [core/project]. However, when I input gcloud firestore export gs://<PATH> , the error message is NOT_FOUND: Project project_id does not exist. Could anyone help? Thanks!
The projectID can be find in the home page of your project
Replace the project_id by this value and it should work better!
Related
Because Firestore does not have a way to clone projects, I am attempting to achieve the equivalent by copying data from one project into a GCS bucket and read it into another project.
Specifically, using cloudshell I populate the bucket with data exported from Firestore project A and am attempting to import it into Firestore project B. The bucket belongs to Firestore project A.
I am able to export the data from Firestore project A without any issue. When I attempt to import into Firestore project B with the cloudshell command
gcloud beta firestore import gs://bucketname
I get the error message
project-b#appspot.gserviceaccount.com does not have storage.
buckets.get access to bucketname
I have searched high and low for a way to provide the access rights storage.bucket.get to project B, but am not finding anything that works.
Can anyone point me to how this is done? I have been through the Google docs half a dozen times and am either not finding the right information or not understanding the information that I find.
Many thanks in advance.
For import from a project A in a project B, the service account in project B must have the right permissions for the Cloud Storage bucket in project A.
In your case, the service account is:
project-ID#appspot.gserviceaccount.com
To grant the right permissions you can use this command on the Cloud Shell of project B:
gsutil acl ch -u project-ID#appspot.gserviceaccount.com:OWNER gs://[BUCKET_NAME]
gsutil -m acl ch -r -u project-ID#appspot.gserviceaccount.com:OWNER gs://[BUCKET_NAME]
Then, you can import using the firestore import:
gcloud beta firestore import gs://[BUCKET_NAME]/[EXPORT_PREFIX]
I was not able to get the commands provided by "sotis" to work, however his answer certainly got me heading down the right path. The commands that eventually worked for me were:
gcloud config set project [SOURCE_PROJECT_ID]
gcloud beta firestore export gs://[BUCKET_NAME]
gcloud config set project [TARGET_PROJECT_ID]
gsutil acl ch -u [RIGHTS_RECIPIENT]:R gs://[BUCKET_NAME]
gcloud beta firestore import gs://[BUCKET_NAME]/[TIMESTAMPED_DIRECTORY]
Where:
* SOURCE_PROJECT_ID = the name of the project you are cloning
* TARGET_PROJECT_ID = the destination project for the cloning
* RIGHTS_RECIPIENT = the email address of the account to receive read rights
* BUCKET_NAME = the name of the bucket that stores the data.
Please note, you have to manually create this bucket before you export to it.
Also, make sure the bucket is in the same geographic region as the projects you are working with.
* TIMESTAMPED_DIRECTORY = the name of the data directory automatically created by the "export" command
I am sure that this is not the only way to solve the problem, however it worked for me and appears to be the "shortest path" solution I have seen.
Magento2 i tried to run some command required for adding new payment gateway
one of them
up grade database : bin/magento setup:upgrade
but i got the below error can anyone help
Running schema recurring...We can't find the role for the user you wanted.
You can open this file
src/app/code/Magento/Authorization/Model/Acl/AclRetriever.php
line 68 and check why AuthorizationException is thrown.
I have a pod running based on https://hub.docker.com/r/koehn/diaspora/
I found a FAQ entry about the Admin Role https://wiki.diasporafoundation.org/FAQ_for_pod_maintainers#What_are_roles_and_how_do_I_use_them.3F_.2F_Make_yourself_an_admin_or_assign_moderators
Unfortunately, the "rails console" does not work in that container (1).
Could I add the admin role directly in the database? I found my intitial user in the "users" table and see a "roles" table that is currently empty. Just unsure what I would have to INSERT there
(1) on first try I got a bundle not found. I figured that I had to install that missing gem. But even with that done I don't get the mentioned command to run:
diaspora#e4447573f534:~$ RAILS_ENV=production bundle exec rails console
Could not locate Gemfile or .bundle/ directory
It looks like diaspora* is installed to /home/diaspora/diaspora within the image. You need to run the command in the FAQ from within that folder, so cd to it first.
Running this command:
gcloud sql instances export myinstance gs://my_bucket_name/filename.csv -d "mydatabase" -t "mytable"
Giving me the following error:
ERROR: (gcloud.sql.instances.import) ERROR_RDBMS
I have manually ran console uploads to the bucket which go fine. I am able to login to the sql instance and run queries. Which makes me think that there are no permission issues. Has anybody ever seen this type of error and knows a way around it?
Note: i have googled for possible situations, and most of them point to either sql or bucket permission issues.
Nvm. I figured out that i need to make an oauth connection (using the json token generated from gcloud api/credentials section) to the instance before interacting with it.
gsutil has set the project id in .boto for an old project. I tried creating a new bucket in my new project with gsutil mb gs://new-project-id but got the error message:
In the project overview, ensure that the Project Number listed for your project matches the project ID (old-project-id) from your boto config file
It looks like I cant change it from directly opening the file because all the values look like variables stored somewhere else and I cant find anything that looks like a project id.
How do I change the project id for the .boto file?
If you're using the gcloud distribution of gsutil you can set the default project id using the gcloud config set command, e.g.,
gcloud config set project my-other-project
If you're using the standalone distribution of gsutil you can change the default project id by editing the default_project_id setting in your .boto file.
Note also that you can override the default project ID for particular gsutil ls and gsutil mb commands, using the -p option, e.g.,
gsutil mb -p my-other-project gs://some-bucket