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

Authentication question: error (403-Forbidden) #4830

Closed
MujtabaFR opened this issue Dec 12, 2021 · 3 comments
Closed

Authentication question: error (403-Forbidden) #4830

MujtabaFR opened this issue Dec 12, 2021 · 3 comments
Assignees
Labels
api: firestore Issues related to the Firestore API. priority: p2 Moderately-important priority. Fix may not be included in next release.

Comments

@MujtabaFR
Copy link

MujtabaFR commented Dec 12, 2021

I'm having error (403-Forbidden) Suddenly today using Google-Cloud-Firestore. The code was working fine.

Example of my code :

<?php

require 'vendor/autoload.php';
use Google\Cloud\Firestore\FirestoreClient;

putenv('GOOGLE_APPLICATION_CREDENTIALS='.realpath("key.json"));

$db = new FirestoreClient();

$docRef = $db->collection('orders')->document('1562292363537');
$snapshot = $docRef->snapshot();

?>

Error message :

Uncaught Google\Cloud\Core\Exception\ServiceException: {
    "message": "403:Forbidden",
    "code": 14,
    "status": "UNAVAILABLE",
    "details": [
        {
            "@type": "content-length",
            "data": "0"
        },
        {
            "@type": "date",
            "data": "Sun, 12 Dec 2021 00:00:36 GMT"
        },
        {
            "@type": "alt-svc",
            "data": "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000,h3-Q050=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000,quic=\":443\"; ma=2592000; v=\"46,43\""
        }
    ]

I tried to create a new service account key with full permissions But there's no benefit.
Also I'm having the issue with two different projects, using the latest Google-Cloud-SDK available.

I believe the issue is related to Firebase App Check (maybe a bug) (Although It's disabled in my project)

Is there any solution for this issue ?
Thanks

@yoshi-automation yoshi-automation added triage me I really want to be triaged. 🚨 This issue needs some love. labels Dec 12, 2021
@danoscarmike danoscarmike added api: firestore Issues related to the Firestore API. and removed triage me I really want to be triaged. 🚨 This issue needs some love. labels Jan 5, 2022
@yoshi-automation yoshi-automation added triage me I really want to be triaged. 🚨 This issue needs some love. labels Jan 5, 2022
@saranshdhingra
Copy link
Contributor

Hi @MujtabaFR
Thanks for opening the issue.

I see you reported this almost a month back.

I want to ask if the issue is still happening? If so, is it happening regularly?

@saranshdhingra saranshdhingra self-assigned this Jan 6, 2022
@saranshdhingra saranshdhingra removed triage me I really want to be triaged. 🚨 This issue needs some love. labels Jan 6, 2022
@saranshdhingra
Copy link
Contributor

Possibly related to #2427

@yoshi-automation yoshi-automation added 🚨 This issue needs some love. triage me I really want to be triaged. labels Jan 6, 2022
@saranshdhingra saranshdhingra added priority: p2 Moderately-important priority. Fix may not be included in next release. and removed triage me I really want to be triaged. labels Jan 18, 2022
@yoshi-automation yoshi-automation removed the 🚨 This issue needs some love. label Jan 18, 2022
@vishwarajanand
Copy link
Contributor

Hi @MujtabaFR, this issue is quite old and not having any active discussion. I am closing this now, but please feel free to reopen if its still an issue at your end.

Prima facie the snippet you provided has the following issues:

  1. Not having any project_id while creating FirestoreClient instance. Ref the code sample
  2. $docRef->snapshot() provides an instance of DocumentSnapshot. If you are expecting to get the actual data/contents, you needed to do: $snapshot->data()
  3. "status": "UNAVAILABLE" and "403:Forbidden" usually appears when the requested resource isn't accessible or doesn't exist.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: firestore Issues related to the Firestore API. priority: p2 Moderately-important priority. Fix may not be included in next release.
Projects
None yet
Development

No branches or pull requests

5 participants