-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Improve error messages when functions fails to load #5782
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #5782 +/- ##
==========================================
- Coverage 55.21% 55.17% -0.04%
==========================================
Files 329 329
Lines 22500 22521 +21
Branches 4586 4588 +2
==========================================
+ Hits 12423 12427 +4
- Misses 8972 8990 +18
+ Partials 1105 1104 -1
☔ View full report in Codecov by Sentry. |
We will proactively try to identify common issues based on error messages to provide better debugging experience. 1. No `venv` directory: ``` ➜ functions firebase emulators:start i emulators: Starting emulators: functions i functions: Watching "/Users/REDACTED/google/cf3-pyinit/functions" for Cloud Functions... ⬢ functions: Failed to load function definition from source: FirebaseError: Failed to find location of Firebase Functions SDK: Missing virtual environment at venv directory. Did you forget to run 'python3.11 -m venv venv'? ``` 2. No `firebase-functions` package ``` ➜ functions firebase emulators:start i emulators: Starting emulators: functions i functions: Watching "/Users/REDACTED/google/cf3-pyinit/functions" for Cloud Functions... ⬢ functions: Failed to load function definition from source: FirebaseError: Failed to find location of Firebase Functions SDK. Did you forget to run 'source /Users/danielylee/google/cf3-pyinit/functions/venv/bin/activate && python3.11 -m pip install -r requirements.txt'? ``` 3. Runtime errors ``` ➜ functions firebase emulators:start i emulators: Starting emulators: functions i functions: Watching "/Users/REDACTED/google/cf3-pyinit/functions" for Cloud Functions... ⚠ functions: Failed to detect functions from source FirebaseError: Failed to parse build specification. stderr:WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead. * Running on http://127.0.0.1:8081 Press CTRL+C to quit [2023-05-02 19:29:18,285] ERROR in app: Exception on /__/functions.yaml [GET] Traceback (most recent call last): ... File "/Users/REDACTED/google/cf3-pyinit/functions/main.py", line 8, in <module> foo += 1 ^^^ NameError: name 'foo' is not defined ```
|
If venv is created and requirements is not installed. It still says: Hm, even after doing it. |
We will proactively try to identify common issues based on error messages to provide better debugging experience. 1. No `venv` directory: ``` ➜ functions firebase emulators:start i emulators: Starting emulators: functions i functions: Watching "/Users/REDACTED/google/cf3-pyinit/functions" for Cloud Functions... ⬢ functions: Failed to load function definition from source: FirebaseError: Failed to find location of Firebase Functions SDK: Missing virtual environment at venv directory. Did you forget to run 'python3.11 -m venv venv'? ``` 2. No `firebase-functions` package ``` ➜ functions firebase emulators:start i emulators: Starting emulators: functions i functions: Watching "/Users/REDACTED/google/cf3-pyinit/functions" for Cloud Functions... ⬢ functions: Failed to load function definition from source: FirebaseError: Failed to find location of Firebase Functions SDK. Did you forget to run 'source /Users/danielylee/google/cf3-pyinit/functions/venv/bin/activate && python3.11 -m pip install -r requirements.txt'? ``` 3. Runtime errors ``` ➜ functions firebase emulators:start i emulators: Starting emulators: functions i functions: Watching "/Users/REDACTED/google/cf3-pyinit/functions" for Cloud Functions... ⚠ functions: Failed to detect functions from source FirebaseError: Failed to parse build specification. stderr:WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead. * Running on http://127.0.0.1:8081 Press CTRL+C to quit [2023-05-02 19:29:18,285] ERROR in app: Exception on /__/functions.yaml [GET] Traceback (most recent call last): ... File "/Users/REDACTED/google/cf3-pyinit/functions/main.py", line 8, in <module> foo += 1 ^^^ NameError: name 'foo' is not defined ```
We will proactively try to identify common issues based on error messages to provide better debugging experience.
venvdirectory:firebase-functionspackage