juhaku / utoipa

Simple, Fast, Code first and Compile time generated OpenAPI documentation for Rust
Apache License 2.0
2k stars 160 forks source link

My Ci is failing #940

Closed kingsleyh closed 1 month ago

kingsleyh commented 1 month ago

Just started happening - any idea why it can't download it?

#13 275.2 error: failed to run custom build command for `utoipa-swagger-ui v7.0.3`
#13 275.2 
#13 275.2 Caused by:
#13 275.2   process didn't exit successfully: `/app/target/release/build/utoipa-swagger-ui-94ae60d10ee2cff4/build-script-build` (exit status: 101)
#13 275.2   --- stdout
#13 275.2   OUT_DIR: /app/target/release/build/utoipa-swagger-ui-605372b8f80681d0/out
#13 275.2   SWAGGER_UI_DOWNLOAD_URL: https://github.com/swagger-api/swagger-ui/archive/refs/tags/v5.17.3.zip
#13 275.2   start download to : "/app/target/release/build/utoipa-swagger-ui-605372b8f80681d0/out/v5.17.3.zip"
#13 275.2   cargo:rerun-if-env-changed=SWAGGER_UI_DOWNLOAD_URL
#13 275.2   reqwest feature: Err(NotPresent)
#13 275.2   trying to download using `curl` system package
#13 275.2 
#13 275.2   --- stderr
#13 275.2   thread 'main' panicked at /usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/utoipa-swagger-ui-7.0.3/build.rs:58:47:
#13 275.2   called `Result::unwrap()` on an `Err` value: Os { code: 2, kind: NotFound, message: "No such file or directory" }
#13 275.2   note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
#13 275.2 warning: build failed, waiting for other jobs to finish...
#13 ERROR: process "/bin/sh -c set -e\ncargo build --release\n\ncp ./target/release/$APP_NAME /bin/server\n" did not complete successfully: exit code: 101
kingsleyh commented 1 month ago

hmm just started working again after retry several times

Libbum commented 1 month ago

FYI this also happened to us. I pinned utoipa-swagger-ui 7.0.1 for the moment as a workaround. But if it's now magiced a solution, I'll unpin it and report back to see if that's true for us.

juhaku commented 1 month ago

I believe that the actual issue lies within GitHub itself. Since it tries to download the Swagger UI from GitHub releases and it is not meant for heavy traffic IMO and might be bit unpredictable.

However it tries to download the Swagger UI with curl and fails if underlying system does not have that package. Alternatively it can be downloaded with reqwest via reqwest feature flag or since 7.1.0 there is vendored feature flag that provides vendored Swagger UI which basically behaves the same as pre 7.x.x versions. I noticed that there is still a need for a vendored Swagger UI to give ultimate stability in sandboxed environments.

Libbum commented 1 month ago

Can confirm that not having curl in the underlying container is the issue.

"trying to download using curl system package" in that sense isn't the most helpful of errors, would suggest something more explicit like "failed to find the system package curl".

juhaku commented 1 month ago

True, could actually improved at sometime in future. I'll add task to the board about this