Skip to content

Add error in agent init script if the binary wasn't actually downloaded #6711

Closed

Description

@bpmct

A user had Coder configured behind CloudFlare access. The init script downloaded an HTML page from Cloudflare access instead of the Coder binary. The error in the pod logs was

./coder: 2: Syntax error: newline unexpected

Could we add a check to the init script to see if the right file was actually downloaded? Perhaps with a sha256 checksum or some try/catch thingie?

Activity

  1. added
    s2Broken use cases or features (with a workaround). Only humans may set this.
    s3Bugs that confuse, annoy, or are purely cosmetic
    and removed
    s2Broken use cases or features (with a workaround). Only humans may set this.
    on Mar 21, 2023
  2. heywoodlh commented on Jun 14, 2023

    @heywoodlh

    I also run into this same issue whilst running Coder behind my self-hosted Pomerium instance

  3. jonpetersathan commented on Jun 18, 2023

    @jonpetersathan

    Having the same issue. I run coder behind an authentication proxy (oauth2-proxy) which makes the download of coder binary fail. Not sure what's a good fix here, but a note in the installation instruction would be nice :)

    + trap waitonexit EXIT
    + mktemp -d -t coder.XXXXXX
    + BINARY_DIR=/tmp/coder.n4IrxE
    + BINARY_NAME=coder
    + BINARY_URL=https://code.mydomain.com/bin/coder-linux-amd64
    + cd /tmp/coder.n4IrxE
    + :
    + status=
    + command -v curl
    + curl -fsSL --compressed https://code.mydomain.com/bin/coder-linux-amd64 -o coder
    + break
    + chmod +x coder
    + export CODER_AGENT_AUTH=token
    + export CODER_AGENT_URL=https://code.mydomain.com/
    + exec ./coder agent
    ./coder: 3: Syntax error: newline unexpected
    

    That's the line that silently fails

    + curl -fsSL --compressed https://code.mydomain.com/bin/coder-linux-amd64 -o coder
    

    I have now disabled authentication /bin path prefix in my proxy settings which seems to work for now.

    Edit: Oh, and on /api/v2 as well, in case anyone comes across this.

  4. bashirsouid commented on Jul 14, 2023

    @bashirsouid

    +1 this affected me as well for Cloudflared access.

    Edit: Not really hard blocked by this because of the work-arounds. But seems like something valuable to have "just work" out of the box since I think a lot of enterprises use cloudflared tunnels as part of their security model.

  5. Mistic92 commented on Sep 6, 2023

    @Mistic92

    Same issue when using Cloudflare

  6. chinmaya-n commented on Nov 12, 2023

    @chinmaya-n

    I can concur. I had to bypass auth for both /api/v2 and /bin/coder-linux-amd64 to get this working with Cloudflare tunnels.

  7. bpmct commented on Apr 26, 2024

    @bpmct
    MemberAuthor

    Added as a candidate for our next sprint

  8. added
    s2Broken use cases or features (with a workaround). Only humans may set this.
    and removed
    s3Bugs that confuse, annoy, or are purely cosmetic
    on May 2, 2024
  9. self-assigned this
    on May 13, 2024
  10. 11 remaining items

  11. added
    good first issueEasily solved issues suitable for starters and community contributors
    on Sep 26, 2025
  12. github-actions commented on Nov 3, 2025

    @github-actions
    Contributor
  13. removed their assignment
    on Jan 21, 2026
  14. changed the title [-]Add error in agent init script if the binary wasn't actually downloaded [/-] [+]Add error in agent init script if the binary wasn't actually downloaded[/+] on Feb 12, 2026
  15. removed
    s2Broken use cases or features (with a workaround). Only humans may set this.
    good first issueEasily solved issues suitable for starters and community contributors
    on Feb 13, 2026
  16. added
    onboarding-improvementOnboarding and first-time installation experience.
    and removed on Feb 16, 2026
  17. bpmct commented on Oct 6, 2026

    @bpmct
    MemberAuthor

    Going to close this one as #13280 gets us a significant way there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    onboarding-improvementOnboarding and first-time installation experience.

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions