Storage `bucket.exists()` always returns false for firebase emulator
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 35/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Estancado
- Stack tecnológico
- node.js, typescript
Línea de trabajo
Empieza reproduciendo el problema con firebase emulators:start --only storage,functions usando la configuración indicada de firebase-admin@12.0.0 y firebase-tools@13.1.0. Rastrea getStorage().bucket() y bucket.exists() con el nombre del bucket predeterminado y compara después la solicitud y la respuesta del emulador con el estado esperado del bucket. Se considera terminado cuando bucket.exists() devuelve true para el bucket predeterminado correspondiente del emulador.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
[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)
- Lenguaje dominante
- TypeScript
- Estrellas
- 1.7k
- Forks
- 419
- Merge medio
- 4 d 20 h
- PR fusionados (30 d)
- 16
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de firebase/firebase-admin-node
-
Dificultad 3/5 1-2 días Aptitud para principiantes 35/100
firebase/firebase-admin-node#3234 ·
-
firebase/firebase-admin-node#3221 · 3 comentarios · 1 asignado ·
-
api: messaging
Dificultad 3/5 1-2 días Aptitud para principiantes 70/100
firebase/firebase-admin-node#3215 ·
-
api: messaging
Dificultad 5/5 Más de una semana Aptitud para principiantes 28/100
firebase/firebase-admin-node#3214 ·
-
api: firestore type: feature request
firebase/firebase-admin-node#3183 · 1 comentario · 1 asignado ·
Todos los issues de firebase/firebase-admin-node
Issues similares
-
bug(cli): hapi doctor inline-media prints a fabricated B:\ helper-script path in packaged installs Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
-
Crush Abierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 85/100
catppuccin/catppuccin#3125 ·
-
Add a SECURITY.md Abierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 90/100
ElementsProject/cln-application#167 · 1 comentario · 1 reacción ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
Quantco/pnpm-licenses#17 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100