Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MariaDB issue (was Frontend cannot start) #318

Open
bpnak opened this issue Apr 11, 2023 · 1 comment
Open

MariaDB issue (was Frontend cannot start) #318

bpnak opened this issue Apr 11, 2023 · 1 comment

Comments

@bpnak
Copy link

bpnak commented Apr 11, 2023

Hi. I am trying to setup a test server and cannot launch frontend executable.
I get the following error

Database driver mysql
panic: Error 1064: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '"user" WHERE id = ?' at line 1

goroutine 1 [running]:
main.main()
/home/user/go/pkg/mod/github.com/readium/[email protected]/frontend/frontend.go:78 +0xaa9

@llemeurfr
Copy link
Contributor

We didn't adapt the LCP Server to MariaDB, but it is a fork of MySQL and should therefore be compatible.

I suppose that you have configured the servers with the appropriate database URI (see https://github.com/readium/readium-lcp-server#individual-server-configurations).

Here, you're talking about the Frontend Test Server (which is a toy and MUST NOT be used in production). From the error message, the culprit is here: https://github.com/readium/readium-lcp-server/blob/master/frontend/webuser/webuser.go#L146

Could you please try to change the escaped double-quotes for back ticks, i.e.

db.Prepare("SELECT id, uuid, name, email, password, hint FROM "user" WHERE id = ?")
becomes
db.Prepare("SELECT id, uuid, name, email, password, hint FROM user WHERE id = ?")

You'll have to do that in the whole webuser.go file (this is the only file which is using "user").

Please advise if it works, we'll update the codebase then.

Note: The next major version of the codebase will use an ORM (GORM) which will make it easier to adopt any SQL database.

@llemeurfr llemeurfr changed the title Frontend cannot start MariaDB issue (was Frontend cannot start) Dec 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants