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
Project ID:
3c020ff0-4c00-4de7-8338-26cc7fd992c1
what makes you think the service was redeployed
it would stop after some timecan you please be more specfic?
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).
I think it is redeploying because it re outputting my api routes. These only output at launch of the app.
that's not a redeploy, it's an automatic restart from railway
ah restart my bad on the term
can you tell me how long your upload requests last before the service crashes?
8 to 10 seconds
I'm uploading 10 markdown files with an image that's about 3mb for each of them
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
correct
I don't really know what to tell you here, at first glance all signs so far point to a code issue
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
what's language and framework is this? I don't think you've said?
Vapor/Swift
what version of swift are you using locally
5.8
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
Does the version matter with Docker?
I'm not saying this is the issue, it's just something to consider
Definitely! I'll look into that as well
install swift 5.4.2 locally and do the same things you did to crash the railway service
That actually looks like that best place to start. I'll give this a look more intensely. Thanks!
no problem, let me know how it goes!
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.
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
just 5.8
but I'm referencing that in the Package.swift file
I think I'll need to make a .swift-version file
add this as a nixpacks.toml file to your project, this should in theory get nixpacks to use swift 5.8
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
Alright!
Giving this a try and then I'll make a feedback too
sounds good
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.
what dockerfile?
Attached is the Dockerfile Vapor generates
Are you seeing that message I posted?
Discord thru an error like it didn't upload my message with the Dockerfile
if you're using your own dockerfile nixpacks doesn't come into play at all
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
well now I'm back to this being a code issue
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
I hope you find a solution!