firebase-admin-python
firebase-admin-python copied to clipboard
Method Not implemented
[READ] Step 1: Are you in the right place?
This error is happening while using storage from firebase_admin
[REQUIRED] Step 2: Describe your environment
- Operating System version: MacOS 13.4
- Firebase SDK version: 6.1.0
- Firebase Product: storage
- Python version: 3.11
- Pip version: 23.1.2
[REQUIRED] Step 3: Describe the problem
I'm using firebase-tools and I have configured STORAGE_EMULATOR_HOST=http://localhost:9199 but I'm getting this error:
google.api_core.exceptions.MethodNotImplemented: 501 POST http://localhost:9199/storage/v1/b?project=test-dev&prettyPrint=false: Not Implemented
Steps to reproduce:
I executed the code below.
Relevant Code:
from firebase_admin import firestore
from firebase_admin import storage
from firebase_admin.exceptions import NotFoundError, ConflictError
# Cloud Storage Instantiation
BUCKET_NAME = "administrative"
bucket = storage.bucket(BUCKET_NAME)
if not bucket.exists():
try:
bucket.create()
bucket.labels = {
"type": "internal",
"name": "administrative",
}
except NotFoundError:
print("Not Found Error")
except ConflictError:
print("Conflict Error")
Could you try setting STORAGE_EMULATOR_HOST to 127.0.0.1:9199?