2shady4u / godot-sqlite

GDExtension wrapper for SQLite (Godot 4.x+)
MIT License
895 stars 79 forks source link

Disk io errors on non-readonly databases in html5 export #105

Closed feefladder closed 1 year ago

feefladder commented 1 year ago

Environment:

Issue description: I get disk io errors. Not sure why.... Any help to debug would also be appreciated. For now, I think I'll reproduce the schema I was trying to implement with resources only.

image

Steps to reproduce: Open the demo, export to web (either with the icon or export and run python -m http.server and open).

Minimal reproduction project: The demo project in releases. Alternatively this one: demo.zip Also the export, maybe someone could try to run it to see if the problem is in exporting or my browser: demo_html.zip unzip to some location

cd /path/to/demo_html
python -m http.server & firefox localhost:8000/SQLiteDemo.html

Open the console and see the errors

Additional context Variant is set to GDNative in export: image

2shady4u commented 1 year ago

Hi @feefladder,

The supplied demo-project works perfectly on my end 🤔 (Windows 11 & Firefox) I will look into this as soon as possible.

Greetings, 2shady4u

feefladder commented 1 year ago

Also the demo_html?

feefladder commented 1 year ago

because I just tried on windows and there had the same error... Maybe something with how I do the export....

feefladder commented 1 year ago

https://stackoverflow.com/a/53271447/14681457 seems to say that the journal file is not writeable...

2shady4u commented 1 year ago

Also the demo_html?

Hello, I can confirm that I have the exact same issue when running the supplied demo_html.zip. I'll check it out once I have more time (hopefully this weekend?)

https://stackoverflow.com/a/53271447/14681457 seems to say that the journal file is not writeable...

It's more like that there's some issue with the root folder not being created or similar.

feefladder commented 1 year ago

I verified that it also does not work on windows Godot 3.5.1 export (I even had other errors when running from the html5 button in the topright corner). However, on Linux Godot 3.4.stable it is working!

Windows export (not working): win4.zip Linux 3.4 export (working): lin3.4.zip

Also, the root folder is accessible and writeable (I verified that files are in there and cprinted one of the json files to verify).

I will for now just be using Godot 3.4 then :)

2shady4u commented 1 year ago

Hi @feefladder!

This has now been fixed in 1581cc6d30ca34cb26f34e904b3657b990de1188! 🥳 The issue was that the EMScripten version I used for javascript compilation was out-of-date with regards to the version used by the official Godot executables and export templates.

I'll do a new release at some point (v3.5) which addresses/fixes this issue on the Godot assetlib. For now you can download and replace the javascript binary (libgdsqlite.wasm) with the one found here: https://github.com/2shady4u/godot-sqlite/actions/runs/3504201912

Again thanks for reporting this issue 😄

Also: I'll leave this issue open until the release that officially closes this issue

2shady4u commented 1 year ago

This issue has now been fixed in the latest release (https://github.com/2shady4u/godot-sqlite/releases/tag/v3.5) 🥳

Thank you for reporting this issue and enjoy your coding!