CSPro 7.0 beta web server

Other discussions about CSPro
Forum rules
New release: CSPro 8.0
lls
Posts: 109
Joined: December 6th, 2011, 3:11 pm
Location: Geneva, Switzerland

CSPro 7.0 beta web server

Post by lls »

Hi, I tried to set up a web server following the instruction in the 'Web Server Setup.pdf' doc provided.
All the steps from the "run setup" script went well, but any attempt to login fails (from the my.domain.org/ui).

I tried twice, setup is ok but login doesn't work. Also my.domain.org/api return the following:

{"type":"error","status":404,"code":"fatal_error","message":"No route found for \"GET \/\""}

Please advise

Thank you
josh
Posts: 2399
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: CSPro 7.0 beta web server

Post by josh »

Take a look at the log files (ui.log and api.log) in the logs folder on your server. There should be some information there giving more details on the failure.
lls
Posts: 109
Joined: December 6th, 2011, 3:11 pm
Location: Geneva, Switzerland

Re: CSPro 7.0 beta web server

Post by lls »

Thank you for the tip. Unfortunately, I don't really understand what it means. This is what I found:

[2016-11-05 22:47:08] CSPro UI.INFO: Matched route "GET_". {"route_parameters":{"_controller":"Controllers\\LoginController::login","_route":"GET_"},"request_uri":"http://XXXX.org/ui/"} []
[2016-11-05 22:47:21] CSPro UI.INFO: Matched route "login_check". {"route_parameters":{"_controller":"Controllers\\LoginController::loginAction","_route":"login_check"},"request_uri":"http://XXXX.org/ui/login_check"} []
[2016-11-05 22:47:22] CSPro UI.DEBUG: Failed Authenticating User. {"type":"error","status":500,"code":"fatal_error","message":"We are sorry, but something went terribly wrong."} [] []


[2016-11-05 22:47:22] CSPro API.CRITICAL: PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'lls.cspro_users' doesn't exist (uncaught exception) at /meta/www/l/lls/vendor/bshaffer/oauth2-server-php/src/OAuth2/Storage/Pdo.php line 316 {"exception":"[object] (PDOException(code: 42S02): SQLSTATE[42S02]: Base table or view not found: 1146 Table 'lls.cspro_users' doesn't exist at /meta/www/l/lls/vendor/bshaffer/oauth2-server-php/src/OAuth2/Storage/Pdo.php:316)"} []
[2016-11-05 22:47:22] CSPro API.INFO: < 500 [] []
josh
Posts: 2399
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: CSPro 7.0 beta web server

Post by josh »

From what I see it looks like either the database tables were not created when the setup was run or the database parameters (host, database name, username, password) are not correct. It is looking for the table cspro_users but it is not finding it. That table should have been created during setup. Can you look in phpMyadmin (or whatever tool you use to manage databases on your server) and check to see if that table exists. You should have that along with a bunch of other tables like cspro_config, cspro_dictionaries, cspro_log...

If the tables are not their it is possible that the database username you gave during setup is a user that does not have privileges to create new database tables.

Can you also check file cspro-rest-api\src\api\app\config.php and make sure that the values for the following are correct:

DBHOST - should be set to localhost (unless your database is running on a different machine than your web server)
DBNAME - name of database, should match the database you see in phpMyAdmin
DBUSER - name of database user, make sure this user has privileges to access the database DBNAME
DBPASS - password for database user DBUSER

If you want to run the setup again and set new values you can delete this config file and re-run setup.
lls
Posts: 109
Joined: December 6th, 2011, 3:11 pm
Location: Geneva, Switzerland

Re: CSPro 7.0 beta web server

Post by lls »

Hi,
thank you for your reply.
The table cspro_users doesn't seem to have been created. Here are the tables that I found after running the script. Does that look correct?


Image
josh
Posts: 2399
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: CSPro 7.0 beta web server

Post by josh »

Looks like not all the tables are getting created during setup. I also see that the setup script is not properly reporting the error. Please try the following:

1) In phpmyadmin delete the existing tables in the database you are using for cspro
2) delete the file cspro-rest-api\src\api\app\config.php so that you can run setup again
3) replace the file cspro-rest-api/setup/configure.php with the attached version which has better error checking (you will need to unzip it first)
4) re-run the setup

This time setup should fail with an error message. Let me know what the error message is and then we can figure out how to fix it.

We will add the improved error checking to the next version of CSPro so you in the future you will not need to do this.
Josh
Attachments
configure.zip
(4.05 KiB) Downloaded 522 times
lls
Posts: 109
Joined: December 6th, 2011, 3:11 pm
Location: Geneva, Switzerland

Re: CSPro 7.0 beta web server

Post by lls »

This is the error message generated by the setup script.

Code: Select all

Failed to connect to database. SQLSTATE[HY000]: General error: 1293 Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause
josh
Posts: 2399
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: CSPro 7.0 beta web server

Post by josh »

This is likely due to a difference between your version of MYSQL and the versions we have tested with. There is a limitation on the number of timestamp columns in versions of MYSQL prior to 5.6.5. We are working on a fix to be able to support that version but you could also upgrade your MySQL to 5.6.5 or later.
lls
Posts: 109
Joined: December 6th, 2011, 3:11 pm
Location: Geneva, Switzerland

Re: CSPro 7.0 beta web server

Post by lls »

Thank you Josh :)
I will see if I can have MySQL upgraded to a newer version on my server. Otherwise, do you have any time frame on a fix to support older MySQL version?
josh
Posts: 2399
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: CSPro 7.0 beta web server

Post by josh »

We don't have a timeframe yet, but hopefully by the end of December.
Post Reply