kimai / kimai

Kimai is a web-based multi-user time-tracking application. Works great for everyone: freelancers, companies, organizations - everyone can track their times, generate reports, create invoices and do so much more. SaaS version available at https://www.kimai.cloud
https://www.kimai.org
GNU Affero General Public License v3.0
3.04k stars 531 forks source link

Import from backup from Kimai2 to Kimai2 #809

Closed sdo992 closed 5 years ago

sdo992 commented 5 years ago

I gave my daughter my main system since hers went down and backed up the SQL data. I tried to install on my new main system and kept getting a 500 error. Searching the log, I think that I have an issue with my previously created user and the .env file(?).

Describe the solution you'd like The ability to seamlessly restore from backup. Is it possible to create a script or even a step-by-step guide to go from Kimai2 backup to a new Kimai2 on a different system?

Describe alternatives you've considered I think I'm screwed; I've not considered any other alternative since all my data are already in the old mysql db.

Additional context I followed the Installation instructions except for user and database creation. I was able to login but when i tried to go anywhere outside of the initial login screen (the 'Calendar' view), it gave me the 500 error.

kevinpapst commented 5 years ago

I re-create my system 10 times a day, simply point the DATABASE_URL to a new DB and you are good to go (or vice versa, point your new installation to an old DB). There is nothing special that you need to know.

I can only guess... which I am now doing:

  1. You switched the version without noticing, then your old DB structure doesn't match the new one which is expected. That could be fixed by running the DB migration from the normal upgrade process. What did you use before and what did you install?

  2. Are you sure you have setup the file permissions properly?

Searching the log, I think that I have an issue with my previously created user and the .env file(?).

Did it occur to you, that sharing the log message might be a good idea?

kevinpapst commented 5 years ago

Wanna share an update?

sdo992 commented 5 years ago

Sorry, been busy with the holiday weekend here.

Most likely the kimai2 DB was 0.8 (the one just before 0.9) and now I just downloaded the 0.9 and have it up and running as a new system with none of my old information.

As far as file permissions, it's been odd. I followed the installation process off the website and get a blank page. So, I tried several different things:

