FIREBASE_STORAGE_EMULATOR_HOST Environment Variable does not work with Admin SDK
維護者通常 4 天內回覆
@jonathanedey 已經在處理了。
開始於 2025年2月14日。
評估
這個 Issue 還沒有評估資料。
描述
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");
- 主要語言
- Java
- 星號
- 620
- 分支
- 305
- 平均合併
- 3 天 12 小時
- 30 天內合併 PR
- 12
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
firebase/firebase-admin-java 的其他 Issue
-
google-http-client-jackson2 cannot be excluded even when a JsonFactory is configured via FirebaseOptions可能已有人在做 @lahirumaramba 於 12 天前認領。 未關閉
難度 4/5 3-5 天 新手友好度 48/100
firebase/firebase-admin-java#1231 · 已指派 1 人 ·
維護者通常 4 天內回覆
-
[BUG] RemoteConfig unit tests fail in non-English (e.g., Korean) Locales due to Date Parsing可能已有人在做 @rathovarun1032 於 211 天前認領。 未關閉api: remoteconfig
firebase/firebase-admin-java#1196 · 1 則留言 · 已指派 2 人 ·
維護者通常 4 天內回覆
-
Auth list tenants is not pageable可能已有人在做 @siddharthmohan619-eng 於 216 天前認領。 未關閉
難度 3/5 1-2 天 新手友好度 45/100
firebase/firebase-admin-java#1192 · 3 則留言 ·
維護者通常 4 天內回覆
-
needs-triage type: feature request
難度 3/5 1-2 天 新手友好度 45/100
firebase/firebase-admin-java#1149 · 1 則留言 ·
維護者通常 4 天內回覆
-
[FR] Expose `link` / `link_android` in notifications for deep linking可能重新可做 @won-seoop 於 142 天前認領,目前沒有進行中的 PR。 未關閉needs-triage type: feature request
難度 5/5 一週以上 新手友好度 45/100
firebase/firebase-admin-java#1142 · 2 則留言 ·
維護者通常 4 天內回覆
查看 firebase/firebase-admin-java 的全部 Issue
相似的 Issue
-
Use GHA setup gradle action可能已有人在做 @bric3 今天認領。 未關閉
難度 2/5 1-3 小時 新手友好度 67/100
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 72/100
openhab/openhab-addons#21921 ·
維護者通常 1 天內回覆
-
bug
難度 2/5 1-3 小時 新手友好度 62/100
jellyfin/jellyfin-androidtv#5885 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 76/100
維護者通常 1 天內回覆
-
priority:P2 product:orazaka type:bug
難度 2/5 1-3 小時 新手友好度 78/100
維護者通常 1 天內回覆