Skip to content

Conversation

@taeold
Copy link
Contributor

@taeold taeold commented May 2, 2023

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'?
  1. 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'?
  1. 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

@taeold taeold enabled auto-merge (squash) May 2, 2023 23:25
@codecov-commenter
Copy link

Codecov Report

Patch coverage: 13.88% and project coverage change: -0.04 ⚠️

Comparison is base (19a8384) 55.21% compared to head (88fc86b) 55.17%.

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     
Impacted Files Coverage Δ
src/deploy/functions/runtimes/python/index.ts 28.12% <7.69%> (-4.79%) ⬇️
src/functions/python.ts 35.29% <22.22%> (-3.17%) ⬇️
src/deploy/functions/runtimes/discovery/index.ts 87.23% <100.00%> (ø)

... and 1 file with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@taeold taeold merged commit c48ccfe into master May 2, 2023
ProfHercules pushed a commit to ProfHercules/firebase-tools that referenced this pull request May 5, 2023
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
```
@satpalsr
Copy link

satpalsr commented May 22, 2023

If venv is created and requirements is not installed. It still says: Did you forget to run 'python3.11 -m venv venv'?
But it should say Did you forget to run . "/functions/venv/bin/activate" && python3.11 -m pip install -r requirements.txt which is only the case when venv is absent.

Hm, even after doing it.
I keep getting
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'?

tonyjhuang pushed a commit that referenced this pull request May 22, 2023
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
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants