azure backend deployment HTTP Error 503. The service is unavailable.

Hello, ive deployed me backend and database in azure and the backend is sucessfully deployed but when i try to hit an endpoint such as /health or anyother endpoint i get this. Anyone know why?
No description
161 Replies
JavaBot
JavaBot•2w ago
āŒ› This post has been reserved for your question.
Hey @Itsurran! Please use /close or the Close Post button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically marked as dormant after 300 minutes of inactivity.
TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.
dan1st
dan1st•2w ago
Are there any logs? from Azure
Itsurran
ItsurranOP•2w ago
No description
Itsurran
ItsurranOP•2w ago
ive been sitting on this for 4 days šŸ˜‚
dan1st
dan1st•2w ago
And is /health a custom endpoint? Because the actuator one is normally/actuator/health
Itsurran
ItsurranOP•2w ago
is it this hard to deploy a backend šŸ˜‚ yh /health is a custom endpoint i created
dan1st
dan1st•2w ago
any logs after that? also maybe fix the warning
Itsurran
ItsurranOP•2w ago
all the same
No description
dan1st
dan1st•2w ago
How is the application deployed? Can you show your pom.xml?
Itsurran
ItsurranOP•2w ago
my dependecies?
dan1st
dan1st•2w ago
yes
Itsurran
ItsurranOP•2w ago
<dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-jpa</artifactId> </dependency> <dependency> <groupId>io.netty</groupId> <artifactId>netty-all</artifactId> <version>4.1.101.Final</version> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-security</artifactId> </dependency> <dependency> <groupId>com.azure.spring</groupId> <artifactId>spring-cloud-azure-starter-storage-blob</artifactId> <version>5.19.0</version> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-websocket</artifactId> </dependency> <dependency> <groupId>org.springframework.session</groupId> <artifactId>spring-session-core</artifactId> </dependency> <dependency> <groupId>org.postgresql</groupId> <artifactId>postgresql</artifactId> <version>42.7.2</version> </dependency> <dependency> <groupId>jakarta.validation</groupId> <artifactId>jakarta.validation-api</artifactId> <version>3.0.2</version> </dependency> <dependency> <groupId>org.projectlombok</groupId> <artifactId>lombok</artifactId> <optional>true</optional> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-mail</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>org.springframework.security</groupId> <artifactId>spring-security-messaging</artifactId> </dependency> <dependency> <groupId>org.springframework.security</groupId> <artifactId>spring-security-test</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>org.flywaydb</groupId> <artifactId>flyway-core</artifactId> <version>9.16.1</version> </dependency> </dependencies>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-all</artifactId>
<version>4.1.101.Final</version>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
<dependency>
<groupId>com.azure.spring</groupId>
<artifactId>spring-cloud-azure-starter-storage-blob</artifactId>
<version>5.19.0</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-websocket</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.session</groupId>
<artifactId>spring-session-core</artifactId>
</dependency>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>42.7.2</version>
</dependency>
<dependency>
<groupId>jakarta.validation</groupId>
<artifactId>jakarta.validation-api</artifactId>
<version>3.0.2</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-mail</artifactId>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-messaging</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-core</artifactId>
<version>9.16.1</version>
</dependency>

</dependencies>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-all</artifactId>
<version>4.1.101.Final</version>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
<dependency>
<groupId>com.azure.spring</groupId>
<artifactId>spring-cloud-azure-starter-storage-blob</artifactId>
<version>5.19.0</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-websocket</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.session</groupId>
<artifactId>spring-session-core</artifactId>
</dependency>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>42.7.2</version>
</dependency>
<dependency>
<groupId>jakarta.validation</groupId>
<artifactId>jakarta.validation-api</artifactId>
<version>3.0.2</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-mail</artifactId>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-messaging</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-core</artifactId>
<version>9.16.1</version>
</dependency>

