nakla / sbfspot

Scripts for building and running the docker container
18 stars 10 forks source link

No SQL...configured in SBFspot.cfg #2

Closed itchy2 closed 3 years ago

itchy2 commented 3 years ago

Hi Nakla,

i'm trying to get your sbfspot docker version to work.

I created a docker run command, based on your examples:

docker run -e "DB_STORAGE=mysql" -e "INIT_DB=1" -e "DB_ROOT_USER=root" -e "DB_ROOT_PW=mysqlroot_pw" -v /home/myuser/docker/datapath/sbfspot/var/sbfspot:/var/sbfspot -v /home/myuser/docker/datapath/sbfspot/etc/sbfspot:/etc/sbfspot nakla/sbfspot:latest

in this path i have stored the SBFspot.cfg:

/home/myuser/docker/datapath/sbfspot/etc/sbfspot

in the SBFspot.cfg I have the following section:

MySQL

SQL_Database=sbfspot SQL_Hostname=localhost SQL_Username=sbfspot_sql_user SQL_Password=sbfspot_sql_password

the sbfspot database shall be created by INIT_DB=1 Hostname = localhost, as it is running on the same docker system. Username and Passwort like expected

Unfortunately the docker run results always in an error message:

No SQL_Database configured in SBFspot.cfg No SQL_Hostname configured in SBFspot.cfg No SQL_Username configured in SBFspot.cfg No SQL_Password configured in SBFspot.cfg

Can you provide support?

Thx and KR Itchy2

nakla commented 3 years ago

Hi Itchy2, please add -e "ENABLE_SBFSPOT=1" Option to your docker run command to see, i there are file permission issues. I didn't include them in the init_db section.

itchy2 commented 3 years ago

Hi Nakla,

thanks for your feedback. We are getting closer:

ERROR 2005 (HY000): Unknown MySQL server host 'mysqldb' (-2) Error creating SBFspot Database, tables and views. Please manually add the file "CreateMySQLDB.sql" (located in SBFspots data directory) to your Database, if the Database does not exist yet. ERROR 2005 (HY000): Unknown MySQL server host 'mysqldb' (-2) ERROR 2005 (HY000): Unknown MySQL server host 'mysqldb' (-2) ERROR 2005 (HY000): Unknown MySQL server host 'mysqldb' (-2) ERROR 2005 (HY000): Unknown MySQL server host 'mysqldb' (-2)

My other containers are working well with the hostname mysqldb (container on the same host).

Kind regards Itchy2

nakla commented 3 years ago

I personally use the IP address of my DB container, not the name. Perhaps that is an option for you.

itchy2 commented 3 years ago

Hi Nakla,

thanks for your feedback. I tried to adjust the settings to IP but nothing changed. Furthermore I tried to rename the SBFSPOT.cfg file to check if there is any difference, if the file is missing. Interesting fact: No change.

So did I made something wrong with the paths itself?

Kind regards Itchy2

nakla commented 3 years ago

Can you post the error messages?

itchy2 commented 3 years ago

Hi Nakla,

yes, for sure.

That's all what I get after docker run...

No SQL_Hostname configured in SBFspot.cfg. No SQL_Database configured in SBFspot.cfg. No SQL_Username configured in SBFspot.cfg. No SQL_Password configured in SBFspot.cfg. Please configure the listed value(s) and restart the container.

nakla commented 3 years ago

Ok, if you receive those messages, it is possible, that the config file isn't found (i already made a new version of the script to be clear in that case). The config file has to be named SBFspot.cfg - not SBFSPOT.cfg - it is case sensitive.

7 days ago, you wrote a mysql unknown host error - in that case, the config file was already there and found by the script.

itchy2 commented 3 years ago

Hi Nakla,

I tried to investigate what happend and did some config changes to understand the situation.

By taking out the Database creation commands (-e "INIT_DB=1" -e "DB_ROOT_USER=root" -e "DB_ROOT_PW=mysqlroot_pw") and creating it manually i solved the issue and everything is working fine. I cannot explain to myself why this happend, but it is working now.

One last point which I noticed: I enabled the CSV export in the config-file but it is only creating the event csv files. The Spot csvs will not be created. Paths, config and folder-mappings look fine. Any Ideas what happend?

KR Itchy2

nakla commented 3 years ago

I don't know. As you get one csv, the data directory must be writeable. Possibly a configuration issue? Perhaps you can use debug and verbose options, to solve your problem.