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?

161 Replies
ā
This post has been reserved for your question.
Hey @Itsurran! Please useTIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here./close
or theClose 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.
Are there any logs?
from Azure

ive been sitting on this for 4 days š
And is /health a custom endpoint? Because the actuator one is normally/actuator/health
is it this hard to deploy a backend š
yh /health is a custom endpoint i created
any logs after that?
also maybe fix the warning
all the same

How is the application deployed? Can you show your pom.xml?
my dependecies?
yes
<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>
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
If you remove the <version> from the Netty dependency, does your project still build?
i just added it to se if it helps with the warning in my logs

so you added the version?
the whole dependecy
it wasnt there
then i did nvm clean isntall and now pushing it to github actions
to redeploy
Can you remove netty temporarily and run
mvn dependency:tree
?
that should show you information on what uses netty/where it comes from
removed the whole netty and did the command
Is there anything above that?
especially something mentioning netty


yep thats it
anything else mentioning netty in that list?
nop thats all
but that wouldnt fix the issue though right
still get the warn

Can you switch to web server logs?
even my postman when i try to hit the endpint its just loading and giving 503

.

sec
it kinda looks like there should be more
im so confused
How are you deploying the app?
that one looks like there should be more mentioning netty
github actions
with .jar
Can you show it?

Can you run the application with java -jar locally?

ah wait
my appliaction was running


Are you following a tutorial?
atm no
i did in the beginning but now its been 4 days i cant get this done
š
Did you specify the port of your application in Azure?
no
Like how should Azure know which port to use?
true
So do i add it in azure env or in my applaiction.properties
Do you have an Azure publish profile?
yes
wait nnmv

Are there settings related to that?

mby here?
You have an azure dependency - can you update that?
what was the command to update all dependecies
again
in intellij
also thats storage anyways
mvn versions:use-latest-versions
that one?also you might want to use Azure Spring Apps? https://learn.microsoft.com/en-us/azure/spring-apps/basic-standard/how-to-github-actions?pivots=programming-language-java
Use Azure Spring Apps CI/CD with GitHub Actions
How to build up a CI/CD workflow for Azure Spring Apps with GitHub Actions
azure already provides that and created then
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...
What does the "diagnose and solve problems" thing show?


ok idk about that
The app service logs there also doesn't have anything useful?
literally nothing
useful
like wtf can it be
Is there a monitoring > metrics thing?

sec'

what metric should i show
cpu or memory
also other thing to check: Is there a configuration > general > always on setting?


yes

can you show it?
seems like the application is doing something
*

I don't see an always on setting there?
ah no alwqays on setting

you mean this?
ok
yes seems fine
haha bro im telling you
Can you go to the console?

uhh Windows
Can you run
netstat
to see open ports?
Is 8080 among them?
yes
...
Can you make an http request there? Is curl or Invoke-WebRequest available?
you might need to allow networking somewhere


Is that possible?
from the console
yes curl
Can you do
curl http://localhost:8080
in the server console?
so assuming it is running there, it isn't running on port 8080
yes
Are you using the azure aervice blob for anything?
yes
Did you update it before?
how do you mean
the dependency in the pom.xml
spring cloud azure starter storage blob
yes but i need to redeploy again
the latest is 5.22.0 or 6.0.0-beta3
ok
check whether the logs change when doing so
cant start my appliaction with 6.0.0-beta-4
crashing
should i try 5.22.0
yes
yes that worked, brb pushing it to github now
What version of Spring Boot are you using?
17
<java.version>17</java.version>
that's a Java version, not a Spring Boot version
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>
ok
good?
should i push to github?
yes, try it
What would you suspect the issue is
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

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?
Whag does "Service health" show on the left?
doesn't look useful

wait app.jar?

thats not my jar
Can you run
java -jar app.jar
just to see what happens?
maybe they just renamed it?na i remember i put that 4 days ago
manually
but i never used that

se
this is my jar rn

oh ok then it's probably not the real one
hmm fk i dont remeber how i put that in there
doesn't matter
maybe you can establish a direct remote connection to your app from your machine?
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 ...
dont get it

What should i do
:/
now i get this @dan1st | Daniel

oh, interesting
can you check the logs?
still same
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?
yep
with the exact same version numbers?

this
this does look ok
im trying something new
in my securityconfig i let only localhost5173 t allow orgins
mabe it can be that
idk
How did you increase the log level?

you could also try deploying without GitHub Actions if applicable
should i try with docker
change the level from error to info
or similar
and you can change the log level for Spring via environment variables
in my application.properties?
either there with e.g.
logging.level.ROOT=DEBUG
or with an environment variable like LOGGING_LEVEL_ROOT
set to DEBUG
now its back to

Did you change the logging level?
tbh you could try
if you did, check the logs again

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

so container worked
š¤
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.
What is that š©?
So does it work? What did you change exactly?
š¤
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.