chown -R www-data:www-data /var/www/kimai2/* chmod -R 775 /var/www/kimai2/*

Those don't work.

chmod -R 777 /var/www/kimai2/*

The final one is what gets me a workings system. It's completely wide open.

When I try to import my data and use a completely different user, I get a 500 error.

edit this error:

Oops! An error occured.
500: Internal Server Error
An unexpected error occured, please try again. You may have found a bug, so please contact your administrator if the problem doesn't go away after you tried it again. 

tail -n 30 /var/www/kimai2/log/prod.log:


[2019-05-26 19:48:27] security.DEBUG: Read existing security token from the session. {"key":"_security_secured_area","token_class":"Symfony\\Component\\Security\\Core\\Authentication\\Token\\UsernamePasswordToken"} []
[2019-05-26 19:48:27] php.INFO: User Deprecated: Checking for the AdvancedUserInterface in "Symfony\Component\Security\Core\Authentication\Token\AbstractToken::hasUserChanged()" is deprecated since Symfony 4.1 and support for it will be removed in 5.0. Implement the Symfony\Component\Security\Core\User\EquatableInterface to check if the user has been changed, {"exception":"[object] (ErrorException(code: 0): User Deprecated: Checking for the AdvancedUserInterface in \"Symfony\\Component\\Security\\Core\\Authentication\\Token\\AbstractToken::hasUserChanged()\" is deprecated since Symfony 4.1 and support for it will be removed in 5.0. Implement the Symfony\\Component\\Security\\Core\\User\\EquatableInterface to check if the user has been changed, at /var/www/kimai2/vendor/symfony/security-core/Authentication/Token/AbstractToken.php:265)"} []
[2019-05-26 19:48:27] php.INFO: User Deprecated: Checking for the AdvancedUserInterface in "Symfony\Component\Security\Core\Authentication\Token\AbstractToken::hasUserChanged()" is deprecated since Symfony 4.1 and support for it will be removed in 5.0. Implement the Symfony\Component\Security\Core\User\EquatableInterface to check if the user has been changed, {"exception":"[object] (ErrorException(code: 0): User Deprecated: Checking for the AdvancedUserInterface in \"Symfony\\Component\\Security\\Core\\Authentication\\Token\\AbstractToken::hasUserChanged()\" is deprecated since Symfony 4.1 and support for it will be removed in 5.0. Implement the Symfony\\Component\\Security\\Core\\User\\EquatableInterface to check if the user has been changed, at /var/www/kimai2/vendor/symfony/security-core/Authentication/Token/AbstractToken.php:265)"} []
[2019-05-26 19:48:27] security.DEBUG: User was reloaded from a user provider. {"provider":"FOS\\UserBundle\\Security\\EmailUserProvider","username":"Steven"} []
[2019-05-26 19:48:27] security.DEBUG: Checking for guard authentication credentials. {"firewall_key":"secured_area","authenticators":1} []
[2019-05-26 19:48:27] security.DEBUG: Checking support on guard authenticator. {"firewall_key":"secured_area","authenticator":"App\\Security\\TokenAuthenticator"} []
[2019-05-26 19:48:27] security.DEBUG: Guard authenticator does not support the request. {"firewall_key":"secured_area","authenticator":"App\\Security\\TokenAuthenticator"} []
[2019-05-26 19:48:27] request.CRITICAL: Uncaught PHP Exception Doctrine\DBAL\Exception\InvalidFieldNameException: "An exception occurred while executing 'SELECT k0_.id AS id_0, k0_.start_time AS start_time_1, k0_.end_time AS end_time_2, k0_.timezone AS timezone_3, k0_.duration AS duration_4, k0_.description AS description_5, k0_.rate AS rate_6, k0_.fixed_rate AS fixed_rate_7, k0_.hourly_rate AS hourly_rate_8, k0_.exported AS exported_9, k1_.id AS id_10, k1_.name AS name_11, k1_.comment AS comment_12, k1_.visible AS visible_13, k1_.fixed_rate AS fixed_rate_14, k1_.hourly_rate AS hourly_rate_15, k2_.id AS id_16, k2_.name AS name_17, k2_.order_number AS order_number_18, k2_.comment AS comment_19, k2_.visible AS visible_20, k2_.budget AS budget_21, k2_.fixed_rate AS fixed_rate_22, k2_.hourly_rate AS hourly_rate_23, k3_.id AS id_24, k3_.name AS name_25, k3_.number AS number_26, k3_.comment AS comment_27, k3_.visible AS visible_28, k3_.company AS company_29, k3_.contact AS contact_30, k3_.address AS address_31, k3_.country AS country_32, k3_.currency AS currency_33, k3_.phone AS phone_34, k3_.fax AS fax_35, k3_.mobile AS mobile_36, k3_.email AS email_37, k3_.homepage AS homepage_38, k3_.timezone AS timezone_39, k3_.fixed_rate AS fixed_rate_40, k3_.hourly_rate AS hourly_rate_41, k0_.user AS user_42, k0_.activity_id AS activity_id_43, k0_.project_id AS project_id_44, k1_.project_id AS project_id_45, k2_.customer_id AS customer_id_46 FROM kimai2_timesheet k0_ INNER JOIN kimai2_activities k1_ ON k0_.activity_id = k1_.id INNER JOIN kimai2_projects k2_ ON k0_.project_id = k2_.id INNER JOIN kimai2_customers k3_ ON k2_.customer_id = k3_.id WHERE k0_.start_time > 0 AND k0_.end_time IS NULL AND k0_.user = ? ORDER BY k0_.start_time DESC' with params [1]:  SQLSTATE[42S22]: Column not found: 1054 Unknown column 'k3_.email' in 'field list'" at /var/www/kimai2/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php line 60 {"exception":"[object] (Doctrine\\DBAL\\Exception\\InvalidFieldNameException(code: 0): An exception occurred while executing 'SELECT k0_.id AS id_0, k0_.start_time AS start_time_1, k0_.end_time AS end_time_2, k0_.timezone AS timezone_3, k0_.duration AS duration_4, k0_.description AS description_5, k0_.rate AS rate_6, k0_.fixed_rate AS fixed_rate_7, k0_.hourly_rate AS hourly_rate_8, k0_.exported AS exported_9, k1_.id AS id_10, k1_.name AS name_11, k1_.comment AS comment_12, k1_.visible AS visible_13, k1_.fixed_rate AS fixed_rate_14, k1_.hourly_rate AS hourly_rate_15, k2_.id AS id_16, k2_.name AS name_17, k2_.order_number AS order_number_18, k2_.comment AS comment_19, k2_.visible AS visible_20, k2_.budget AS budget_21, k2_.fixed_rate AS fixed_rate_22, k2_.hourly_rate AS hourly_rate_23, k3_.id AS id_24, k3_.name AS name_25, k3_.number AS number_26, k3_.comment AS comment_27, k3_.visible AS visible_28, k3_.company AS company_29, k3_.contact AS contact_30, k3_.address AS address_31, k3_.country AS country_32, k3_.currency AS currency_33, k3_.phone AS phone_34, k3_.fax AS fax_35, k3_.mobile AS mobile_36, k3_.email AS email_37, k3_.homepage AS homepage_38, k3_.timezone AS timezone_39, k3_.fixed_rate AS fixed_rate_40, k3_.hourly_rate AS hourly_rate_41, k0_.user AS user_42, k0_.activity_id AS activity_id_43, k0_.project_id AS project_id_44, k1_.project_id AS project_id_45, k2_.customer_id AS customer_id_46 FROM kimai2_timesheet k0_ INNER JOIN kimai2_activities k1_ ON k0_.activity_id = k1_.id INNER JOIN kimai2_projects k2_ ON k0_.project_id = k2_.id INNER JOIN kimai2_customers k3_ ON k2_.customer_id = k3_.id WHERE k0_.start_time > 0 AND k0_.end_time IS NULL AND k0_.user = ? ORDER BY k0_.start_time DESC' with params [1]:\n\nSQLSTATE[42S22]: Column not found: 1054 Unknown column 'k3_.email' in 'field list' at /var/www/kimai2/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php:60, Doctrine\\DBAL\\Driver\\PDOException(code: 42S22): SQLSTATE[42S22]: Column not found: 1054 Unknown column 'k3_.email' in 'field list' at /var/www/kimai2/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:119, PDOException(code: 42S22): SQLSTATE[42S22]: Column not found: 1054 Unknown column 'k3_.email' in 'field list' at /var/www/kimai2/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:117)"} []
[2019-05-26 19:48:27] request.CRITICAL: Uncaught PHP Exception Doctrine\DBAL\Exception\InvalidFieldNameException: "An exception occurred while executing 'SELECT k0_.id AS id_0, k0_.start_time AS start_time_1, k0_.end_time AS end_time_2, k0_.timezone AS timezone_3, k0_.duration AS duration_4, k0_.description AS description_5, k0_.rate AS rate_6, k0_.fixed_rate AS fixed_rate_7, k0_.hourly_rate AS hourly_rate_8, k0_.exported AS exported_9, k1_.id AS id_10, k1_.name AS name_11, k1_.comment AS comment_12, k1_.visible AS visible_13, k1_.fixed_rate AS fixed_rate_14, k1_.hourly_rate AS hourly_rate_15, k2_.id AS id_16, k2_.name AS name_17, k2_.order_number AS order_number_18, k2_.comment AS comment_19, k2_.visible AS visible_20, k2_.budget AS budget_21, k2_.fixed_rate AS fixed_rate_22, k2_.hourly_rate AS hourly_rate_23, k3_.id AS id_24, k3_.name AS name_25, k3_.number AS number_26, k3_.comment AS comment_27, k3_.visible AS visible_28, k3_.company AS company_29, k3_.contact AS contact_30, k3_.address AS address_31, k3_.country AS country_32, k3_.currency AS currency_33, k3_.phone AS phone_34, k3_.fax AS fax_35, k3_.mobile AS mobile_36, k3_.email AS email_37, k3_.homepage AS homepage_38, k3_.timezone AS timezone_39, k3_.fixed_rate AS fixed_rate_40, k3_.hourly_rate AS hourly_rate_41, k0_.user AS user_42, k0_.activity_id AS activity_id_43, k0_.project_id AS project_id_44, k1_.project_id AS project_id_45, k2_.customer_id AS customer_id_46 FROM kimai2_timesheet k0_ INNER JOIN kimai2_activities k1_ ON k0_.activity_id = k1_.id INNER JOIN kimai2_projects k2_ ON k0_.project_id = k2_.id INNER JOIN kimai2_customers k3_ ON k2_.customer_id = k3_.id WHERE k0_.id IN ('406', '405', '404', '395', '393', '392', '391', '389', '388', '385') ORDER BY k0_.end_time DESC':  SQLSTATE[42S22]: Column not found: 1054 Unknown column 'k3_.email' in 'field list'" at /var/www/kimai2/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php line 60 {"exception":"[object] (Doctrine\\DBAL\\Exception\\InvalidFieldNameException(code: 0): An exception occurred while executing 'SELECT k0_.id AS id_0, k0_.start_time AS start_time_1, k0_.end_time AS end_time_2, k0_.timezone AS timezone_3, k0_.duration AS duration_4, k0_.description AS description_5, k0_.rate AS rate_6, k0_.fixed_rate AS fixed_rate_7, k0_.hourly_rate AS hourly_rate_8, k0_.exported AS exported_9, k1_.id AS id_10, k1_.name AS name_11, k1_.comment AS comment_12, k1_.visible AS visible_13, k1_.fixed_rate AS fixed_rate_14, k1_.hourly_rate AS hourly_rate_15, k2_.id AS id_16, k2_.name AS name_17, k2_.order_number AS order_number_18, k2_.comment AS comment_19, k2_.visible AS visible_20, k2_.budget AS budget_21, k2_.fixed_rate AS fixed_rate_22, k2_.hourly_rate AS hourly_rate_23, k3_.id AS id_24, k3_.name AS name_25, k3_.number AS number_26, k3_.comment AS comment_27, k3_.visible AS visible_28, k3_.company AS company_29, k3_.contact AS contact_30, k3_.address AS address_31, k3_.country AS country_32, k3_.currency AS currency_33, k3_.phone AS phone_34, k3_.fax AS fax_35, k3_.mobile AS mobile_36, k3_.email AS email_37, k3_.homepage AS homepage_38, k3_.timezone AS timezone_39, k3_.fixed_rate AS fixed_rate_40, k3_.hourly_rate AS hourly_rate_41, k0_.user AS user_42, k0_.activity_id AS activity_id_43, k0_.project_id AS project_id_44, k1_.project_id AS project_id_45, k2_.customer_id AS customer_id_46 FROM kimai2_timesheet k0_ INNER JOIN kimai2_activities k1_ ON k0_.activity_id = k1_.id INNER JOIN kimai2_projects k2_ ON k0_.project_id = k2_.id INNER JOIN kimai2_customers k3_ ON k2_.customer_id = k3_.id WHERE k0_.id IN ('406', '405', '404', '395', '393', '392', '391', '389', '388', '385') ORDER BY k0_.end_time DESC':\n\nSQLSTATE[42S22]: Column not found: 1054 Unknown column 'k3_.email' in 'field list' at /var/www/kimai2/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php:60, Doctrine\\DBAL\\Driver\\PDOException(code: 42S22): SQLSTATE[42S22]: Column not found: 1054 Unknown column 'k3_.email' in 'field list' at /var/www/kimai2/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:90, PDOException(code: 42S22): SQLSTATE[42S22]: Column not found: 1054 Unknown column 'k3_.email' in 'field list' at /var/www/kimai2/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:88)"} []
[2019-05-26 19:48:27] security.DEBUG: Stored the security token in the session. {"key":"_security_secured_area"} []
[2019-05-26 19:48:27] request.INFO: Matched route "calendar_entries". {"route":"calendar_entries","route_parameters":{"_route":"calendar_entries","_controller":"App\\Controller\\CalendarController::calendarEntries","_locale":"en"},"request_uri":"http://localhost/en/calendar/user?_=1558900107562&end=2019-06-09&start=2019-04-28","method":"GET"} []
[2019-05-26 19:48:27] security.DEBUG: Read existing security token from the session. {"key":"_security_secured_area","token_class":"Symfony\\Component\\Security\\Core\\Authentication\\Token\\UsernamePasswordToken"} []
[2019-05-26 19:48:27] php.INFO: User Deprecated: Checking for the AdvancedUserInterface in "Symfony\Component\Security\Core\Authentication\Token\AbstractToken::hasUserChanged()" is deprecated since Symfony 4.1 and support for it will be removed in 5.0. Implement the Symfony\Component\Security\Core\User\EquatableInterface to check if the user has been changed, {"exception":"[object] (ErrorException(code: 0): User Deprecated: Checking for the AdvancedUserInterface in \"Symfony\\Component\\Security\\Core\\Authentication\\Token\\AbstractToken::hasUserChanged()\" is deprecated since Symfony 4.1 and support for it will be removed in 5.0. Implement the Symfony\\Component\\Security\\Core\\User\\EquatableInterface to check if the user has been changed, at /var/www/kimai2/vendor/symfony/security-core/Authentication/Token/AbstractToken.php:265)"} []
[2019-05-26 19:48:27] php.INFO: User Deprecated: Checking for the AdvancedUserInterface in "Symfony\Component\Security\Core\Authentication\Token\AbstractToken::hasUserChanged()" is deprecated since Symfony 4.1 and support for it will be removed in 5.0. Implement the Symfony\Component\Security\Core\User\EquatableInterface to check if the user has been changed, {"exception":"[object] (ErrorException(code: 0): User Deprecated: Checking for the AdvancedUserInterface in \"Symfony\\Component\\Security\\Core\\Authentication\\Token\\AbstractToken::hasUserChanged()\" is deprecated since Symfony 4.1 and support for it will be removed in 5.0. Implement the Symfony\\Component\\Security\\Core\\User\\EquatableInterface to check if the user has been changed, at /var/www/kimai2/vendor/symfony/security-core/Authentication/Token/AbstractToken.php:265)"} []
[2019-05-26 19:48:27] security.DEBUG: User was reloaded from a user provider. {"provider":"FOS\\UserBundle\\Security\\EmailUserProvider","username":"Steven"} []
[2019-05-26 19:48:27] security.DEBUG: Checking for guard authentication credentials. {"firewall_key":"secured_area","authenticators":1} []
[2019-05-26 19:48:27] security.DEBUG: Checking support on guard authenticator. {"firewall_key":"secured_area","authenticator":"App\\Security\\TokenAuthenticator"} []
[2019-05-26 19:48:27] security.DEBUG: Guard authenticator does not support the request. {"firewall_key":"secured_area","authenticator":"App\\Security\\TokenAuthenticator"} []
[2019-05-26 19:48:27] request.CRITICAL: Uncaught PHP Exception Doctrine\DBAL\Exception\InvalidFieldNameException: "An exception occurred while executing 'SELECT k0_.id AS id_0, k0_.start_time AS start_time_1, k0_.end_time AS end_time_2, k0_.timezone AS timezone_3, k0_.duration AS duration_4, k0_.description AS description_5, k0_.rate AS rate_6, k0_.fixed_rate AS fixed_rate_7, k0_.hourly_rate AS hourly_rate_8, k0_.exported AS exported_9, k1_.id AS id_10, k1_.name AS name_11, k1_.comment AS comment_12, k1_.visible AS visible_13, k1_.fixed_rate AS fixed_rate_14, k1_.hourly_rate AS hourly_rate_15, k2_.username AS username_16, k2_.username_canonical AS username_canonical_17, k2_.email AS email_18, k2_.email_canonical AS email_canonical_19, k2_.enabled AS enabled_20, k2_.salt AS salt_21, k2_.password AS password_22, k2_.last_login AS last_login_23, k2_.confirmation_token AS confirmation_token_24, k2_.password_requested_at AS password_requested_at_25, k2_.roles AS roles_26, k2_.id AS id_27, k2_.alias AS alias_28, k2_.registration_date AS registration_date_29, k2_.title AS title_30, k2_.avatar AS avatar_31, k2_.api_token AS api_token_32, k3_.id AS id_33, k3_.name AS name_34, k3_.order_number AS order_number_35, k3_.comment AS comment_36, k3_.visible AS visible_37, k3_.budget AS budget_38, k3_.fixed_rate AS fixed_rate_39, k3_.hourly_rate AS hourly_rate_40, k4_.id AS id_41, k4_.name AS name_42, k4_.number AS number_43, k4_.comment AS comment_44, k4_.visible AS visible_45, k4_.company AS company_46, k4_.contact AS contact_47, k4_.address AS address_48, k4_.country AS country_49, k4_.currency AS currency_50, k4_.phone AS phone_51, k4_.fax AS fax_52, k4_.mobile AS mobile_53, k4_.email AS email_54, k4_.homepage AS homepage_55, k4_.timezone AS timezone_56, k4_.fixed_rate AS fixed_rate_57, k4_.hourly_rate AS hourly_rate_58, k0_.user AS user_59, k0_.activity_id AS activity_id_60, k0_.project_id AS project_id_61, k1_.project_id AS project_id_62, k3_.customer_id AS customer_id_63 FROM kimai2_timesheet k0_ LEFT JOIN kimai2_activities k1_ ON k0_.activity_id = k1_.id LEFT JOIN kimai2_users k2_ ON k0_.user = k2_.id LEFT JOIN kimai2_projects k3_ ON k0_.project_id = k3_.id LEFT JOIN kimai2_customers k4_ ON k3_.customer_id = k4_.id WHERE k0_.user = ? AND k0_.start_time >= ? AND k0_.start_time <= ? ORDER BY k0_.start_time DESC' with params [1, "2019-04-28 08:00:00", "2019-06-10 07:59:59"]:  SQLSTATE[42S22]: Column not found: 1054 Unknown column 'k4_.email' in 'field list'" at /var/www/kimai2/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php line 60 {"exception":"[object] (Doctrine\\DBAL\\Exception\\InvalidFieldNameException(code: 0): An exception occurred while executing 'SELECT k0_.id AS id_0, k0_.start_time AS start_time_1, k0_.end_time AS end_time_2, k0_.timezone AS timezone_3, k0_.duration AS duration_4, k0_.description AS description_5, k0_.rate AS rate_6, k0_.fixed_rate AS fixed_rate_7, k0_.hourly_rate AS hourly_rate_8, k0_.exported AS exported_9, k1_.id AS id_10, k1_.name AS name_11, k1_.comment AS comment_12, k1_.visible AS visible_13, k1_.fixed_rate AS fixed_rate_14, k1_.hourly_rate AS hourly_rate_15, k2_.username AS username_16, k2_.username_canonical AS username_canonical_17, k2_.email AS email_18, k2_.email_canonical AS email_canonical_19, k2_.enabled AS enabled_20, k2_.salt AS salt_21, k2_.password AS password_22, k2_.last_login AS last_login_23, k2_.confirmation_token AS confirmation_token_24, k2_.password_requested_at AS password_requested_at_25, k2_.roles AS roles_26, k2_.id AS id_27, k2_.alias AS alias_28, k2_.registration_date AS registration_date_29, k2_.title AS title_30, k2_.avatar AS avatar_31, k2_.api_token AS api_token_32, k3_.id AS id_33, k3_.name AS name_34, k3_.order_number AS order_number_35, k3_.comment AS comment_36, k3_.visible AS visible_37, k3_.budget AS budget_38, k3_.fixed_rate AS fixed_rate_39, k3_.hourly_rate AS hourly_rate_40, k4_.id AS id_41, k4_.name AS name_42, k4_.number AS number_43, k4_.comment AS comment_44, k4_.visible AS visible_45, k4_.company AS company_46, k4_.contact AS contact_47, k4_.address AS address_48, k4_.country AS country_49, k4_.currency AS currency_50, k4_.phone AS phone_51, k4_.fax AS fax_52, k4_.mobile AS mobile_53, k4_.email AS email_54, k4_.homepage AS homepage_55, k4_.timezone AS timezone_56, k4_.fixed_rate AS fixed_rate_57, k4_.hourly_rate AS hourly_rate_58, k0_.user AS user_59, k0_.activity_id AS activity_id_60, k0_.project_id AS project_id_61, k1_.project_id AS project_id_62, k3_.customer_id AS customer_id_63 FROM kimai2_timesheet k0_ LEFT JOIN kimai2_activities k1_ ON k0_.activity_id = k1_.id LEFT JOIN kimai2_users k2_ ON k0_.user = k2_.id LEFT JOIN kimai2_projects k3_ ON k0_.project_id = k3_.id LEFT JOIN kimai2_customers k4_ ON k3_.customer_id = k4_.id WHERE k0_.user = ? AND k0_.start_time >= ? AND k0_.start_time <= ? ORDER BY k0_.start_time DESC' with params [1, \"2019-04-28 08:00:00\", \"2019-06-10 07:59:59\"]:\n\nSQLSTATE[42S22]: Column not found: 1054 Unknown column 'k4_.email' in 'field list' at /var/www/kimai2/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php:60, Doctrine\\DBAL\\Driver\\PDOException(code: 42S22): SQLSTATE[42S22]: Column not found: 1054 Unknown column 'k4_.email' in 'field list' at /var/www/kimai2/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:119, PDOException(code: 42S22): SQLSTATE[42S22]: Column not found: 1054 Unknown column 'k4_.email' in 'field list' at /var/www/kimai2/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:117)"} []
[2019-05-26 19:48:27] security.DEBUG: Stored the security token in the session. {"key":"_security_secured_area"} []
[2019-05-26 19:48:30] request.INFO: Matched route "timesheet". {"route":"timesheet","route_parameters":{"_route":"timesheet","page":1,"_controller":"App\\Controller\\TimesheetController::indexAction","_locale":"en"},"request_uri":"http://localhost/en/timesheet/","method":"GET"} []
[2019-05-26 19:48:30] security.DEBUG: Read existing security token from the session. {"key":"_security_secured_area","token_class":"Symfony\\Component\\Security\\Core\\Authentication\\Token\\UsernamePasswordToken"} []
[2019-05-26 19:48:30] php.INFO: User Deprecated: Checking for the AdvancedUserInterface in "Symfony\Component\Security\Core\Authentication\Token\AbstractToken::hasUserChanged()" is deprecated since Symfony 4.1 and support for it will be removed in 5.0. Implement the Symfony\Component\Security\Core\User\EquatableInterface to check if the user has been changed, {"exception":"[object] (ErrorException(code: 0): User Deprecated: Checking for the AdvancedUserInterface in \"Symfony\\Component\\Security\\Core\\Authentication\\Token\\AbstractToken::hasUserChanged()\" is deprecated since Symfony 4.1 and support for it will be removed in 5.0. Implement the Symfony\\Component\\Security\\Core\\User\\EquatableInterface to check if the user has been changed, at /var/www/kimai2/vendor/symfony/security-core/Authentication/Token/AbstractToken.php:265)"} []
[2019-05-26 19:48:30] php.INFO: User Deprecated: Checking for the AdvancedUserInterface in "Symfony\Component\Security\Core\Authentication\Token\AbstractToken::hasUserChanged()" is deprecated since Symfony 4.1 and support for it will be removed in 5.0. Implement the Symfony\Component\Security\Core\User\EquatableInterface to check if the user has been changed, {"exception":"[object] (ErrorException(code: 0): User Deprecated: Checking for the AdvancedUserInterface in \"Symfony\\Component\\Security\\Core\\Authentication\\Token\\AbstractToken::hasUserChanged()\" is deprecated since Symfony 4.1 and support for it will be removed in 5.0. Implement the Symfony\\Component\\Security\\Core\\User\\EquatableInterface to check if the user has been changed, at /var/www/kimai2/vendor/symfony/security-core/Authentication/Token/AbstractToken.php:265)"} []
[2019-05-26 19:48:30] security.DEBUG: User was reloaded from a user provider. {"provider":"FOS\\UserBundle\\Security\\EmailUserProvider","username":"Steven"} []
[2019-05-26 19:48:30] security.DEBUG: Checking for guard authentication credentials. {"firewall_key":"secured_area","authenticators":1} []
[2019-05-26 19:48:30] security.DEBUG: Checking support on guard authenticator. {"firewall_key":"secured_area","authenticator":"App\\Security\\TokenAuthenticator"} []
[2019-05-26 19:48:30] security.DEBUG: Guard authenticator does not support the request. {"firewall_key":"secured_area","authenticator":"App\\Security\\TokenAuthenticator"} []
[2019-05-26 19:48:30] request.CRITICAL: Uncaught PHP Exception Doctrine\DBAL\Exception\InvalidFieldNameException: "An exception occurred while executing 'SELECT k0_.id AS id_0, k0_.name AS name_1, k0_.number AS number_2, k0_.comment AS comment_3, k0_.visible AS visible_4, k0_.company AS company_5, k0_.contact AS contact_6, k0_.address AS address_7, k0_.country AS country_8, k0_.currency AS currency_9, k0_.phone AS phone_10, k0_.fax AS fax_11, k0_.mobile AS mobile_12, k0_.email AS email_13, k0_.homepage AS homepage_14, k0_.timezone AS timezone_15, k0_.fixed_rate AS fixed_rate_16, k0_.hourly_rate AS hourly_rate_17 FROM kimai2_customers k0_ WHERE k0_.visible = 1 ORDER BY k0_.name ASC':  SQLSTATE[42S22]: Column not found: 1054 Unknown column 'k0_.email' in 'field list'" at /var/www/kimai2/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php line 60 {"exception":"[object] (Doctrine\\DBAL\\Exception\\InvalidFieldNameException(code: 0): An exception occurred while executing 'SELECT k0_.id AS id_0, k0_.name AS name_1, k0_.number AS number_2, k0_.comment AS comment_3, k0_.visible AS visible_4, k0_.company AS company_5, k0_.contact AS contact_6, k0_.address AS address_7, k0_.country AS country_8, k0_.currency AS currency_9, k0_.phone AS phone_10, k0_.fax AS fax_11, k0_.mobile AS mobile_12, k0_.email AS email_13, k0_.homepage AS homepage_14, k0_.timezone AS timezone_15, k0_.fixed_rate AS fixed_rate_16, k0_.hourly_rate AS hourly_rate_17 FROM kimai2_customers k0_ WHERE k0_.visible = 1 ORDER BY k0_.name ASC':\n\nSQLSTATE[42S22]: Column not found: 1054 Unknown column 'k0_.email' in 'field list' at /var/www/kimai2/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php:60, Doctrine\\DBAL\\Driver\\PDOException(code: 42S22): SQLSTATE[42S22]: Column not found: 1054 Unknown column 'k0_.email' in 'field list' at /var/www/kimai2/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:90, PDOException(code: 42S22): SQLSTATE[42S22]: Column not found: 1054 Unknown column 'k0_.email' in 'field list' at /var/www/kimai2/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:88)"} []
[2019-05-26 19:48:30] security.DEBUG: Stored the security token in the session. {"key":"_security_secured_area"} []
sdo992 commented 5 years ago

I'm using Solus Linux and nginx.

nginx.conf:

user www-data;
worker_processes 2;

events {
    worker_connections  1024;
}

http {
    include     mime.types;
    default_type    application/octet-stream;

    sendfile    on;
    keepalive_timeout 65;
    gzip        on;
    include     /etc/nginx/sites-enabled/*.conf;
}

/etc/nginx/sites-availabe/kimai.conf:

server {
    listen 80 default_server;
    server_name localhost;
    root /var/www/kimai2/public;
    index index.php;

    location / {
        try_files $uri /index.php$is_args$args;
        #try_files $uri $uri/ /index.php?q=$uri&$args;
    }

    location ~ \.php$ {
        #try_files $uri = 404;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_pass 127.0.0.1:9000;
        fastcgi_index index.php;
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        #include    fastcgi_params;
        include /etc/nginx/fastcgi.conf;
    }

    error_log /var/log/nginx/project_error.log;
    access_log /var/log/nginx/project_access.log;
}

Nothing to report in either:

/var/log/nginx/error.log

or

/var/log/nginx/access.log

May try another linux or even windows; since I have a f***ing Max-Q hybrid graphics laptop, Solus seems to work the best with it. So, I've been hesitant to switch.

kevinpapst commented 5 years ago

Hahaha, you shouldn't switch an OS for a software.

Its simple and as I guessed in the beginning:

Unknown column 'k0_.email' in 'field list' at

Everything is "fine" besides that you didn't migrate your database. You still have a backup, right?

Then execute the normal upgrade process, explained here: https://github.com/kevinpapst/kimai2/blob/master/UPGRADING.md

Make sure to check the version specific steps. As you did a fresh install, you maybe only need to call the migration.

sdo992 commented 5 years ago

I ran the migrate and it found nothing to migrate, after the DB restore, of course.

I was able to log in, but got a blank page everywhere; I ran:

chmod -R 777 var/

And was able to see the Calendar, Dashboard, User, Plugin, and Settings, but nothing else. They all return the same error as above:

Oops! An error occured.
500: Internal Server Error
An unexpected error occured, please try again. You may have found a bug, so please contact your administrator if the problem doesn't go away after you tried it again. 

I completely removed the database and /var/www/kimai2 folder and started over and still have the problem.

local.yaml does not exist in config/packages/ so I have nothing to change.

sdo992 commented 5 years ago

Oh my dear gods, what a long process. It took weeks to get this up and running.

This FINALLY fixed it:

bin/console doctrine:schema:update --force --complete

I changed the permissions back on /var/www/kimai2/var to 775 and it still works. I need to make sure I can enter new data, change old data, and everything else, but at least I can finally get back in!

kevinpapst commented 5 years ago

Oh thats not good. If the command did not find missing migrations, you have another problem. Was 0.8 the first version you installed? Did you execute the documented command bin/console doctrine:migrations:version --add --all? Don't do it know, if you haven't before. Do you have the database table migration_versions?

sdo992 commented 5 years ago

Yeah, it was the 0.8. I started in v1 and then successfully upgraded to v2, 0.8. Between 26 Apr 2019, my last entry in 0.8, and now, I guess 0.9 was released

And, I did execute bin/console doctrine:migrations:version --add --all several times (each time a new attempt at an install) as I tried to get it up and running.

I do not have the database table migration_versions in kimai database.

sdo992 commented 5 years ago

So, if I want to import my backup, how do I do that?

If the migrations have a possibility to cause data corruption, I have to run it before the database restore.

When I restore the database, it gets rid of the migration_versions in kimai.

kevinpapst commented 5 years ago

I hope that helps: https://www.kimai.org/documentation/backups.html

sdo992 commented 5 years ago

Awesome, thank you! I read through it and those are the steps that finally got it working, but we stumbled through it. Now that it's online, it should be easier.

kevinpapst commented 5 years ago

Thanks for your feedback, yes I hope the next one doesn't have to "suffer" what you went through :-D

lock[bot] commented 4 years ago

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.