question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

502 error on preview deployment.

See original GitHub issue

In my branch feature/event-input-form, deployment to hosting preview channel always failed with 502 error.

  /opt/hostedtoolcache/node/14.13.1/x64/bin/npx firebase-tools hosting:channel:deploy pr22-feature_event-input- --expires 10d --project ??? --json
  ***
    "status": "error",
    "error": "HTTP Error: 502, Unknown Error"
  ***
  ***
    "status": "error",
    "error": "HTTP Error: 502, Unknown Error"
  ***

But in another branch named feature/event-input, deployed successfully.

I think CHANNEL_ID ( pr22-feature_event-input- ) which end with - cause the error.

In this code, clipped branch name might have - at end of string.

https://github.com/FirebaseExtended/action-hosting-deploy/blob/79d1e17528573ce1a02632923c928f62009df3c3/src/getChannelId.ts#L25

Anyone know such rules about CHANNEL_ID?

ref: https://firebase.google.com/docs/hosting/manage-hosting-resources

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6

github_iconTop GitHub Comments

2reactions
WiNloStcommented, Oct 28, 2020

I use channelId as @mather commented. It worked really well.

Also, in case someone wants to still use a similar channel ID like this action produces. I set my action file like this.

      - id: set-firebase-hosting-channel-id
        name: set Firebase preview channel projectId
        run: echo "::set-output name=channel-id::$(echo pr${{ github.event.number }}-$(echo ${{ github.event.pull_request.head.ref }} | cut -c1-20) | sed -e 's/[-_]$//g' | sed -e 's/[^a-zA-Z0-9\.\-]/_/g')"

      # then you can use the channelId like so
      - uses: FirebaseExtended/action-hosting-deploy@v0
        with:
          channelId: ${{ steps.set-firebase-hosting-channel-id.outputs.channel-id }}

This removes the trailing _ or - that would cause the deployment to fail.

1reaction
mathercommented, Oct 27, 2020
Read more comments on GitHub >

github_iconTop Results From Across the Web

How To Fix a 502 Bad Gateway Error
The 502 Bad Gateway error specifically means that the server received an invalid response from an inbound server.
Read more >
How to Fix 502 Bad Gateway Error
502 bad gateway is one of the many HTTP status codes. Follow this tutorial and learn what this 502 error means and how...
Read more >
How to Fix Kubernetes '502 Bad Gateway' Error
A 502 Bad Gateway error is an 5xx server error that indicates a server received an invalid response from a proxy or gateway...
Read more >
What is a 502 Bad Gateway and how do you fix it? - IT PRO
An Error 502 Bad Gateway means there is a problem with the website's server, rather than your computer, router, or internet connection. It's...
Read more >
502 bad gateway: how to solve it (2022)
The 502 bad gateway error is a type of HTTP error that notifies the user that there is some kind of problem in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found