Skip to content
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

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

Open
ninegua opened this issue Aug 10, 2024 · 2 comments
Open

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

ninegua opened this issue Aug 10, 2024 · 2 comments
Labels
needs-triage This ticket needs investigation.

Comments

@ninegua
Copy link
Member

ninegua commented Aug 10, 2024

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
@ninegua ninegua added the needs-triage This ticket needs investigation. label Aug 10, 2024
@ninegua
Copy link
Member Author

ninegua commented Aug 10, 2024

It looks like dfx was looking for a did file from local build

Candid file: /Users/paul/hello/.dfx/local/canisters/hello_frontend/assetstorage.did doesn't exist.

If I start replica and deploy locally first, then deploy to ic works as expected.

@KereyWatters
Copy link

We're running into this when trying to deploy to mainnet too.
As part of our deployment step, I'm spinning up and running a local deploy first to generate the files, before doing a --ic deploy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-triage This ticket needs investigation.
Projects
None yet
Development

No branches or pull requests

2 participants