question

MatheusSouzaSilva-4638 avatar image
0 Votes"
MatheusSouzaSilva-4638 asked MatheusSouzaSilva-4638 edited

My Web Application is down

Hello everyone, I'm having a problem with the Azure Web Application. The problem is this ... After creating a Web Service that uses a Linux service plan to upload my front-end app that was developed in React.js, the following error started to appear after a day of testing ... when i click on my website link it loads for about 5 minutes (this time can vary up to 15 minutes), and an error appears - :( Application Error , together with a link for Azure Diagnostics. This link takes me to a screen where it shows me some errors and a table with errors 503 and 502.3, I'll put the image here in the post, I just don't know what to do, I started using azure a short time ago and this is my first contact with this type of error.

72139-image.png





azure-webapps
image.png (80.1 KiB)
· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Did you go to More Info for any of those? Especially the one saying Application Errors. Did you also look at the application logs?

1 Vote 1 ·

In addition to @SimpleSamples comment @MatheusSouzaSilva-4638, make sure you enable logging for your Linux hosted app. If you're getting 50x errors, reviewing the logging will help determine why your app is failing to start. If you need help, feel free to post a snippet of the error logs down below. https://docs.microsoft.com/en-us/azure/app-service/troubleshoot-http-502-http-503 may also provide insight to identify the issue.

Regards,
Ryan


1 Vote 1 ·

Thanks for your answers. I looked on the application logs and I found what I believe to be the error:

export NODE_OPTIONS='--require /usr/local/lib/node_modules/applicationinsights/out/Bootstrap/Oryx.js ' $NODE_OPTIONS
2021-02-26T13:26:45.739945173Z yarn run start
2021-02-26T13:26:47.613414648Z yarn run v1.17.3
2021-02-26T13:26:47.808832362Z $ react-scripts start
2021-02-26T13:26:47.878836198Z /bin/sh: 1: react-scripts: not found
2021-02-26T13:26:47.917474862Z error Command failed with exit code 127.

The error happens when it tries to install the react packages a think, but I don't know what I can do to fix it.

And this error only happens in a Linux Web Services, when I deployed my application on a Windows Web Service it runs normally.

I'm using Node version 14.15.1 and Yarn version 1.22.5.

I'll also attach the log as a .txt file if someone wants to take a more in-depth look.

72533-logs.txt


0 Votes 0 ·
logs.txt (35.0 KiB)
MatheusSouzaSilva-4638 avatar image
0 Votes"
MatheusSouzaSilva-4638 answered MatheusSouzaSilva-4638 edited

Hi, sorry for not responding here anymore.

A few days ago I resolved the problem, the issue was that I needed to do a simple configuration on Azure Portal, for those who are interested, here is the thread with more details on the resolution.

Thanks everybody for your answers!


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

ryanchill avatar image
0 Votes"
ryanchill answered ryanchill edited

Hi @MatheusSouzaSilva-4638,

In reviewing your logs attachment, you did several different deployment types (ScmType: GitHub / zip deploy). App Service deployments will run npm install --production, see https://docs.microsoft.com/en-us/azure/app-service/configure-language-nodejs?pivots=platform-linux. So seeing 2021-02-26T13:26:47.878836198Z /bin/sh: 1: react-scripts: not found is an indicator that this did not occur. Check your deployment logs by visiting https://{your-app}.azurewebsites.net/api/deployments to see if your artifacts

If you are deploying from GitHub (Actions), the yml should be configured to install the dependencies which should include react-scripts in your deployment artifacts folder.

 - name: npm install, build, and test
   run: |
     npm install
     npm run build --if-present
     npm run test --if-present
   working-directory: my-app-folder # set to the folder with your app if it is not the root directory

Verify that my-app-folder contains your node modules and package.json.

Regards,
Ryan



5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.