evidence icon indicating copy to clipboard operation
evidence copied to clipboard

[Bug]: MySQL - adding new source query causes page to error out

Open hughess opened this issue 1 year ago • 1 comments

Describe the bug

Adding a MySQL connection in a project, then adding a SQL query to that source directory causes the project to error out.

Steps to Reproduce

  • Create a project using the template
  • Add a new MySQL data source
  • Add a new .sql file to that data source folder
  • Page should refresh, but will contain error "cannot find <data source name>_<query name>.parquet"
  • Looking in the .evidence/template/static/data folder, the parquet file does exist, but the page can't seem to find it
  • Restarting the server does not fix the issue

Logs

No response

System Info

No response

Severity

blocking all usage of Evidence

Additional Information, or Workarounds

Unclear if this is an issue with all MySQL connections, or only a result of a specific configuration in a user's project. Have not reproduced the issue yet.

hughess avatar Jun 24 '24 15:06 hughess

The exact version is 10.6.18-MariaDB-deb10.

jaroet avatar Jun 30 '24 07:06 jaroet

Some extra insight about this issue ...

I guess you are using the https://github.com/sidorares/node-mysql2 driver for node to connect to MySQL? I installed MySQL locally brew install mysql and imported the Chinook database. Then I added the connection to Evidence and all worked fine. No problem connecting and querying in a fresh project. So I tested in my main project and that also went fine.

So I guess the issue is with MariaDB. According to this post it is supposed to be supported https://github.com/sidorares/node-mysql2/discussions/1905. Not sure if it is related to the driver or how it is used in evidence, specially as with npm run sources is shows the correct number of records is read.

jaroet avatar Jul 11 '24 14:07 jaroet

@jaroet To help us investigate, can you provide us with a minimal reproduction?

zachstence avatar Jul 22 '24 15:07 zachstence

Not sure how much more I can send or tell exactly.

As mentioned the connection I made was of type MySQL but was in fact a MariaDb instance. As I understood they should be interchangeable. When I add the connection info only there is no problem, but as soon as I am adding an SQL file with a very small and simple query and then save that file, the query gets executed and it works (it tells me the correct number of rows). But on running the dev server it fails with errors like Sean mentioned in the initial issue and none of the other connections/output works anymore.

If you need any specific info or if you have anything to test let me know.

jaroet avatar Jul 22 '24 18:07 jaroet

I had not looked at this issue for a few weeks (except my comment 16 hours ago). I upgraded to the latest 39.1.1 and retried it. And it works !!!

Not sure why it works now (Sean has seen it fails in a private chat). I have installed the newest version but I see not mention on any changes related to MySQL. The only thing I can think of is that the local installation of MySQL (using brew) and then a restart maybe did fix something not right on my machine.

I now have removed MySQL server again (not yet restarted) and added the same source query that previously went wrong and now it goes right. Strange ... but I am glad it works now.

For me it is no longer needed to keep this open anymore as it is fixed now but I can imagine you want to further investigate. So I will leave that to your discretion.

jaroet avatar Jul 23 '24 11:07 jaroet

We'll close this pending any more user reports of the issue

archiewood avatar Jul 23 '24 13:07 archiewood