Azure / static-web-apps

Azure Static Web Apps. For bugs and feature requests, please create an issue in this repo. For community discussions, latest updates, kindly refer to the Discussions Tab. To know what's new in Static Web Apps, visit https://aka.ms/swa/ThisMonth
https://aka.ms/swa
MIT License
326 stars 56 forks source link

deployment_token invalid when deploying from Gitlab #1306

Open shmnrr opened 11 months ago

shmnrr commented 11 months ago

Describe the bug

When deploying from Gitlab the following error shows up: deployment_token provided was invalid. An unknown exception has occurred

My app deploys just fine on Github, but company wants to move it to Gitlab. In order to achieve this I have followed the steps in: https://learn.microsoft.com/en-us/azure/static-web-apps/gitlab?tabs=vanilla-javascript Tried with the demo vanilla-javascript app, tried with my own github repo, tried manually executing entrypoint with hardcoded variables, even set up a new gitlab account and a new azure subscription, to no avail.

SZegota commented 11 months ago

I encounter the same bug while following the steps in the basic tutorial:

https://learn.microsoft.com/en-us/azure/static-web-apps/gitlab?tabs=vanilla-javascript

moises-mendes commented 11 months ago

Hello! Has anyone managed to resolve this problem? I have the same problem :

Executing "step_script" stage of the job script 00:26 Using docker image sha256:50ce98efe7fa10fb56a726a6101cbc55c606f0940175fabc8474e0420bab62d6 for registry.gitlab.com/static-web-apps/azure-static-web-apps-deploy with digest registry.gitlab.com/static-web-apps/azure-static-web-apps-deploy@sha256:0eaf1aadc1d2067801287ed82241f053991c634299c03c9a7c6242d2418f0a26 ... DeploymentId: f7d21ce6-de50-4b4c-9760-e21d827f9c98 Verbose logging enabled deployment_token provided was invalid. An unknown exception has occurred Failed to record upload telemtry. For further information, please visit the Azure Static Web Apps documentation at https://docs.microsoft.com/en-us/azure/static-web-apps/

ThomasVengels commented 11 months ago

Hello, I have the same problem:

Using docker image sha256:50ce98efe7fa10fb56a726a6101cbc55c606f0940175fabc8474e0420bab62d6 for registry.gitlab.com/static-web-apps/azure-static-web-apps-deploy with digest registry.gitlab.com/static-web-apps/azure-static-web-apps-deploy@sha256:0eaf1aadc1d2067801287ed82241f053991c634299c03c9a7c6242d2418f0a26 ... DeploymentId: c434777f-dff8-4c14-a4bd-be771dc1058c deployment_token provided was invalid. An unknown exception has occurred For further information, please visit the Azure Static Web Apps documentation at https://docs.microsoft.com/en-us/azure/static-web-apps/ If you believe this behavior is unexpected, please raise a GitHub issue at https://github.com/azure/static-web-apps/issues/ Exiting

njokdan commented 11 months ago

Hello all,

For all who need a workaround. The deployment via swa cli works. https://azure.github.io/static-web-apps-cli/docs/cli/swa-deploy

reference : https://github.com/Azure/static-web-apps/issues/1309

dansadler79 commented 11 months ago

Also having the exact same problem, having followed the walkthrough and double checked the deployment token several times.

moises-mendes commented 11 months ago

I successfully followed the workaround, in my case I need to build the app first, if not, you can go straight to " -swa deploy --verbose=silly -d $API_TOKEN --env production"

Example:

variables: API_TOKEN: "$DEPLOYMENT_TOKEN" APP_PATH: '$CI_PROJECT_DIR' OUTPUT_PATH: '$CI_PROJECT_DIR/dist'

deploy: stage: deploy

PavanGurram-DevOps commented 10 months ago

Hi there, any update please as facing same deployment token invalid issue. I have tried with swa cli but couldn't load the page on Azure web app with below Server error. I'm trying deploy nextjs application.

image

@moises-mendes Please can you share your sample repo so that I can go through it to identify my mistake? Thanks