Storage `bucket.exists()` always returns false for firebase emulator
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 35/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- node.js, typescript
Direzione di ricerca
Inizia riproducendo il problema con firebase emulators:start --only storage,functions usando la configurazione indicata con firebase-admin@12.0.0 e firebase-tools@13.1.0. Traccia getStorage().bucket() e bucket.exists() con il nome del bucket predefinito, quindi confronta la richiesta e la risposta dell’emulatore con lo stato previsto del bucket. Il lavoro è completato quando bucket.exists() restituisce true per il bucket predefinito corrispondente dell’emulatore.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
[READ] Step 1: Are you in the right place?
- For issues related to the code in this repository file a Github issue.
- If the issue pertains to Cloud Firestore, read the instructions in the "Firestore issue"
template. - For general technical questions, post a question on StackOverflow
with the firebase tag. - For general Firebase discussion, use the firebase-talk
google group. - For help troubleshooting your application that does not fall under one
of the above categories, reach out to the personalized
Firebase support channel.
[REQUIRED] Step 2: Describe your environment
- Operating System version: Ubuntu
- Firebase SDK version: firebase-admin@12.0.0 firebase-tools@13.1.0
- Firebase Product: storage
- Node.js version: 18.16.1
- NPM version: 9.5.1
[REQUIRED] Step 3: Describe the problem
Steps to reproduce:
Create basic project with storage and functions setup for emulation: (functions only used to call storage bucket methods)
// firebase.json
"emulators": {
"functions": {
"port": 5001
},
"storage": {
"port": 9199
},
// ...rest of config
Run emulator with firebase emulators:start --only storage,functions
Verify storage bucket exists in emulator and the name is matched in firebase config showing storage_bucket as the default
Hit the firebase function to run the storage bucket code
Calling bucket.exists() from firebase function always returns false.
Expected outcome:
Calling bucket.exists() from firebase function return true when accessing the default bucket.
Relevant Code:
import { onRequest } from 'firebase-functions/v2/https';
import { getStorage } from 'firebase-admin/storage';
export const foo = onRequest(async (req, res) => {
const storage = getStorage();
console.log('APP STORAGE BUCKET:', storage.app.options.storageBucket);
const bucket = storage.bucket();
console.log('DEFAULT STORAGE BUCKET:', `name=${bucket.name}`, `id=${bucket.id}`);
const exists = await bucket.exists();
console.log('BUCKET EXISTS?:', exists);
res.send(`BUCKET EXISTS?: ${exists}`);
});
Images
Console output:
Emulator Storage: (name of bucket matches id in code)
- Lingua principale
- TypeScript
- Stelle
- 1.7k
- Fork
- 419
- Merge medio
- 4g 20h
- PR unite (30g)
- 16
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di firebase/firebase-admin-node
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 35/100
firebase/firebase-admin-node#3234 ·
-
firebase/firebase-admin-node#3221 · 3 commenti · 1 assegnatario ·
-
api: messaging
Difficoltà 3/5 1-2 giorni Idoneità per principianti 70/100
firebase/firebase-admin-node#3215 ·
-
api: messaging
Difficoltà 5/5 Più di una settimana Idoneità per principianti 28/100
firebase/firebase-admin-node#3214 ·
-
api: firestore type: feature request
firebase/firebase-admin-node#3183 · 1 commento · 1 assegnatario ·
Tutte le issue di firebase/firebase-admin-node
Issue simili
-
bug(cli): hapi doctor inline-media prints a fabricated B:\ helper-script path in packaged installs Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
-
Crush Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
catppuccin/catppuccin#3125 ·
-
Add a SECURITY.md Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
ElementsProject/cln-application#167 · 1 commento · 1 reazione ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
Quantco/pnpm-licenses#17 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100