dfinity / dfinity/sdk

`dfx deploy --network=ic` failure on a newly created project

Open
#3,870 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

needs-triage
Dominant language
Rust
Stars
204
Forks
98
PR merge metrics
No merged PRs in 30d

Description

I tried the following:

  1. dfx new --frontend vanilla hello
  2. dfx deploy --network=ic

I expected it to successfully deploy both backend and frontend canisters.

Instead, this happened:

WARN: The default identity is not stored securely. Do not use it to control a lot of cycles/ICP. Create a new identity with `dfx identity new` and use it in mainnet-facing comm
ands with the `--identity` flag
Deploying all canisters.
Creating canisters...
Creating canister hello_backend...
hello_backend canister created on network ic with canister id: mnqht-aaaaa-aaaal-qjpaq-cai
Creating canister hello_frontend...
hello_frontend canister created on network ic with canister id: metmp-wiaaa-aaaal-qjpba-cai
Building canisters...
Building frontend...
Error: Failed while trying to deploy canisters.
Caused by: Failed to build all canisters.
Caused by: Failed while trying to build all canisters.
Caused by: The post-build step failed for canister 'metmp-wiaaa-aaaal-qjpba-cai' (hello_frontend)
Caused by: Failed to build frontend for network 'ic'.
Caused by: The command 'cd "/Users/paul/hello" && CANISTER_CANDID_PATH="/Users/paul/hello/.dfx/ic/canisters/hello_frontend/assetstorage.did" CANISTER_CANDID_PATH_HELLO_BACKEND=
"/Users/paul/hello/.dfx/ic/canisters/hello_backend/hello_backend.did" CANISTER_ID="metmp-wiaaa-aaaal-qjpba-cai" CANISTER_ID_HELLO_BACKEND="mnqht-aaaaa-aaaal-qjpaq-cai" CANISTER
_ID_HELLO_FRONTEND="metmp-wiaaa-aaaal-qjpba-cai" DFX_NETWORK="ic" DFX_VERSION="0.22.0" NODE_ENV="production" "npm" "run" "build" "--workspace" "hello_frontend"' failed with exi
t status 'exit status: 1'.
Stdout:

> hello_frontend@0.0.0 prebuild
> dfx generate


Stderr:
Building canisters before generate for Motoko
WARN: .did file for canister 'hello_frontend' does not exist.
Generating type declarations for canister hello_frontend:
Error: Failed while trying to generate type declarations for 'hello_frontend'.
Caused by: Candid file: /Users/paul/hello/.dfx/local/canisters/hello_frontend/assetstorage.did doesn't exist.
npm ERR! Lifecycle script `build` failed with error:
npm ERR! Error: command failed
npm ERR!   in workspace: hello_frontend@0.0.0
npm ERR!   at location: /Users/paul/hello/src/hello_frontend
Meta

dfx --version:

dfx 0.22.0

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the failure with dfx new --frontend vanilla hello followed by dfx deploy --network=ic on dfx 0.22.0. Start by tracing the frontend build command and its dfx generate prebuild step, especially the missing .dfx/local/canisters/hello_frontend/assetstorage.did; done means a newly created project deploys both backend and frontend canisters to ic.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
build-system, cli
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.