Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[BUG] SCCACHE_S3_USE_SSL not working for master branch #1803

Closed
DCjanus opened this issue Jun 11, 2023 · 8 comments · Fixed by #1804
Closed

[BUG] SCCACHE_S3_USE_SSL not working for master branch #1803

DCjanus opened this issue Jun 11, 2023 · 8 comments · Fixed by #1804

Comments

@DCjanus
Copy link
Contributor

DCjanus commented Jun 11, 2023

To reproduce this, I wrote Dockerfile like this, and run with docker build -t sccache-test --network host .

FROM rust:latest

RUN cargo install --git https://github.com/mozilla/sccache.git sccache --no-default-features --features s3

ENV RUSTC_WRAPPER ${CARGO_HOME}/bin/sccache
ENV SCCACHE_BUCKET sccache
ENV SCCACHE_REGION us-east-1
ENV SCCACHE_S3_USE_SSL false
ENV AWS_ACCESS_KEY_ID minioadmin
ENV AWS_SECRET_ACCESS_KEY minioadmin
ENV SCCACHE_ENDPOINT http://localhost:9000

WORKDIR /src

RUN cargo new --bin sccache-test && \
    cd sccache-test && \
    echo 'fn main() { println!("Hello, world!"); }' > src/main.rs \
    && cargo build --release

And got this error:

------                                                                                                                                                                                                                             
 > [4/4] RUN cargo new --bin sccache-test &&     cd sccache-test &&     echo 'fn main() { println!("Hello, world!"); }' > src/main.rs     && cargo build --release:                                                                
#0 0.847      Created binary (application) `sccache-test` package                                                                                                                                                                  
#0 1.249 error: failed to run `rustc` to learn about target-specific information                                                                                                                                                   
#0 1.249                                                                                                                                                                                                                           
#0 1.249 Caused by:                                                                                                                                                                                                                
#0 1.249   process didn't exit successfully: `/usr/local/cargo/bin/sccache rustc - --crate-name ___ --print=file-names --crate-type bin --crate-type rlib --crate-type dylib --crate-type cdylib --crate-type staticlib --crate-type proc-macro --print=sysroot --print=split-debuginfo --print=crate-name --print=cfg` (exit status: 2)
#0 1.249   --- stderr
#0 1.249   sccache: error: Server startup failed: cache storage failed to read: Unexpected (temporary) at read => send async request
#0 1.249 
#0 1.249   Context:
#0 1.249       url: https://localhost:9000/sccache/.sccache_check
#0 1.249       called: http_util::Client::send_async
#0 1.249       service: s3
#0 1.249       path: .sccache_check
#0 1.249       range: 0-
#0 1.249 
#0 1.249   Source: error sending request for url (https://localhost:9000/sccache/.sccache_check): error trying to connect: received corrupt message of type InvalidContentType
#0 1.249 
#0 1.249   Caused by:
#0 1.249       0: error trying to connect: received corrupt message of type InvalidContentType
#0 1.249       1: received corrupt message of type InvalidContentType
#0 1.249 
#0 1.249   Stack backtrace:
#0 1.249      0: <unknown>
#0 1.249      1: <unknown>
#0 1.249      2: <unknown>
#0 1.249      3: <unknown>
#0 1.249      4: <unknown>
#0 1.249      5: <unknown>
#0 1.249      6: <unknown>
#0 1.249      7: <unknown>
#0 1.249      8: <unknown>
#0 1.249      9: <unknown>
#0 1.249     10: <unknown>
#0 1.249     11: <unknown>
#0 1.249     12: <unknown>
#0 1.249     13: <unknown>
#0 1.249     14: <unknown>
#0 1.249     15: <unknown>
#0 1.249     16: <unknown>
#0 1.249     17: <unknown>
#0 1.249     18: <unknown>
#0 1.249     19: <unknown>
#0 1.249     20: <unknown>
#0 1.249     21: __libc_start_main
#0 1.249     22: <unknown>
#0 1.249 
#0 1.249   Run with SCCACHE_LOG=debug SCCACHE_NO_DAEMON=1 to get more information

With error context url: https://localhost:9000/sccache/.sccache_check, looks like env SCCACHE_S3_USE_SSL=false not working

@sylvestre
Copy link
Collaborator

the error is:

#0 1.249 Source: error sending request for url (https://localhost:9000/sccache/.sccache_check): error trying to connect: received corrupt message of type InvalidContentType

@DCjanus
Copy link
Contributor Author

DCjanus commented Jun 11, 2023

I think I found it:

In this doc, we were informed that we can set SCCACHE_S3_USE_SSL to true or false to specify the behavior. However, in the actual code, only off is checked.

@wez
Copy link

wez commented Oct 1, 2023

Please update https://github.com/mozilla/sccache/blob/main/docs/S3.md to mention that off should be used with the currently released/available version

@wez
Copy link

wez commented Oct 1, 2023

Actually, I can't get that to work either, and it looks like the fix for this issue was reverted

@wez
Copy link

wez commented Oct 1, 2023

I also tried building from head and neither off nor false are respected; the endpoint is always constructed as https for me.

@Xuanwo
Copy link
Collaborator

Xuanwo commented Oct 1, 2023

I can't remember why we reverted this change. @sylvestre can you help remind this please? Thanks.

@Xuanwo Xuanwo reopened this Oct 1, 2023
@AJIOB
Copy link
Contributor

AJIOB commented Feb 27, 2024

@DCjanus , can you check for the latest stable, please? It looks like I've refix it in the similar way in #2103

@Xuanwo
Copy link
Collaborator

Xuanwo commented Feb 28, 2024

I believe this issue should be fixed.

@Xuanwo Xuanwo closed this as completed Feb 28, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants