Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Database Error on upgrade from 1.14.3 to 1.15 #2769

Closed
AlxxxlA opened this issue Sep 17, 2021 · 6 comments
Closed

Database Error on upgrade from 1.14.3 to 1.15 #2769

AlxxxlA opened this issue Sep 17, 2021 · 6 comments
Labels
Milestone

Comments

@AlxxxlA
Copy link

AlxxxlA commented Sep 17, 2021

First, thank you for your work. Kimai fits almost perfectly with my needs as a freelance.

Describe the bug
Upgrade to Kimai 1.15 from a fresh install 1.14.3 but there is an error on "bin/console kimai:update"

To Reproduce

  1. git fetch --tags
  2. git checkout 1.15
  3. composer install --no-dev --optimize-autoloader
composer/package-versions-deprecated: Generating version class...
composer/package-versions-deprecated: ...done generating version class
102 packages you are using are looking for funding.
Use the `composer fund` command to find out more!

Synchronizing package.json with PHP packages
Don't forget to run npm install --force or yarn install --force to refresh your JavaScript dependencies!
Run composer recipes at any time to see the status of your Symfony recipes.

Executing script cache:clear [OK]
Executing script assets:install [OK]
  1. I got an error on bin/console kimai:update

Logfile

bin/console kimai:update

Kimai updates running ...
=========================

[notice] Migrating up to DoctrineMigrations\Version20210802174320
[error] Migration DoctrineMigrations\Version20210802160837 failed during Execution. Error: "An exception occurred while executing 'ALTER TABLE kimai2_timesheet CHANGE date_tz date_tz DATE DEFAULT 'NULL' NOT NULL':

SQLSTATE[42000]: Syntax error or access violation: 1067 Invalid default value for 'date_tz'"
                                                                                                                        
 [ERROR] An exception occurred while executing 'ALTER TABLE kimai2_timesheet CHANGE date_tz date_tz DATE DEFAULT 'NULL' 
         NOT NULL':                                                                                                     
                                                                                                                        
         SQLSTATE[42000]: Syntax error or access violation: 1067 Invalid default value for 'date_tz'

Additional context

  • Kimai version: 1.14.3
  • PHP version: 7.4
  • Three plugins installed : ReadOnlyAccessBundle SharedProjectTimesheetsBundle TaskManagementBundle

Thank you

@AlxxxlA AlxxxlA added the bug label Sep 17, 2021
@kevinpapst
Copy link
Member

Did "composer update" install new packages? You have hidden that part of the output ;-)

Anyways, two things:

  1. The plugins need to be updated to be compatible with 1.15 - that's why the update is not yet featured on the homepage. You get my updated version here at Github if you have sent me your Gumroad recipe in the past to get access.
  2. The SQL is auto generated from the framework, specifically for your used database type (mysql vs mariadb) and the version. I assume you have to configure it properly and then the update should work.
    If your Kimai is older, this documentation might be missing in the .env file.
    Please read it, set the correct DB version and execute the update again.

@AlxxxlA
Copy link
Author

AlxxxlA commented Sep 17, 2021

Indeed, the problem come from my side, serverVersion=mariadb-10.5.10 was missing in my config file.

All is fine, problem solve :)

Thank you

@AlxxxlA AlxxxlA closed this as completed Sep 17, 2021
@kevinpapst kevinpapst added support and removed bug labels Sep 17, 2021
@kevinpapst kevinpapst added this to the 1.15.1 milestone Sep 17, 2021
@ogoe
Copy link

ogoe commented Oct 6, 2021

I run into the same error when upgrading from 1.14 to 1.15.x.
I have serverVersion=mariadb-5.3.29 in my .env file and no plugins.
Somebody any Ideas?

@kevinpapst
Copy link
Member

Are you sure about the DB version? Mariadb 5 sounds wrong.

@ogoe
Copy link

ogoe commented Oct 6, 2021

Are you sure about the DB version? Mariadb 5 sounds wrong.

Yes, that was 5 from mysql instead of a 10. Sorry. It works now.

@kevinpapst kevinpapst mentioned this issue Nov 17, 2021
3 tasks
@github-actions
Copy link

github-actions bot commented Apr 5, 2022

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. If you use Kimai on a daily basis, please consider donating to support further development of Kimai.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 5, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

No branches or pull requests

3 participants