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

Installation - Syntax error or access violation: 1072 Key column 'user_id' doesn't exist in table #801

Closed
LPTT opened this issue May 3, 2023 · 1 comment
Assignees
Labels

Comments

@LPTT
Copy link

LPTT commented May 3, 2023

Describe the bug
In the install step "creating database schema" I get an error. The logs say "Syntax error or access violation: 1072 Key column 'user_id' doesn't exist in table".

Tested it with 2.2.2 and 2.2.1

To Reproduce
shared hosting account at all-inkl.com
PHP8.1
10.5.19-MariaDB

Screenshots
image

Logs

[2023-05-03T16:05:47.860624+02:00] app.DEBUG: ALTER TABLE invoice_lines ADD CONSTRAINT FK_72DBDC23416CCF0F FOREIGN KEY (recurringInvoice_id) REFERENCES recurring_invoices (id) {"query":"ALTER TABLE invoice_lines ADD CONSTRAINT FK_72DBDC23416CCF0F FOREIGN KEY (recurringInvoice_id) REFERENCES recurring_invoices (id)"} []
[2023-05-03T16:05:47.876644+02:00] app.DEBUG: ALTER TABLE recurringinvoice_contact ADD CONSTRAINT FK_1673913EE31CCDF FOREIGN KEY (recurringinvoice_id) REFERENCES recurring_invoices (id) {"query":"ALTER TABLE recurringinvoice_contact ADD CONSTRAINT FK_1673913EE31CCDF FOREIGN KEY (recurringinvoice_id) REFERENCES recurring_invoices (id)"} []
[2023-05-03T16:05:47.892032+02:00] app.NOTICE: Successfully migrated recurring_invoices.id to UUIDs! {"migration":{"DoctrineMigrations\\Version20201":[]}} []
[2023-05-03T16:05:47.892057+02:00] app.NOTICE: Migrating tax_rates.id to UUIDs... {"migration":{"DoctrineMigrations\\Version20201":[]}} []
[2023-05-03T16:05:47.915064+02:00] app.NOTICE: -> Detected the following foreign keys : {"migration":{"DoctrineMigrations\\Version20201":[]}} []
[2023-05-03T16:05:47.915078+02:00] app.NOTICE:   * invoice_lines.tax_id {"migration":{"DoctrineMigrations\\Version20201":[]}} []
[2023-05-03T16:05:47.915083+02:00] app.NOTICE:   * quote_lines.tax_id {"migration":{"DoctrineMigrations\\Version20201":[]}} []
[2023-05-03T16:05:47.920557+02:00] app.DEBUG: ALTER TABLE invoice_lines ADD tax_id_to_uuid BINARY(16) DEFAULT NULL COMMENT '(DC2Type:uuid_binary_ordered_time)' {"query":"ALTER TABLE invoice_lines ADD tax_id_to_uuid BINARY(16) DEFAULT NULL COMMENT '(DC2Type:uuid_binary_ordered_time)'"} []
[2023-05-03T16:05:47.923962+02:00] app.DEBUG: ALTER TABLE quote_lines ADD tax_id_to_uuid BINARY(16) DEFAULT NULL COMMENT '(DC2Type:uuid_binary_ordered_time)' {"query":"ALTER TABLE quote_lines ADD tax_id_to_uuid BINARY(16) DEFAULT NULL COMMENT '(DC2Type:uuid_binary_ordered_time)'"} []
[2023-05-03T16:05:47.926657+02:00] app.DEBUG: ALTER TABLE tax_rates ADD __uuid__ BINARY(16) NOT NULL COMMENT '(DC2Type:uuid_binary_ordered_time)' {"query":"ALTER TABLE tax_rates ADD __uuid__ BINARY(16) NOT NULL COMMENT '(DC2Type:uuid_binary_ordered_time)'"} []
[2023-05-03T16:05:47.930857+02:00] app.NOTICE: -> Generating 0 UUID(s)... {"migration":{"DoctrineMigrations\\Version20201":[]}} []
[2023-05-03T16:05:47.930870+02:00] app.NOTICE: -> Adding UUIDs to tables with foreign keys... {"migration":{"DoctrineMigrations\\Version20201":[]}} []
[2023-05-03T16:05:47.931287+02:00] app.NOTICE:   * Adding 0 UUIDs to "invoice_lines.tax_id" {"migration":{"DoctrineMigrations\\Version20201":[]}} []
[2023-05-03T16:05:47.931599+02:00] app.NOTICE:   * Adding 0 UUIDs to "quote_lines.tax_id" {"migration":{"DoctrineMigrations\\Version20201":[]}} []
[2023-05-03T16:05:47.931609+02:00] app.NOTICE: -> Deleting previous id foreign keys... {"migration":{"DoctrineMigrations\\Version20201":[]}} []
[2023-05-03T16:05:47.937292+02:00] app.DEBUG: ALTER TABLE invoice_lines DROP FOREIGN KEY FK_72DBDC23B2A824D8 {"query":"ALTER TABLE invoice_lines DROP FOREIGN KEY FK_72DBDC23B2A824D8"} []
[2023-05-03T16:05:47.941311+02:00] app.DEBUG: ALTER TABLE invoice_lines DROP tax_id {"query":"ALTER TABLE invoice_lines DROP tax_id"} []
[2023-05-03T16:05:47.947790+02:00] app.DEBUG: ALTER TABLE quote_lines DROP FOREIGN KEY FK_42FE01F7B2A824D8 {"query":"ALTER TABLE quote_lines DROP FOREIGN KEY FK_42FE01F7B2A824D8"} []
[2023-05-03T16:05:47.951606+02:00] app.DEBUG: ALTER TABLE quote_lines DROP tax_id {"query":"ALTER TABLE quote_lines DROP tax_id"} []
[2023-05-03T16:05:47.956757+02:00] app.NOTICE: -> Renaming temporary uuid foreign keys to previous foreign keys names... {"migration":{"DoctrineMigrations\\Version20201":[]}} []
[2023-05-03T16:05:47.971496+02:00] app.DEBUG: ALTER TABLE invoice_lines CHANGE tax_id_to_uuid tax_id BINARY(16) DEFAULT NULL COMMENT '(DC2Type:uuid_binary_ordered_time)' {"query":"ALTER TABLE invoice_lines CHANGE tax_id_to_uuid tax_id BINARY(16) DEFAULT NULL COMMENT '(DC2Type:uuid_binary_ordered_time)'"} []
[2023-05-03T16:05:47.974110+02:00] app.DEBUG: ALTER TABLE quote_lines CHANGE tax_id_to_uuid tax_id BINARY(16) DEFAULT NULL COMMENT '(DC2Type:uuid_binary_ordered_time)' {"query":"ALTER TABLE quote_lines CHANGE tax_id_to_uuid tax_id BINARY(16) DEFAULT NULL COMMENT '(DC2Type:uuid_binary_ordered_time)'"} []
[2023-05-03T16:05:47.976753+02:00] app.NOTICE: -> Creating the uuid primary key... {"migration":{"DoctrineMigrations\\Version20201":[]}} []
[2023-05-03T16:05:47.985385+02:00] app.DEBUG: DROP INDEX `PRIMARY` ON tax_rates {"query":"DROP INDEX `PRIMARY` ON tax_rates"} []
[2023-05-03T16:05:47.996427+02:00] app.DEBUG: ALTER TABLE tax_rates DROP id {"query":"ALTER TABLE tax_rates DROP id"} []
[2023-05-03T16:05:48.006970+02:00] app.DEBUG: ALTER TABLE tax_rates CHANGE __uuid__ id BINARY(16) NOT NULL COMMENT '(DC2Type:uuid_binary_ordered_time)', ADD PRIMARY KEY (id) {"query":"ALTER TABLE tax_rates CHANGE __uuid__ id BINARY(16) NOT NULL COMMENT '(DC2Type:uuid_binary_ordered_time)', ADD PRIMARY KEY (id)"} []
[2023-05-03T16:05:48.022109+02:00] app.DEBUG: ALTER TABLE invoice_lines ADD CONSTRAINT FK_72DBDC23B2A824D8 FOREIGN KEY (tax_id) REFERENCES tax_rates (id) {"query":"ALTER TABLE invoice_lines ADD CONSTRAINT FK_72DBDC23B2A824D8 FOREIGN KEY (tax_id) REFERENCES tax_rates (id)"} []
[2023-05-03T16:05:48.040745+02:00] app.DEBUG: ALTER TABLE quote_lines ADD CONSTRAINT FK_42FE01F7B2A824D8 FOREIGN KEY (tax_id) REFERENCES tax_rates (id) {"query":"ALTER TABLE quote_lines ADD CONSTRAINT FK_42FE01F7B2A824D8 FOREIGN KEY (tax_id) REFERENCES tax_rates (id)"} []
[2023-05-03T16:05:48.061814+02:00] app.NOTICE: Successfully migrated tax_rates.id to UUIDs! {"migration":{"DoctrineMigrations\\Version20201":[]}} []
[2023-05-03T16:05:48.066991+02:00] app.DEBUG: ALTER TABLE user_company ADD CONSTRAINT FK_17B21745A76ED395 FOREIGN KEY (user_id) REFERENCES users (id) {"query":"ALTER TABLE user_company ADD CONSTRAINT FK_17B21745A76ED395 FOREIGN KEY (user_id) REFERENCES users (id)"} []
[2023-05-03T16:05:48.080905+02:00] app.NOTICE: Migrating users.id to UUIDs... {"migration":{"DoctrineMigrations\\Version20201":[]}} []
[2023-05-03T16:05:48.105192+02:00] app.NOTICE: -> Detected the following foreign keys : {"migration":{"DoctrineMigrations\\Version20201":[]}} []
[2023-05-03T16:05:48.105206+02:00] app.NOTICE:   * api_tokens.user_id {"migration":{"DoctrineMigrations\\Version20201":[]}} []
[2023-05-03T16:05:48.105211+02:00] app.NOTICE:   * user_company.user_id {"migration":{"DoctrineMigrations\\Version20201":[]}} []
[2023-05-03T16:05:48.105215+02:00] app.NOTICE:   * user_invitations.invited_by_id {"migration":{"DoctrineMigrations\\Version20201":[]}} []
[2023-05-03T16:05:48.115414+02:00] app.DEBUG: ALTER TABLE api_tokens ADD user_id_to_uuid BINARY(16) DEFAULT NULL COMMENT '(DC2Type:uuid_binary_ordered_time)' {"query":"ALTER TABLE api_tokens ADD user_id_to_uuid BINARY(16) DEFAULT NULL COMMENT '(DC2Type:uuid_binary_ordered_time)'"} []
[2023-05-03T16:05:48.119378+02:00] app.DEBUG: ALTER TABLE user_company ADD user_id_to_uuid BINARY(16) NOT NULL COMMENT '(DC2Type:uuid_binary_ordered_time)' {"query":"ALTER TABLE user_company ADD user_id_to_uuid BINARY(16) NOT NULL COMMENT '(DC2Type:uuid_binary_ordered_time)'"} []
[2023-05-03T16:05:48.122633+02:00] app.DEBUG: ALTER TABLE user_invitations ADD invited_by_id_to_uuid BINARY(16) NOT NULL COMMENT '(DC2Type:uuid_binary_ordered_time)' {"query":"ALTER TABLE user_invitations ADD invited_by_id_to_uuid BINARY(16) NOT NULL COMMENT '(DC2Type:uuid_binary_ordered_time)'"} []
[2023-05-03T16:05:48.125747+02:00] app.DEBUG: ALTER TABLE users ADD __uuid__ BINARY(16) NOT NULL COMMENT '(DC2Type:uuid_binary_ordered_time)' {"query":"ALTER TABLE users ADD __uuid__ BINARY(16) NOT NULL COMMENT '(DC2Type:uuid_binary_ordered_time)'"} []
[2023-05-03T16:05:48.130284+02:00] app.NOTICE: -> Generating 0 UUID(s)... {"migration":{"DoctrineMigrations\\Version20201":[]}} []
[2023-05-03T16:05:48.130296+02:00] app.NOTICE: -> Adding UUIDs to tables with foreign keys... {"migration":{"DoctrineMigrations\\Version20201":[]}} []
[2023-05-03T16:05:48.130654+02:00] app.NOTICE:   * Adding 0 UUIDs to "api_tokens.user_id" {"migration":{"DoctrineMigrations\\Version20201":[]}} []
[2023-05-03T16:05:48.130948+02:00] app.NOTICE:   * Adding 0 UUIDs to "user_company.user_id" {"migration":{"DoctrineMigrations\\Version20201":[]}} []
[2023-05-03T16:05:48.131288+02:00] app.NOTICE:   * Adding 0 UUIDs to "user_invitations.invited_by_id" {"migration":{"DoctrineMigrations\\Version20201":[]}} []
[2023-05-03T16:05:48.131298+02:00] app.NOTICE: -> Deleting previous id foreign keys... {"migration":{"DoctrineMigrations\\Version20201":[]}} []
[2023-05-03T16:05:48.137481+02:00] app.DEBUG: ALTER TABLE api_tokens DROP FOREIGN KEY FK_2CAD560EA76ED395 {"query":"ALTER TABLE api_tokens DROP FOREIGN KEY FK_2CAD560EA76ED395"} []
[2023-05-03T16:05:48.139831+02:00] app.DEBUG: ALTER TABLE api_tokens DROP user_id {"query":"ALTER TABLE api_tokens DROP user_id"} []
[2023-05-03T16:05:48.144063+02:00] app.DEBUG: ALTER TABLE user_company DROP FOREIGN KEY FK_17B21745A76ED395 {"query":"ALTER TABLE user_company DROP FOREIGN KEY FK_17B21745A76ED395"} []
[2023-05-03T16:05:48.146715+02:00] app.DEBUG: ALTER TABLE user_company DROP user_id {"query":"ALTER TABLE user_company DROP user_id"} []
[2023-05-03T16:05:48.147063+02:00] app.ERROR: Migration DoctrineMigrations\Version20201 failed during Execution. Error: "An exception occurred while executing a query: SQLSTATE[42000]: Syntax error or access violation: 1072 Key column 'user_id' doesn't exist in table" {"version":"DoctrineMigrations\\Version20201","error":"An exception occurred while executing a query: SQLSTATE[42000]: Syntax error or access violation: 1072 Key column 'user_id' doesn't exist in table","state":"Execution"} []
[2023-05-03T16:05:48.149550+02:00] request.CRITICAL: Uncaught PHP Exception Doctrine\DBAL\Exception\DriverException: "An exception occurred while executing a query: SQLSTATE[42000]: Syntax error or access violation: 1072 Key column 'user_id' doesn't exist in table" at /www/htdocs/w0125363/rechnung.xyz.de/vendor/doctrine/dbal/src/Driver/API/MySQL/ExceptionConverter.php line 117 {"exception":"[object] (Doctrine\\DBAL\\Exception\\DriverException(code: 1072): An exception occurred while executing a query: SQLSTATE[42000]: Syntax error or access violation: 1072 Key column 'user_id' doesn't exist in table at /www/htdocs/w0125363/rechnung.xyz.de/vendor/doctrine/dbal/src/Driver/API/MySQL/ExceptionConverter.php:117)\n[previous exception] [object] (Doctrine\\DBAL\\Driver\\PDO\\Exception(code: 1072): SQLSTATE[42000]: Syntax error or access violation: 1072 Key column 'user_id' doesn't exist in table at /www/htdocs/w0125363/rechnung.xyz.de/vendor/doctrine/dbal/src/Driver/PDO/Exception.php:28)\n[previous exception] [object] (PDOException(code: 42000): SQLSTATE[42000]: Syntax error or access violation: 1072 Key column 'user_id' doesn't exist in table at /www/htdocs/w0125363/rechnung,xyz.de/vendor/doctrine/dbal/src/Driver/PDO/Connection.php:70)"} []
[2023-05-03T16:05:48.149810+02:00] php.INFO: User Deprecated: Since symfony/framework-bundle 5.1: The "session.flash_bag" service is deprecated, use "$session->getFlashBag()" instead. {"exception":"[object] (ErrorException(code: 0): User Deprecated: Since symfony/framework-bundle 5.1: The \"session.flash_bag\" service is deprecated, use \"$session->getFlashBag()\" instead. at /www/htdocs/w0125363/rechnung.xyz.de/var/cache/prod/ContainerUCndIue/SolidInvoice_KernelProdContainer.php:11460)"} []

Desktop (please complete the following information):

  • OS: MacOS
  • Browser vivaldi
  • Version 5.7.2921.68 (Stable channel) (arm64)

Additional context

@pierredup
Copy link
Member

Thanks for the report @LPTT. This has been fixed in #834 and will be included in the 2.2.4 release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants