FirebaseExtended / action-hosting-deploy

Automatically deploy shareable previews for your Firebase Hosting sites
https://firebase.google.com/docs/hosting/github-integration
Apache License 2.0
695 stars 202 forks source link

[BUG] Failing to deploy on preview due to extra dash in target `channelId` #159

Closed jaygcoder2020 closed 3 years ago

jaygcoder2020 commented 3 years ago

Action config

- uses: FirebaseExtended/action-hosting-deploy@v0
   with:
     repoToken: '${{ secrets.GITHUB_TOKEN }}'
     firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_PRJCT_ME }}'
     projectId: prjct-me

Error message

/opt/hostedtoolcache/node/12.22.6/x64/bin/npx firebase-tools hosting:channel:deploy pr7-feature_react-route- --expires 7d --project prjct-me --json
  ***
    "status": "error",
    "error": "HTTP Error: 400, Request contains an invalid argument."
  ***
  ***
    "status": "error",
    "error": "HTTP Error: 400, Request contains an invalid argument."
  ***

Expected behavior

Action continues to deploy the hosting app on preview

Actual behavior

Action failed to run due to an invalid argument. It seems that the error is on the parameter after deploy (i.e., pr7-feature_react-route-. For reference, the PR branch I'm working on is feature/react-route-pages, so it left out the pages bit. I'm fine with any name, but some truncation might be needed to remove extra dashes.

EDIT: Just saw that there's a channelId field but I think this is still worth checking for autogenerated IDs.

drummerjolev commented 3 years ago

Same here, first time I ever bump into this error:

Run FirebaseExtended/action-hosting-deploy@v0
Verifying firebase.json exists
Setting up CLI credentials
ChannelId "pr76-jonathan/feature/cha" contains unsupported characters. Using "pr76-jonathan_feature_cha" instead.
Deploying to Firebase preview channel pr76-jonathan_feature_cha
  /usr/local/bin/npx firebase-tools hosting:channel:deploy pr76-jonathan_feature_cha --expires 7d --project *** --json
  ***
    "status": "error",
    "error": "HTTP Error: 400, Request contains an invalid argument."
  ***
  ***
    "status": "error",
    "error": "HTTP Error: 400, Request contains an invalid argument."
  ***

  The process '/usr/local/bin/npx' failed with exit code 1
  Retrying deploy with the --debug flag for better error output
  /usr/local/bin/npx firebase-tools hosting:channel:deploy pr76-jonathan_feature_cha --expires 7d --project *** --debug
artanisdesign commented 3 years ago

getting the same error, also even had complaints about firebase.json, but after i removed rulesFile prop, at least that one disappeared. [2021-09-21T08:30:29.502Z] Object "" in "firebase.json" has unknown property: ***"additionalProperty":"rulesFile"***

stevecode21 commented 3 years ago

Same error here, I'm getting this error:

 Error: HTTP Error: 400, Request contains an invalid argument.
  [2021-09-21T11:31:24.521Z] Error Context: ***
    "body": ***
      "error": ***
        "code": 400,
        "message": "Request contains an invalid argument.",
        "status": "INVALID_ARGUMENT"
      ***
    ***,
    "response": ***
      "statusCode": 400
    ***
  ***

When it's trying to send a POST request to https://firebasehosting.googleapis.com/v1beta1/projects/{{ PROJECT }}/sites/{{ hostingName }}/channels?channelId={{ channelId }}

vleushin commented 3 years ago

Same error. Why it started to happen and what are the options for now?

stevecode21 commented 3 years ago

I've tested again, and now it's working, maybe the error came from firebase directly, can you test it again guys?

danieljimeneznz commented 3 years ago

From this issue in firebase-tools repo, it appears to be a backend Firebase server issue, might be worth subscribing to that issue instead for progress as I don't think this is related to the github action.

jaygcoder2020 commented 3 years ago

Thanks @danieljimeneznz, in which case I'll close this one and refer to #3768. Cheers mate. 🥂

shuji-koike commented 2 years ago

Thanks for the fix!!!

BTW our test env's Email/Password sign-in method was changed to disabled and template had reset (maybe in last a few days), but we have no clue who/what changed the config. I there a chance this issue is related?

stevecode21 commented 2 years ago

Thanks for the fix!!!

BTW our test env's Email/Password sign-in method was changed to disabled and template had reset (maybe in last a few days), but we have no clue who/what changed the config. I there a chance this issue is related?

Same issue, Email/Password sign-in method was changed to disabled suddenly.