</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<annotationProcessorPaths>
<path>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</path>
</annotationProcessorPaths>
</configuration>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<excludes>
<exclude>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
</build>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<annotationProcessorPaths>
<path>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</path>
</annotationProcessorPaths>
</configuration>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<excludes>
<exclude>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
</build>
so 503 is basiaclly my backend is deployed buy my requests are dead ive been tryna fix this shit for 4 days 😭 ive deleted me db and created new one 50 times and connected them new app service 50 times
dan1st
dan1st•2w ago
If you remove the <version> from the Netty dependency, does your project still build?
Itsurran
ItsurranOP•2w ago
i just added it to se if it helps with the warning in my logs
No description
dan1st
dan1st•2w ago
so you added the version?
Itsurran
ItsurranOP•2w ago
the whole dependecy it wasnt there then i did nvm clean isntall and now pushing it to github actions to redeploy
dan1st
dan1st•2w ago
Can you remove netty temporarily and run mvn dependency:tree? that should show you information on what uses netty/where it comes from
Itsurran
ItsurranOP•2w ago
No description
Itsurran
ItsurranOP•2w ago
removed the whole netty and did the command
dan1st
dan1st•2w ago
Is there anything above that? especially something mentioning netty
Itsurran
ItsurranOP•2w ago
No description
Itsurran
ItsurranOP•2w ago
No description
Itsurran
ItsurranOP•2w ago
yep thats it
dan1st
dan1st•2w ago
anything else mentioning netty in that list?
Itsurran
ItsurranOP•2w ago
nop thats all but that wouldnt fix the issue though right
Itsurran
ItsurranOP•2w ago
still get the warn
No description
dan1st
dan1st•2w ago
Can you switch to web server logs?
Itsurran
ItsurranOP•2w ago
even my postman when i try to hit the endpint its just loading and giving 503
Itsurran
ItsurranOP•2w ago
No description
dan1st
dan1st•2w ago
.
Itsurran
ItsurranOP•2w ago
No description
Itsurran
ItsurranOP•2w ago
sec
dan1st
dan1st•2w ago
it kinda looks like there should be more
Itsurran
ItsurranOP•2w ago
im so confused
dan1st
dan1st•2w ago
How are you deploying the app? that one looks like there should be more mentioning netty
Itsurran
ItsurranOP•2w ago
github actions with .jar
dan1st
dan1st•2w ago
Can you show it?
Itsurran
ItsurranOP•2w ago
name: Build and deploy JAR app to Azure Web App - nem-backend

on:
push:
branches:
- main
workflow_dispatch:

jobs:
build:
runs-on: windows-latest
permissions:
contents: read #This is required for actions/checkout

steps:
- uses: actions/checkout@v4

- name: Set up Java version
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'microsoft'

- name: Build with Maven
run: mvn clean install

- name: Upload artifact for deployment job
uses: actions/upload-artifact@v4
with:
name: java-app
path: '${{ github.workspace }}/target/*.jar'

deploy:
runs-on: windows-latest
needs: build
environment:
name: 'Production'
url: ${{ steps.deploy-to-webapp.outputs.webapp-url }}
permissions:
id-token: write #This is required for requesting the JWT
contents: read #This is required for actions/checkout

steps:
- name: Download artifact from build job
uses: actions/download-artifact@v4
with:
name: java-app

- name: Login to Azure
uses: azure/login@v2
with:
client-id: ${{ secrets.AZUREAPPSERVICE_CLIENTID_A9F96E87DB4E471C8E258E5B2C92A487 }}
tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_6A98C96A14D64817B25A86A30B7A6C20 }}
subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_6293108533E947C5A6255BBB6B41E5F5 }}

- name: Deploy to Azure Web App
id: deploy-to-webapp
uses: azure/webapps-deploy@v3
with:
app-name: 'nem-backend'
slot-name: 'Production'
package: '*.jar'
name: Build and deploy JAR app to Azure Web App - nem-backend

on:
push:
branches:
- main
workflow_dispatch:

jobs:
build:
runs-on: windows-latest
permissions:
contents: read #This is required for actions/checkout

