-
Notifications
You must be signed in to change notification settings - Fork 65
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
Fastly deploy returns 400 "Failed to extract metadata from package" #1387
Comments
If this is reproduceable on your machine, can you attempt to narrow this down by disabling each of the three types of metadata individually, to see which one is triggering the failure? |
Seems reproducible - at least I still get the error message. I am unsure about how to disable metadata types individually. This is the output of $ fastly compute build --metadata-show
✓ Verifying fastly.toml
✓ Identifying package name
✓ Identifying toolchain
✓ Running [scripts.build]
INFO: Below is the metadata attached to the Wasm binary
╭──────────────┬───────────────────────────────────────────────────────────────╮
│ KIND ┆ VALUE │
╞══════════════╪═══════════════════════════════════════════════════════════════╡
│ kind ┆ module │
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
│ name ┆ edge_api-6be6cb20ab340c3f.wasm │
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
│ range ┆ 0x0..0x12045b33 │
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
│ language ┆ C11 │
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
│ language ┆ Rust │
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
│ processed-by ┆ clang [18.1.2-wasi-sdk (https://github.com/llvm/llvm-project │
│ ┆ 26a1d6601d727a96f4301d0d8647b5a42760ae0c)] │
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
│ processed-by ┆ rustc [1.83.0 (90b35a623 2024-11-26)] │
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
│ processed-by ┆ fastly [v10.18.0 (Rust)] │
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
│ processed-by ┆ fastly_data [{"build_info":{"mem_heap_alloc":"10-20MB"},"mach │
│ ┆ ine_info":{},"package_info":{},"script_info":{"build_script": │
│ ┆ "cargo build --bin edge-api --target wasm32-wasip1 --color │
│ ┆ always \u0026\u0026\nTARGET_DIR=$(cargo metadata │
│ ┆ --format-version=1 | python3 -c \"import sys, json; │
│ ┆ print(json.load(sys.stdin)['target_directory'])\") │
│ ┆ \u0026\u0026\nmkdir -p ${TARGET_DIR}/wasm32-wasi/release │
│ ┆ \u0026\u0026\ncommand cp -f │
│ ┆ ${TARGET_DIR}/wasm32-wasip1/debug/edge-api.wasm │
│ ┆ ${TARGET_DIR}/wasm32-wasi/release/edge-api.wasm\n"}}] │
╰──────────────┴───────────────────────────────────────────────────────────────╯
✓ Creating package archive Trying to build without metadata fails with the same issue. $ fastly compute build --metadata-disable && fastly compute deploy
✓ Verifying fastly.toml
✓ Identifying package name
✓ Identifying toolchain
✓ Running [scripts.build]
✓ Creating package archive
SUCCESS: Built package (pkg/edge-api.tar.gz)
✓ Verifying fastly.toml
✗ Uploading package
ERROR: the Fastly API returned 400 Bad Request: Bad request (Failed to extract metadata from package).
If you believe this error is the result of a bug, please file an issue: https://github.com/fastly/cli/issues/new?labels=bug&template=bug_report.md
|
Thanks for those details; given the nature of the error, this will need to be reported to the Fastly Support team as the error is coming from the API endpoint and we'll need to get information from the team who owns it to find out what the cause of the error is. |
Wait a moment... that 'build script' is substantially more complicated than the usual one and may be breaking the JSON parser. Would you try moving those commands into a shell script and changing the |
So! It turns out this was a fun combination of a really bad error message and user error :) I was accidentally building from our non-prod environment. This doesn't perform a So, building it with the correct environment (where the only notable difference in the build script is the Feel free to close, unless you want to follow up with the API team to make the error message better :) |
Thank you for the details! We definitely should find a way to improve the error response here. |
Version
What happened
A
fastly compute deploy
locally on my machine seems to return a 400 from fastly with the error message "Failed to extract metadata from package". The same repository can run the command fine in CI. Anecdotally this is an issue we've seen before, where some coworkers cannot runfastly compute deploy
on the exact same repository that others can.The command with output looks like this:
If I use --debug-mode the final response seems to be this:
Steps taken to troubleshoot
The text was updated successfully, but these errors were encountered: