FIREBASE_STORAGE_EMULATOR_HOST Environment Variable does not work with Admin SDK
Mantenedores costumam responder em até 4 dias
@jonathanedey já está trabalhando nisso.
Desde 14/2/2025.
Avaliação
Esta issue ainda não foi avaliada.
Descrição
My environment:
- Operating System version: Mac OS Sonoma 14.0 (23A344)
- Firebase Admin SDK version: 9.2.0
- Firebase Product: Storage Emulator
The problem:
When setting the environment variable "FIREBASE_STORAGE_EMULATOR_HOST" to 127.0.0.1:9199 (the default Storage Emulator Port and IP) to use the Firebase Storage Emulator the Admin SDK does not detect this environment variable.
Other Environment variables such as "FIREBASE_DATABASE_EMULATOR_HOST" and "FIRESTORE_EMULATOR_HOST" do work perfectly fine and as expected. They make a connection to emulators on the device.
I have gone as far to test and see if this issue is persistent on other Admin SDK's such as the Node.Js SDK. It is NOT an issue that persists on the SDK for Node.js.
As see here, this was previously an issue filed for the Firebase Admin SDKin the GO Repository for the Admin SDK (see here) and was fixed here (see here) and has been since claimed to be fixed and the logic used in the Node Admin SDK project will be implemented.
The same issue previously on the Go Repo, appears to be present on the Admin Java SDK. Even using the "STORAGE_EMULATOR_HOST" environment variable as it was changed to in the GO repo, does not work.
Documentation on the Firebase Admin SDK docs is also incorrect if this is the case.
Steps to reproduce:
Set either environment variable "STORAGE_EMULATOR_HOST" or "FIREBASE_STORAGE_EMULATOR_HOST" to your Emulator host address and port (the default is 127.0.0.1:9199)
Use the Java Admin SDK to try and make a call like normal.
See it fail and use the production Cloud Storage instance.
Relevant Code:
Environment Variable Set via Intellij Run Configuration
InputStream input = this.getClass().getResourceAsStream("/service-account.json");
assert input != null;
GoogleCredentials googleCredentials = GoogleCredentials.fromStream(input);
FirebaseOptions options = FirebaseOptions.builder()
.setCredentials(googleCredentials)
.setProjectId("project-id")
.setDatabaseUrl("https://project-id-default-rtdb.firebaseio.com")
.setStorageBucket("project-id.appspot.com")
.build();
FirebaseApp.initializeApp(options);
InputStream fileInput = this.getClass().getResourceAsStream("/someFile.anyExtension");
Bucket bucket = StorageClient.getInstance().bucket();
bucket.create("someFile.anyExtension", fileInput, "application/anyExtension");
- Linguagem predominante
- Java
- Estrelas
- 620
- Forks
- 306
- Merge médio
- 4d 7h
- PRs com merge (30d)
- 13
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Tem um modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de firebase/firebase-admin-java
-
google-http-client-jackson2 cannot be excluded even when a JsonFactory is configured via FirebaseOptionsTalvez já em andamento @lahirumaramba assumiu há 6 dias. Aberta
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 48/100
firebase/firebase-admin-java#1231 · 1 responsável ·
Mantenedores costumam responder em até 4 dias
-
[BUG] RemoteConfig unit tests fail in non-English (e.g., Korean) Locales due to Date ParsingTalvez já em andamento @rathovarun1032 assumiu há 204 dias. Abertaapi: remoteconfig
firebase/firebase-admin-java#1196 · 1 comentário · 2 responsáveis ·
Mantenedores costumam responder em até 4 dias
-
Auth list tenants is not pageableTalvez já em andamento @siddharthmohan619-eng assumiu há 209 dias. Aberta
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 45/100
firebase/firebase-admin-java#1192 · 3 comentários ·
Mantenedores costumam responder em até 4 dias
-
needs-triage type: feature request
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 45/100
firebase/firebase-admin-java#1149 · 1 comentário ·
Mantenedores costumam responder em até 4 dias
-
needs-triage type: feature request
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 45/100
firebase/firebase-admin-java#1142 · 2 comentários ·
Mantenedores costumam responder em até 4 dias
Todas as issues de firebase/firebase-admin-java
Issues semelhantes
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
-
area/docs
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 88/100
Mantenedores costumam responder em até 1 dia
-
BoxChart rejects valid List.of data with NullPointerExceptionTalvez já em andamento @PHJ2000 assumiu hoje. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100