firebase / firebase/firebase-tools

Failed to list Firebase projects: Unable to parse JSON: SyntaxError: Unexpected token < in JSON at position 0

Open
#6,381 1 comment 0 reactions 1 assignee Claimed by @joehan View on GitHub
api: core type: bug
Dominant language
TypeScript
Stars
4.5k
Forks
1.3k
Avg merge
1d 12h
Merged PRs (30d)
84

Description

### Environment info

**firebase-tools: 12.5.4**

**Platform: Ubuntu 20.04.6 LTS (hosted on GCE)**

### Test case

List Firebase projects using firebase-tools

### Steps to reproduce

`npm install -g firebase-tools`
`firebase login --no-localhost`
`firebase projects:list`

### Expected behavior

Display a list of the current projects associated with the current logged in user, including: Project Display Name, Project ID, Project Number and Resource Location ID

### [REQUIRED] Actual behavior

`firebase projects:list --debug`
```
[2023-09-20T15:43:02.525Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
[2023-09-20T15:43:02.526Z] > authorizing via signed-in user (xxxx@xxxx.com)
⠋ Preparing the list of your Firebase projects[2023-09-20T15:43:02.532Z] >>> [apiv2][query] GET https://firebase.googleapis.com/v1beta1/projects pageSize=1000
⠙ Preparing the list of your Firebase projects[2023-09-20T15:43:02.696Z] <<< [apiv2][status] GET https://firebase.googleapis.com/v1beta1/projects 403
[2023-09-20T15:43:02.697Z] <<< [apiv2][body] GET https://firebase.googleapis.com/v1beta1/projects [omitted]
[2023-09-20T15:43:02.697Z] Unable to parse JSON: SyntaxError: Unexpected token < in JSON at position 0
✖ Preparing the list of your Firebase projects
[2023-09-20T15:43:02.714Z] FirebaseError: Unable to parse JSON: SyntaxError: Unexpected token < in JSON at position 0
at RetryOperation._fn (/home/chris/.nvm/versions/node/v18.12.1/lib/node_modules/firebase-tools/lib/apiv2.js:257:39)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

Error: Failed to list Firebase projects. See firebase-debug.log for more info.

Having trouble? Try again or contact support with contents of firebase-debug.log
```

### More info
The reported behavior started recently (not sure about the exact date, but most likely in the last couple of weeks)
Also impacts other firebase-tools commands, like `firebase use `
Using the same login account on local MacOS workstation works perfectly.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.