firebase / firebase/firebase-tools
Dart cloud functions fails to deploy (terminated: Application failed to start: failed to load /workspace/bin/server: no such file or directory)
- Dominant language
- TypeScript
- Stars
- 4.5k
- Forks
- 1.3k
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 84
Description
### [REQUIRED] Environment info
**firebase-tools:** 15.18.0 and 15.27.0.
**Platform:** NixOS (linux)
### [REQUIRED] Test case
Create a new Dart cloud functions project using
`firebase init functions`
### [REQUIRED] Steps to reproduce
I just followed the steps in [Get started with the experimental Dart SDK](https://firebase.google.com/docs/functions/start-dart). Basically the following steps:
1. Enable experimental dart functions `firebase experiments:enable dartfunctions`
2. Create a project `firebase init functions` (used an existing project with blaze plan)
3. Made sure the project runs locally after starting the emulators `firebase emulators:start`
4. Next I deployed the cloud functions using `firebase deploy --only functions`
### [REQUIRED] Expected behavior
The dart cloud function "hello-world" should have deployed successfully in my project.
### [REQUIRED] Actual behavior
**The output from running `firebase deploy --only functions`**
=== Deploying to 'redacted-2b55b'...
i deploying functions
i functions: preparing codebase default for deployment
i functions: ensuring required API cloudfunctions.googleapis.com is enabled...
i functions: ensuring required API cloudbuild.googleapis.com is enabled...
i artifactregistry: ensuring required API artifactregistry.googleapis.com is enabled...
i functions: running build_runner...
i functions: compiling Dart to linux-x64 executable...
i functions: Dart compilation complete.
i functions: Loading and analyzing source code for codebase default to determine what to deploy
i functions: preparing functions directory for uploading...
i functions: packaged /tmp/backend1/functions (3.04 MB) for uploading
i functions: ensuring required API cloudfunctions.googleapis.com is enabled...
✔ functions: functions source uploaded successfully
i functions: updating Dart 3 (Cloud Run) function hello-world(us-central1)...
The user-provided container failed to start and listen on the port defined provided by the PORT=8080 environment variable within the allocated timeout. This can happen when the container port is misconfigured or if the timeout is too short. The health check timeout can be extended. Logs for this revision might contain more information.
Logs URL: https://console.cloud.google.com/logs/viewer?project=redacted-2b55b&resource=cloud_run_revision/service_name/hello-world/revision_name/hello-world-00002-f8l&advancedFilter=resource.type%3D%22cloud_run_revision%22%0Aresource.labels.service_name%3D%22hello-world%22%0Aresource.labels.revision_name%3D%22hello-world-00002-f8l%22
For more troubleshooting guidance, see https://cloud.google.com/run/docs/troubleshooting#container-failed-to-start
⚠ functions: Deploys failed. Skipping deletes.
Functions deploy had errors with the following functions:
hello-world(us-central1)
i functions: Dart functions may not yet be visible in the Firebase Console. View them in the Cloud Console at https://console.cloud.google.com/run/services?project=redacted-2b55b
Error: There was an error deploying functions
**The logs in cloud console have the following errors**
terminated: Application failed to start: failed to load /workspace/bin/server: no such file or directory
Application exec likely failed
Default STARTUP TCP probe failed 1 time consecutively for container "worker" on port 8080. The instance was not started.
Connection failed with status CANCELLED.
Contributor guide
Research direction
Reproduce the failure with `firebase init functions`, the experimental Dart SDK steps, and `firebase deploy --only functions` on the reported setup. Start by tracing the Dart compilation and deployment flow around the generated `/workspace/bin/server` artifact and compare it with the successful emulator run. Done means the `hello-world` function deploys and starts listening on port 8080 without the missing-server error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- dart, firebase
- Domain
- backend, cloud
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100