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

Error in a VM in google cloud #46

Closed
marcoprodata opened this issue Jul 3, 2020 · 5 comments
Closed

Error in a VM in google cloud #46

marcoprodata opened this issue Jul 3, 2020 · 5 comments

Comments

@marcoprodata
Copy link

Dears,

Firstly, sorry for my bad english. I have a server in google cloud platform with ubuntu, in my local machine, the project works correctly, but when deploy in a server in google cloud, have this error:
"message": "Missing or insufficient permissions.",
"code": 7,
"status": "PERMISSION_DENIED",
"details": []

How to solve this?

@jeromegamez
Copy link
Member

Could you please make sure that you are using the latest version of the underlying SDK? It should be 5.6.0, a composer update should get it, and you can check with composer show | grep kreait

If you're using auto-discovery instead of a service account JSON key, please make sure that the FIREBASE_CREDENTIALS environment variables is not set.

@marcoprodata
Copy link
Author

output of composer show:
kreait/clock 1.0.1 A PHP 7.0 compatible clock abstraction
kreait/firebase-php 5.6.0 Firebase Admin SDK
kreait/firebase-tokens 1.10.0 A library to work with Firebase tokens
kreait/laravel-firebase 2.2.0 A Laravel package for the Firebase PHP Admin SDK

i set the audiscover to false and put the credential file in the root folder of api, the project when running in windows machine works, but when i deploy in a gcloud vm instance return this error

@jeromegamez
Copy link
Member

In that case, can you confirm that the environment variable FIREBASE_CREDENTIALS points to the correct location/path?

@marcoprodata
Copy link
Author

Ok, i was open the database with the wrong way,
$db = new FirestoreClient(
[
'projectId' => 'fir-xxxxxxxxxx',
]
);

now i open the db like this
$db = app('firebase.firestore')->database();

and this work, thanks for you support

@jeromegamez
Copy link
Member

You're welcome! 🌺

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

2 participants