steps:
- uses: actions/checkout@v4

- name: Set up Java version
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'microsoft'

- name: Build with Maven
run: mvn clean install

- name: Upload artifact for deployment job
uses: actions/upload-artifact@v4
with:
name: java-app
path: '${{ github.workspace }}/target/*.jar'

deploy:
runs-on: windows-latest
needs: build
environment:
name: 'Production'
url: ${{ steps.deploy-to-webapp.outputs.webapp-url }}
permissions:
id-token: write #This is required for requesting the JWT
contents: read #This is required for actions/checkout

steps:
- name: Download artifact from build job
uses: actions/download-artifact@v4
with:
name: java-app

- name: Login to Azure
uses: azure/login@v2
with:
client-id: ${{ secrets.AZUREAPPSERVICE_CLIENTID_A9F96E87DB4E471C8E258E5B2C92A487 }}
tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_6A98C96A14D64817B25A86A30B7A6C20 }}
subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_6293108533E947C5A6255BBB6B41E5F5 }}

- name: Deploy to Azure Web App
id: deploy-to-webapp
uses: azure/webapps-deploy@v3
with:
app-name: 'nem-backend'
slot-name: 'Production'
package: '*.jar'
Itsurran
ItsurranOP•2w ago
No description
dan1st
dan1st•2w ago
Can you run the application with java -jar locally?
Itsurran
ItsurranOP•2w ago
No description
Itsurran
ItsurranOP•2w ago
ah wait my appliaction was running
Itsurran
ItsurranOP•2w ago
No description
No description
dan1st
dan1st•2w ago
Are you following a tutorial?
Itsurran
ItsurranOP•2w ago
atm no i did in the beginning but now its been 4 days i cant get this done 😭
dan1st
dan1st•2w ago
Did you specify the port of your application in Azure?
Itsurran
ItsurranOP•2w ago
no
dan1st
dan1st•2w ago
Like how should Azure know which port to use?
Itsurran
ItsurranOP•2w ago
true So do i add it in azure env or in my applaiction.properties
dan1st
dan1st•2w ago
Do you have an Azure publish profile?
Itsurran
ItsurranOP•2w ago
yes wait nnmv
Itsurran
ItsurranOP•2w ago
No description
dan1st
dan1st•2w ago
Are there settings related to that?
Itsurran
ItsurranOP•2w ago
No description
Itsurran
ItsurranOP•2w ago
mby here?
dan1st
dan1st•2w ago
You have an azure dependency - can you update that?
Itsurran
ItsurranOP•2w ago
what was the command to update all dependecies again in intellij also thats storage anyways
dan1st
dan1st•2w ago
mvn versions:use-latest-versions that one?
dan1st
dan1st•2w ago
Use Azure Spring Apps CI/CD with GitHub Actions
How to build up a CI/CD workflow for Azure Spring Apps with GitHub Actions
Itsurran
ItsurranOP•2w ago
azure already provides that and created then
dan1st
dan1st•2w ago
maybe you want to check the answers to https://stackoverflow.com/q/55354045/10871900, especially the one about networking
Stack Overflow
Azure web app is 503 Service Unavailable. How do I get it back runn...
Our website has been hosted on Azure for a few years. Tonight it is throwing 503 Service unavailable errors. I cannot even load a url to a .jpg file. I have restarted the app and still nothing load...
dan1st
dan1st•2w ago
What does the "diagnose and solve problems" thing show?
Itsurran
ItsurranOP•2w ago
No description
Itsurran
ItsurranOP•2w ago
No description
dan1st
dan1st•2w ago
ok idk about that The app service logs there also doesn't have anything useful?
Itsurran
ItsurranOP•2w ago
literally nothing useful like wtf can it be
dan1st
dan1st•2w ago
Is there a monitoring > metrics thing?
Itsurran
ItsurranOP•2w ago
No description
Itsurran
ItsurranOP•2w ago
sec'
No description
Itsurran
ItsurranOP•2w ago
what metric should i show
dan1st
dan1st•2w ago
cpu or memory also other thing to check: Is there a configuration > general > always on setting?
Itsurran
ItsurranOP•2w ago
No description
No description
Itsurran
ItsurranOP•2w ago
yes
Itsurran
ItsurranOP•2w ago
No description
dan1st
dan1st•2w ago
can you show it? seems like the application is doing something
Itsurran
ItsurranOP•2w ago
*
Itsurran
ItsurranOP•2w ago
No description
dan1st
dan1st•2w ago
I don't see an always on setting there?
Itsurran
ItsurranOP•2w ago
ah no alwqays on setting
Itsurran
ItsurranOP•2w ago
No description
Itsurran
ItsurranOP•2w ago
you mean this?
dan1st
dan1st•2w ago
ok yes seems fine
Itsurran
ItsurranOP•2w ago
haha bro im telling you
dan1st
dan1st•2w ago
Can you go to the console?
Itsurran
ItsurranOP•2w ago
No description
dan1st
dan1st•2w ago
uhh Windows Can you run netstat to see open ports? Is 8080 among them?
Itsurran
ItsurranOP•2w ago
No description
Itsurran
ItsurranOP•2w ago
yes
dan1st
dan1st•2w ago
... Can you make an http request there? Is curl or Invoke-WebRequest available? you might need to allow networking somewhere
Itsurran
ItsurranOP•2w ago
No description
Itsurran
ItsurranOP•2w ago
No description
dan1st
dan1st•2w ago
Is that possible? from the console
Itsurran
ItsurranOP•2w ago
yes curl
dan1st
dan1st•2w ago
Can you do curl http://localhost:8080 in the server console?
Itsurran
ItsurranOP•2w ago
No description
dan1st
dan1st•2w ago
so assuming it is running there, it isn't running on port 8080
Itsurran
ItsurranOP•2w ago
yes
dan1st
dan1st•2w ago
Are you using the azure aervice blob for anything?
Itsurran
ItsurranOP•2w ago
yes
dan1st
dan1st•2w ago
Did you update it before?
Itsurran
ItsurranOP•2w ago
how do you mean
dan1st
dan1st•2w ago
the dependency in the pom.xml spring cloud azure starter storage blob
Itsurran
ItsurranOP•2w ago
yes but i need to redeploy again
dan1st
dan1st•2w ago
the latest is 5.22.0 or 6.0.0-beta3 ok check whether the logs change when doing so
Itsurran
ItsurranOP•2w ago
cant start my appliaction with 6.0.0-beta-4 crashing should i try 5.22.0
dan1st
dan1st•2w ago
yes
Itsurran
ItsurranOP•2w ago
yes that worked, brb pushing it to github now
dan1st
dan1st•2w ago
What version of Spring Boot are you using?
Itsurran
ItsurranOP•2w ago
17 <java.version>17</java.version>
dan1st
dan1st•2w ago
that's a Java version, not a Spring Boot version
Itsurran
ItsurranOP•2w ago
where do i check the spring boot version <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>3.4.0</version> <relativePath/> <!-- lookup parent from repository --> </parent>
dan1st
dan1st•2w ago
ok
Itsurran
ItsurranOP•2w ago
good? should i push to github?
dan1st
dan1st•2w ago
yes, try it
Itsurran
ItsurranOP•2w ago
What would you suspect the issue is
dan1st
dan1st•2w ago
and in the thing where you got cpu and memory metrics, maybe there's also a requests metric azure gettkng the request but it not getting passed to the application in some way
Itsurran
ItsurranOP•2w ago
No description
dan1st
dan1st•2w ago
you could also try going to the console and typing ls to see what's in that directory Is there more information on these things? Like failing requests?
Itsurran
ItsurranOP•2w ago
No description
dan1st
dan1st•2w ago
Whag does "Service health" show on the left? doesn't look useful
Itsurran
ItsurranOP•2w ago
No description
Itsurran
ItsurranOP•2w ago
wait app.jar?
No description
Itsurran
ItsurranOP•2w ago
thats not my jar
dan1st
dan1st•2w ago
Can you run java -jar app.jar just to see what happens? maybe they just renamed it?
Itsurran
ItsurranOP•2w ago
na i remember i put that 4 days ago manually but i never used that
Itsurran
ItsurranOP•2w ago
No description
Itsurran
ItsurranOP•2w ago
se
Itsurran
ItsurranOP•2w ago
this is my jar rn
No description
dan1st
dan1st•2w ago
oh ok then it's probably not the real one
Itsurran
ItsurranOP•2w ago
hmm fk i dont remeber how i put that in there
dan1st
dan1st•2w ago
doesn't matter maybe you can establish a direct remote connection to your app from your machine?
dan1st
dan1st•2w ago
for example like steps 2 and 3 in https://stackoverflow.com/a/71093211/10871900 but fir port 8080
Stack Overflow
How to remote debug a java application running on Azure App Service
When browsing to Settings > Configuration > General Settings Microsoft is pretty clear in that it currently doesn't support remote debugging (Linux App Service Plan, Java 11 SE). However, I ...
Itsurran
ItsurranOP•2w ago
dont get it
Itsurran
ItsurranOP•2w ago
No description
Itsurran
ItsurranOP•2w ago
What should i do :/
Itsurran
ItsurranOP•2w ago
now i get this @dan1st | Daniel
No description
dan1st
dan1st•2w ago
oh, interesting can you check the logs?
Itsurran
ItsurranOP•2w ago
still same
dan1st
dan1st•2w ago
that looks like it at least received some response now Can you maybe increase the logging level and restart the application? Are you getting the exact same error about netty you got before?
Itsurran
ItsurranOP•2w ago
yep
dan1st
dan1st•2w ago
with the exact same version numbers?
Itsurran
ItsurranOP•2w ago
No description
Itsurran
ItsurranOP•2w ago
this
dan1st
dan1st•2w ago
this does look ok
Itsurran
ItsurranOP•2w ago
im trying something new in my securityconfig i let only localhost5173 t allow orgins mabe it can be that idk
dan1st
dan1st•2w ago
How did you increase the log level?
Itsurran
ItsurranOP•2w ago
No description
dan1st
dan1st•2w ago
you could also try deploying without GitHub Actions if applicable
Itsurran
ItsurranOP•2w ago
should i try with docker
dan1st
dan1st•2w ago
change the level from error to info or similar and you can change the log level for Spring via environment variables
Itsurran
ItsurranOP•2w ago
in my application.properties?
dan1st
dan1st•2w ago
either there with e.g. logging.level.ROOT=DEBUG or with an environment variable like LOGGING_LEVEL_ROOT set to DEBUG
Itsurran
ItsurranOP•2w ago
now its back to
No description
dan1st
dan1st•2w ago
Did you change the logging level? tbh you could try if you did, check the logs again
Itsurran
ItsurranOP•2w ago
No description
Itsurran
ItsurranOP•2w ago
sry had to take a break this shit is giving me im gonna try with docker when i try with container it costs like 300$/m wtf @dan1st | Daniel
Itsurran
ItsurranOP•2w ago
No description
Itsurran
ItsurranOP•2w ago
so container worked
JavaBot
JavaBot•2w ago
šŸ’¤ Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived. If your question was not answered yet, feel free to re-open this post or create a new one. In case your post is not getting any attention, you can try to use /help ping. Warning: abusing this will result in moderative actions taken against you.
dan1st
dan1st•2w ago
What is that šŸ’©? So does it work? What did you change exactly?
JavaBot
JavaBot•2w ago
šŸ’¤ Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived. If your question was not answered yet, feel free to re-open this post or create a new one. In case your post is not getting any attention, you can try to use /help ping. Warning: abusing this will result in moderative actions taken against you.

Did you find this page helpful?