https://linen.dev logo
Axum endpoint not working in deployment
# help
o
I run an Axum API with a
GET
endpoint on
/
that just responds with some text. When running locally I get the response as expected, but after deploying and making a request to the URI shown by
cargo shuttle status
I get no response.

https://cdn.discordapp.com/attachments/1096306015554773062/1096306015819005992/screenshot.png

I'm getting a code 500 response, but it's not from my API, because nothing shows up in my logs
(and it works locally)
Copy code
TwitchBot.git/master ❯ curl -v 'https://schnose-twitch-bot.shuttleapp.rs'                                     master 07:44:38
*   Trying 18.132.234.15:443...
* Connected to schnose-twitch-bot.shuttleapp.rs (18.132.234.15) port 443 (#0)
* ALPN: offers h2,http/1.1
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
*  CAfile: /etc/ssl/certs/ca-certificates.crt
*  CApath: none
* TLSv1.3 (IN), TLS handshake, Server hello (2):
* TLSv1.3 (IN), TLS handshake, Encrypted Extensions (8):
* TLSv1.3 (IN), TLS handshake, Certificate (11):
* TLSv1.3 (IN), TLS handshake, CERT verify (15):
* TLSv1.3 (IN), TLS handshake, Finished (20):
* TLSv1.3 (OUT), TLS change cipher, Change cipher spec (1):
* TLSv1.3 (OUT), TLS handshake, Finished (20):
* SSL connection using TLSv1.3 / TLS_AES_256_GCM_SHA384
* ALPN: server accepted http/1.1
* Server certificate:
*  subject: CN=*.shuttleapp.rs
*  start date: Feb 20 12:24:36 2023 GMT
*  expire date: May 21 12:24:35 2023 GMT
*  subjectAltName: host "schnose-twitch-bot.shuttleapp.rs" matched cert's "*.shuttleapp.rs"
*  issuer: C=US; O=Let's Encrypt; CN=R3
*  SSL certificate verify ok.
* using HTTP/1.1
> GET / HTTP/1.1
> Host: schnose-twitch-bot.shuttleapp.rs
> User-Agent: curl/8.0.1
> Accept: */*
>
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
< HTTP/1.1 500 Internal Server Error
< date: Fri, 14 Apr 2023 05:44:38 GMT
< content-length: 0
<
* Connection #0 to host schnose-twitch-bot.shuttleapp.rs left intact
k
Hey 👋 Do you have the code for this in a public repo, by any chance?
o
Yes, here:
All the axum code is in
src/axum.rs
and I launch it in
src/shuttle_integration.rs
I tried redeploying it earlier and that didn't fix it, but I just found a bug in my code that needed to be fixed and redeployed again, and this time it fixed it
My project is mainly a twitch bot, and that worked when I made the original post, just not the axum part, but both work now
really weird
k
I like it 😂

https://cdn.discordapp.com/attachments/1096306015554773062/1096378226307235840/image.png

Looks like a cool project! Also, why didn't you use shuttle to provision a DB (just wondering if you have a requirements we don't meet)?
o
I already had a database
k
Ah, I see 🙂
o
it's also postgres and also limited to 500mb, so it's effectively the same