CLI returns "unexpected non-JSON response ""

Hi there, I have a github/gitea action file, which creates and deletes sample templates on a test system. Since some time, I get this error:
Encountered an error running "coder templates push", see "coder templates push --help" for more information
error: Trace=[get organizations: ]
unexpected non-JSON response ""
Gateway Timeout
❌ Failure - Main Push template
exitcode '1': failure
Encountered an error running "coder templates push", see "coder templates push --help" for more information
error: Trace=[get organizations: ]
unexpected non-JSON response ""
Gateway Timeout
❌ Failure - Main Push template
exitcode '1': failure
These are the relevant parts of the action:
steps:
- name: Checkout the codebase
uses: actions/checkout@v5
- name: Set outputs
id: vars
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- name: "Get latest Coder binary"
run: |
curl -L https://coder.com/install.sh | sh -s -- --version $CODER_VERSION
env:
CODER_VERSION: 2.28.3
- name: "Push template"
run: |
coder templates push $TEMPLATE_NAME --directory $CODER_TEMPLATE_DIR --yes --name="$TEMPLATE_VERSION" --message="$UPDATE_MESSAGE"
coder templates archive $TEMPLATE_NAME --all -y
env:
CODER_URL: https://coder-test.domain.com
CODER_SESSION_TOKEN: ${{ secrets.CODER_TEST_TOKEN }}
CODER_TEMPLATE_DIR: ${{ matrix.template-path }}
TEMPLATE_NAME: '${{ matrix.template-name }}-PR${{ gitea.event.number }}'
TEMPLATE_VERSION: ${{ steps.vars.outputs.sha_short }}
UPDATE_MESSAGE: ${{ gitea.event.head_commit.message }}
- uses: mshick/add-pr-comment@v2
if: matrix.template-name == 'base'
with:
message: |
Test server: <a href="${{ env.CODER_URL }}/templates/${{ env.TEMPLATE_NAME }}/workspace?mode=auto" target="_blank">${{ env.TEMPLATE_NAME }}</a>
env:
CODER_URL: https://coder-test.domain.com
TEMPLATE_NAME: '${{ matrix.template-name }}-PR${{ gitea.event.number }}'
GITHUB_TOKEN: ${{ secrets.CI_TOKEN }}
steps:
- name: Checkout the codebase
uses: actions/checkout@v5
- name: Set outputs
id: vars
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- name: "Get latest Coder binary"
run: |
curl -L https://coder.com/install.sh | sh -s -- --version $CODER_VERSION
env:
CODER_VERSION: 2.28.3
- name: "Push template"
run: |
coder templates push $TEMPLATE_NAME --directory $CODER_TEMPLATE_DIR --yes --name="$TEMPLATE_VERSION" --message="$UPDATE_MESSAGE"
coder templates archive $TEMPLATE_NAME --all -y
env:
CODER_URL: https://coder-test.domain.com
CODER_SESSION_TOKEN: ${{ secrets.CODER_TEST_TOKEN }}
CODER_TEMPLATE_DIR: ${{ matrix.template-path }}
TEMPLATE_NAME: '${{ matrix.template-name }}-PR${{ gitea.event.number }}'
TEMPLATE_VERSION: ${{ steps.vars.outputs.sha_short }}
UPDATE_MESSAGE: ${{ gitea.event.head_commit.message }}
- uses: mshick/add-pr-comment@v2
if: matrix.template-name == 'base'
with:
message: |
Test server: <a href="${{ env.CODER_URL }}/templates/${{ env.TEMPLATE_NAME }}/workspace?mode=auto" target="_blank">${{ env.TEMPLATE_NAME }}</a>
env:
CODER_URL: https://coder-test.domain.com
TEMPLATE_NAME: '${{ matrix.template-name }}-PR${{ gitea.event.number }}'
GITHUB_TOKEN: ${{ secrets.CI_TOKEN }}
Did the cli command change or something? Thanks!
5 Replies
Codercord
Codercord2w ago
Codercord
Codercord2w ago
<#1440279000823107736>
Category
Help needed
Product
Coder (v2)
Platform
Linux
Logs
Please post any relevant logs/error messages.
Ethan
Ethan2w ago
Do you have Coder behind a proxy? It looks like the non-JSON response is a gateway timeout
ztlod ツ
ztlod ツ2w ago
Had this problem with traefik for a while, i think upgrading version ended up patching it, nowdays i’d deploy from CLI all the time But you can start by debugging the CLI locally before running the workflow
Zoker
ZokerOP2w ago
Yes coder is running behind a traefik proxy. But I'm using the latest version 3.6.1 Good idea, I will test it locally first Ok turns out the test server was not reachable from the outside. Thanks for the help!

Did you find this page helpful?