-
Notifications
You must be signed in to change notification settings - Fork 33
Preparations causing fatal error #43
Comments
I've traced the error to this line which causes the crash
|
Maybe because it is force unwrapping the TimeZone. Can you edit the file on your linux system and see if that is the fix? |
I could only set it to a non optional so did this and it worked. None of the |
Go ahead and create with that fix. |
Would this cause an issue when run on a different timezone?
Not sure what this reference date is used for exactly. Alternatively what about something like this?
|
I'm actually not sure why the reference date exists. I can only find 2 references to it which seem to be better server by just using The current uses are |
It think you are right. Submit a PR and @sroebert can review it. He knows this library better than I do. I want to make sure we aren't missing some edge case. |
Something else is going on here. The tests aren't passing unless you set the TimeZone. I'm interested in why it fails on Linux but not macOS. I think there is some nuance between the two we are missing. |
Turns out the reference date tested against was a year before. Changed the code to match the tests. They should pass again now. |
I am wondering why this crashes on your side, but not in the unit tests run on Linux. Which Swift version are you using? I am assuming the latest. I know there are some issues with TimeZone in Foundation on Linux, maybe it is because other function are called before that. Either way, using a direct reference time is fine. I did it like this, to have a clear indication of when the reference time actually is. But with the comment it seems fine. |
On the official Docker image for Swift |
I cannot test now, but perhaps the |
@vzsg spot on, just tested after installing |
@pruthvikar, @vzsg - Do you think we should revert the PR? |
I actually like that with the new solution you do not have to have |
not building on heroku either. any current workaround? |
@JustinM1 are you receiving the same error? Installing tzdata worked for me. |
@natebird Since this PR reduces dependencies, I also prefer keeping it :) |
I agree. 👍 Also, less reverts. |
@pruthvikar would you happen to know how to go about installing that with heroku? |
Installing a system package won't work on Heroku, so we really need a solution that 1) works and 2) doesn't have extra external dependencies. |
Ok, so should I make the 2.0.1 release? |
Yeah, please 👍 |
Expected Behavior
Preparations should run and vapor should report
Database prepared
on OSX and LinuxCurrent Behavior
Preparations run as expected on OSX but not on Linux.
Preparations cause
fatal error: unexpectedly found nil while unwrapping an Optional value
Postgres also encounters the following
ERROR: relation "fluent" does not exist at character 43
when executing this statement
STATEMENT: SELECT COUNT(*) as _fluent_aggregate FROM "fluent"
Possible causes
Seems like the way preparation history is being tracked is causing an issue when trying to store in the db. Maybe the
fluent
table is not being set up properly?Steps to Reproduce
Details
Here is the full (yet limited) stack trace. It is cause after the first preparation has finished
The text was updated successfully, but these errors were encountered: