R
Railway•15mo ago
prince2k3

Experiencing crash with no output for the reason of the crash.

Hello, I'm having issues with my project that I'm working on. I'm trying to test uploading some data with images along side it. I have created a batch operation in the app to help upload starting data. But when I try to do the operation it would stop after some time during it and silently redeploy. I think it is crashing. I can't really tell. The logs doesn't show any crash like errors. My question is.... How can I diagnose what is happening? or Can someone help me understand why I'm experiencing this issue. Project ID: 3c020ff0-4c00-4de7-8338-26cc7fd992c1
38 Replies
Percy
Percy•15mo ago
Project ID: 3c020ff0-4c00-4de7-8338-26cc7fd992c1
Brody
Brody•15mo ago
what makes you think the service was redeployed
it would stop after some time
can you please be more specfic?
prince2k3
prince2k3OP•15mo ago
I'm sorry if I wasn't specific enough. Want I meant was during the upload process the progress would get up to 10 to 25 percent and the fail. So it was random percentage on the app when I received the error message. on the server side I wouldn't really get an error message to know what is happening. (I added a screenshot of the log).
No description
prince2k3
prince2k3OP•15mo ago
I think it is redeploying because it re outputting my api routes. These only output at launch of the app.
Brody
Brody•15mo ago
that's not a redeploy, it's an automatic restart from railway
prince2k3
prince2k3OP•15mo ago
ah restart my bad on the term
Brody
Brody•15mo ago
can you tell me how long your upload requests last before the service crashes?
prince2k3
prince2k3OP•15mo ago
8 to 10 seconds I'm uploading 10 markdown files with an image that's about 3mb for each of them
Brody
Brody•15mo ago
for context I asked for a specific time since railway has a 5 minute limit on POST requests but 10 seconds is obviously no where near 5 minutes
prince2k3
prince2k3OP•15mo ago
correct
Brody
Brody•15mo ago
I don't really know what to tell you here, at first glance all signs so far point to a code issue
prince2k3
prince2k3OP•15mo ago
Thats what I'm thinking ....I've tested locally and everything works fine...I was just trying to figure out how to get an error message or a stack trace. I've opened up the same questions for the server framework I'm using to see if there is answer on how to get more verbose information. Just looking in all places to see where I can get help on the issuee
Brody
Brody•15mo ago
what's language and framework is this? I don't think you've said?
prince2k3
prince2k3OP•15mo ago
Vapor/Swift
Brody
Brody•15mo ago
what version of swift are you using locally
prince2k3
prince2k3OP•15mo ago
5.8
Brody
Brody•15mo ago
railway uses 5.4.2 and that's the highest it natively goes could be incompatibilities between the version of vapor you are using and swift 5.4.2
prince2k3
prince2k3OP•15mo ago
Does the version matter with Docker?
Brody
Brody•15mo ago
I'm not saying this is the issue, it's just something to consider
prince2k3
prince2k3OP•15mo ago
Definitely! I'll look into that as well
Brody
Brody•15mo ago
install swift 5.4.2 locally and do the same things you did to crash the railway service
prince2k3
prince2k3OP•15mo ago
That actually looks like that best place to start. I'll give this a look more intensely. Thanks!
Brody
Brody•15mo ago
no problem, let me know how it goes!
prince2k3
prince2k3OP•15mo ago
Will do! I found a thread on the Vapor discord talking about the 5.4.2 and some Nix pack thing I haven't finished reading it Would it be a feature request to get the swift version updated from Nix the link with the code SwiftProvider.rs, pointed out by someone from the channel, shows that it can support up to 5.8.
Brody
Brody•15mo ago
interesting it looks like you may be able to use 5.8 yourself is your local version 5.8, or is there another decimal? like a 5.8.1
prince2k3
prince2k3OP•15mo ago
just 5.8 but I'm referencing that in the Package.swift file I think I'll need to make a .swift-version file
Brody
Brody•15mo ago
add this as a nixpacks.toml file to your project, this should in theory get nixpacks to use swift 5.8
[phases.setup]
nixpkgsArchive = '976fa3369d722e76f37c77493d99829540d43845'
[phases.setup]
nixpkgsArchive = '976fa3369d722e76f37c77493d99829540d43845'
and if it is as simple as this, it wouldn't hurt to open a #🤗|feedback thread asking for versions higher than 5.4.2 to be supported
prince2k3
prince2k3OP•15mo ago
Alright! Giving this a try and then I'll make a feedback too
Brody
Brody•15mo ago
sounds good
prince2k3
prince2k3OP•15mo ago
Following up here. Turns out the Dockerfile installs Swift 5.8 and that is working fine. I’ve been able to use the other api endpoints I have with no issues. The issue was just that one endpoint which I was able to figure out a way to get the error/reason it fails. Recap ... * If you are using Dockerfile to deploy, it should use the version of Swift within it if you have it building the toolchain. * If not using Dockerfile, natively Swift 5.4.2 is supported. * If Swift version is not the issues. Check the code and make sure Error handling logs the error or returns the error to your client.
Brody
Brody•15mo ago
what dockerfile?
prince2k3
prince2k3OP•15mo ago
Attached is the Dockerfile Vapor generates
prince2k3
prince2k3OP•15mo ago
Are you seeing that message I posted? Discord thru an error like it didn't upload my message with the Dockerfile
Brody
Brody•15mo ago
if you're using your own dockerfile nixpacks doesn't come into play at all
prince2k3
prince2k3OP•15mo ago
Yeah I was able to see that things were still working when deployed and the other API endpoints still functioned. Plus I think the build should have failed otherwise before being deployed
Brody
Brody•15mo ago
well now I'm back to this being a code issue
prince2k3
prince2k3OP•15mo ago
It is ... I was able to get the error message from a small code update I added Still ...I appreciate the help and the fast response
Brody
Brody•15mo ago
I hope you find a solution!
Want results from more Discord servers?
Add your server