gathering / wannabe

Event-system for TG - wannabe.gathering.org
GNU General Public License v3.0
12 stars 7 forks source link

Setup issues with MySQL #32

Open HavardPede opened 4 years ago

HavardPede commented 4 years ago

Currently trying to set up Wannabe, following your setup guide. We are running it with php7, and MySql version 5.7 however. As I'm setting up, I am noticing that MySql is throwing a lot of errors due to default TIMESTAMP and datetime values being set to '0000-00-00 00:00:00'. Upon doing research, I realize that these two types ony accept values from '1970-01-02 00:00:00' and upwards, which renders 0000-00-00 incorrect. I changed all the default values in the intial migration file to this timestamp, and which allowed me to call sh migrate.sh for the first time without the database throwing errors.

However, when I now try to run cake event, the following occours:

Warning Error: Declaration of User::beforeFind() should be compatible with Model::beforeFind($query) in [/var/www/html/wannabe/app/Model/User.php, line 2]

2019-09-04 22:08:50 Warning: Declaration of User::beforeFind() should be compatible with Model::beforeFind($query) in [/var/www/html/wannabe/app/Model/User.php, line 2]
Warning Error: Declaration of User::afterFind($res) should be compatible with Model::afterFind($results, $primary = false) in [/var/www/html/wannabe/app/Model/User.php, line 2]

2019-09-04 22:08:50 Warning: Declaration of User::afterFind($res) should be compatible with Model::afterFind($results, $primary = false) in [/var/www/html/wannabe/app/Model/User.php, line 2]
Warning Error: Declaration of User::afterSave() should be compatible with Model::afterSave($created, $options = Array) in [/var/www/html/wannabe/app/Model/User.php, line 2]

2019-09-04 22:08:50 Warning: Declaration of User::afterSave() should be compatible with Model::afterSave($created, $options = Array) in [/var/www/html/wannabe/app/Model/User.php, line 2]
Warning Error: Declaration of User::beforeValidate() should be compatible with Model::beforeValidate($options = Array) in [/var/www/html/wannabe/app/Model/User.php, line 2]

2019-09-04 22:08:50 Warning: Declaration of User::beforeValidate() should be compatible with Model::beforeValidate($options = Array) in [/var/www/html/wannabe/app/Model/User.php, line 2]
Warning Error: Declaration of Crew::beforeSave($options) should be compatible with AppModel::beforeSave($options = Array) in [/var/www/html/wannabe/app/Model/Crew.php, line 436]

2019-09-04 22:08:50 Warning: Declaration of Crew::beforeSave($options) should be compatible with AppModel::beforeSave($options = Array) in [/var/www/html/wannabe/app/Model/Crew.php, line 436]

Welcome to CakePHP v2.10.2 Console
---------------------------------------------------------------
App : app
Path: /var/www/html/wannabe/app/
---------------------------------------------------------------
Create new event
---------------------------------------------------------------
Enter event details
Name of event
[The Gathering 2020] >
Reference/shot name of event
[tg20] >
Support email
[wannabe@gathering.org] >
Should I hide the event from front page? (Y/N)
[Y] >
Should the event be disabled for all users? (if yes, only superusers are allowed) (Y/N)
[Y] >
---------------------------------------------------------------
I will now create the following event:
---------------------------------------------------------------
Name: The Gathering 2020
Reference: tg20
Email: wannabe@gathering.org
Hide: Yes
Disable: Yes
Can Apply For Crew: No
Look okay? (Y/N)
[N] > y
Error: SQLSTATE[22007]: Invalid datetime format: 1292 Incorrect datetime value: '0000-00-00 00:00:00' for column 'created' at row 1
#0 /var/www/html/wannabe/lib/Cake/Model/Datasource/DboSource.php(472): PDOStatement->execute(Array)
#1 /var/www/html/wannabe/lib/Cake/Model/Datasource/DboSource.php(438): DboSource->_execute('INSERT INTO `wa...', Array)
#2 /var/www/html/wannabe/lib/Cake/Model/Datasource/DboSource.php(1092): DboSource->execute('INSERT INTO `wa...')
#3 /var/www/html/wannabe/lib/Cake/Model/Model.php(1940): DboSource->create(Object(Event), Array, Array)
#4 /var/www/html/wannabe/lib/Cake/Model/Model.php(1758): Model->_doSave(NULL, Array)
#5 /var/www/html/wannabe/app/Console/Command/Task/EventCreationTask.php(49): Model->save()
#6 /var/www/html/wannabe/app/Console/Command/EventShell.php(7): EventCreationTask->execute()
#7 /var/www/html/wannabe/lib/Cake/Console/Shell.php(462): EventShell->main()
#8 /var/www/html/wannabe/lib/Cake/Console/ShellDispatcher.php(219): Shell->runCommand(NULL, Array)
#9 /var/www/html/wannabe/lib/Cake/Console/ShellDispatcher.php(66): ShellDispatcher->dispatch()
#10 /var/www/html/wannabe/lib/Cake/Console/cake.php(54): ShellDispatcher::run(Array)
#11 {main}

Do you have any solution for this?

niccofyren commented 4 years ago

The master branch is not php 7 compatible without changes to code (is a temporary patch file in the build directory). Not sure about the MySQL issues, but might also be related to versioning (changes in what default values are accepted).

As of now I would personally recommend running the docker setup from master, or docker-compose PR/branch, as that will eliminate much of the variations/debugging needed to getting a basic version up an running. These also have the most recent setup instructions.

I'm quite new to the project, so might be others with better help for your specific issues without changing to the docker approach?

Atriusftw commented 4 years ago

I'm running the prod branch with no major issues on PHP 7.2 and MySQL 5.7 in my testing environment. From my experience it is mostly PHP 7.3 and beyond that breaks some stuff.

By the way, i edited your post and enclosed the logs in code tags.

HavardPede commented 4 years ago

I am currently running the master branch on php 7.2 and MySQL 5.7, and am currently getting those issues. @Atriusftw is MySQL not throwing errors for you with default timestamps set to "0000-00-00" etc? I will try setting it up with prod instead of master and let you know

MagnixDesign commented 3 years ago

Seems to be the mysql server who are not happy about the entry seems like strict mode or sql_mode are interupting what you are doing. I got this fixed.