Closed jorrharris closed 5 years ago
I haven't worked with Firebase before, but try explicitly setting your SQLite database location:
Themeparks.Settings.Cache = __dirname + "/themeparks.db";
This doesn't seem to fix the issue. The '/themeparks.db' file is being created, but there is nothing inside of it. For some reason it is read only I'm guessing, which is causing the issue?
I'm afraid I don't know how Firebase works. Is it a lambda function service, or something else? The library doesn't work well with lambda style hosting because the new API really needs a persistent data storage.
Can you test locally to ensure your setup works fine and can populate the database? Otherwise, try and write some other files to your local Firebase instance to figure out what is not working. If that works, try making your own sqlite3 database to debug why the sqlite3 library isn't running in your environment.
It's basically just a node.js server that you can run cloud functions on. I tested the code on my local environment and it works just fine. What I am basically doing is trying to pull the waitTime info from the library and store it in my own firebase database. Would there be a better way to do this?
@cubehouse After doing some reading, It looks like you can't be writing files to the local firebase file system because of the way it works. Is there anyway to get the wait times without writing to that themeparks.db file (like how v4.x.x) did things?
I've only just started with firebase functions but it appears you can write to /tmp but it's per function invocation. Have you tired that?
@OkoWsc I added this:
Themeparks.Settings.Cache = __dirname + "/tmp/themeparks.db";
If that's what you mean? It didn't seem to do anything but produce another error in addition to the one I was already getting before (So now I'm getting two errors):
Error: function crashed out of request scope Function invocation was interrupted.
Based on Google's docs the temp is /tmp not in the application running directory.
Try
Themeparks.Settings.Cache = "/tmp/themeparks.db";
@OkoWsc This worked, thank you very much, you are a life saver!
Park Disney Resort California Adventure Disney Resort Magic Kingdom
Context
Describe the bug I am trying to use the library with firebase. It was working with the older version before disney took down their api. But now I get this error when deploying my function and I don't really know what to do because I've never used SQLite with firebase and don't really understand what it's doing...
Error:
Here is my code:
Output In my firebase logs this error appears:
Does anyone know how to solve this or why I am getting this error?