HiromuHota / webspoon-docker

Dockerfile for webSpoon
https://hub.docker.com/r/hiromuhota/webspoon/
Apache License 2.0
103 stars 61 forks source link

How to add database drivers for connections? #5

Closed gurumark closed 6 years ago

gurumark commented 6 years ago

Thanks for developing this awesome piece of software. It was something I wanted for a long time. I'm using docker and want to connect MySql databases. It looks like the driver is not included in the image. How can I add the driver? Thanks again.

gurumark commented 6 years ago

I was able to connect to Mysql. Connected to the docker image, downloaded the driver to /LIB lib and restarted the container. From Webspoon, I need to connect to my database repository. Created the connection, tested it. The connection is successful however when I want to connect to the repository I get:

"You don't seem to be getting a connection to the server. Please check the path you're using and make sure the server is up and running."

My repository 3306 port is available, the connection for database repository is ok. Why am I not getting connected? Is it something related to PDI 8.0?

Thanks in advance if you provide a hint?

HiromuHota commented 6 years ago

I was gonna tell you this way (copy the JDBC driver to /lib, then restart). Alternatively, you can create a new Docker image based on hiromuhota/webspoon:latest-full. The new Dockerfile should look like

FROM hiromuhota/webspoon:latest-full
COPY mysql-connector-java-5.1.45-bin.jar ${CATALINA_HOME}/lib/mysql-connector-java-5.1.45-bin.jar

I encountered a similar error when I was testing DB repository, which I resolved somehow. Let me try to remember what it was.

HiromuHota commented 6 years ago

I quickly tested with a PostgreSQL-based DB repository and it worked. One notable difference between postgresql and mysql is that the driver for postgresql is placed at $CATALINA_HOME/webapps/spoon/WEB-INF/lib and that for mysql is at $CATALINA_HOME/lib. Can you move the driver for mysql to $CATALINA_HOME/webapps/spoon/WEB-INF/lib and try again?

gurumark commented 6 years ago

Thanks. I am trying right now.

gurumark commented 6 years ago

Well, It turned out I put it in that directory at the first time: /usr/local/tomcat/webapps/spoon/WEB-INF/lib That's why my connection to the database was ok. I am using 4.4.3.4 version. Could it be that 8.0 version is looking for a newer repository version?

HiromuHota commented 6 years ago

Could it be that 8.0 version is looking for a newer repository version?

I don't think so because Database repository is no longer supported hence no reason to change the dependent version of MySQL.

What would happen if you use Spoon of 8.0 version?

gurumark commented 6 years ago

What would happen if you use Spoon of 8.0 version? -- Well, we do not know. The version we have has been working just fine. They added so many things that either we do not need or made the whole thing more complex. We do not use the BI server. I am not big fan of their interface either but I am willing to put up with it if I can make webspoon work. I am used to mysqldump our reps to production and with this version we need to run DI server?

HiromuHota commented 6 years ago

Please test it with Spoon of 8.0. If it works, this issue is webSpoon-specific. If it doesn't, it is an issue of Spoon itself.

I am used to mysqldump our reps to production and with this version we need to run DI server?

This could be an alternative way, but please test it with Spoon first.

gurumark commented 6 years ago

I will try it but 8,0 is not in the sourceforge and my build from the source failed. If you know anyother place I can download it, please let me know. But here is the thing; I am able to connect to the database so it means it connection works. I can also get data using a table input step using another connection. I think it is related to webspoon but the definitive answer will come after I downloaded the 8.0.

HiromuHota commented 6 years ago

8.0 is also hosted by sourceforge and downloadable from https://sourceforge.net/projects/pentaho/files/Pentaho%208.0/client-tools/pdi-ce-8.0.0.0-28.zip

Most of the webSpoon’s source code is identical to Spoon’s. So whenever I get an error on webSpoon, I have to check if the error can be reproduced on Spoon unless I can deny the possibility. Please try Spoon and tell me how it goes.

gurumark commented 6 years ago

You were right. I got the same error connecting to the same rep. However, I was able to connect to another rep without any issue. So there should be something different in repository that it does not like. Do you have any idea?

gurumark commented 6 years ago

I checked the rep version "SELECT * FROM r_version". The one that it is working has 5.0 and the other one is 4.0. It seems like it is expecting at least 5.0 rep version. I created a blank rep and checked the version and it was 5.0. The old one needs be upgraded to make it work.

HiromuHota commented 6 years ago

Thank you for testing with Spoon.

The old one needs be upgraded to make it work.

I found a similar issue in (the old) Pentaho Forums: https://forums.pentaho.com/threads/156321-Error-upgrading-repository-from-4-4-0-to-5-0-1 According to the post, you can upgrade a database repository by

  1. Create new empty repo using 5.0.1
  2. Export 4.4.0 repo
  3. Import into 5.0.1

If this method does not help, please consider asking a help in the old Pentaho Forums or the new Vantara Community as this is an issue of Spoon instead of webSpoon.

gurumark commented 6 years ago

Thanks for researching it for me. You steps works as expected.