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

PartKeepr to Part-DB migration in docker #334

Closed
myval opened this issue Jul 28, 2023 · 9 comments
Closed

PartKeepr to Part-DB migration in docker #334

myval opened this issue Jul 28, 2023 · 9 comments
Labels
enhancement New feature or request

Comments

@myval
Copy link

myval commented Jul 28, 2023

Hi all,
I would like to use Part-DB but I am too dumb to manage the migration process from PartKeepr.
I run PartKeepr in Docker (since that was the easiest to get running) I think I managed to install and setup Part-DB in docker too but I struggle to import my data.
Managed to export PartKeepr database.
Can not figure out where all the attachments and pictures are stored, I am using the mhubig/partkeepr version
I got stucked at item 3 in the Part-DB how to migrate (https://docs.part-db.de/partkeepr_migration.html)

can anyone write some simple migration in docker for dummies that would be highly appreciated.

thanks
Josef

@myval myval added the enhancement New feature or request label Jul 28, 2023
@jbtronics
Copy link
Member

basically you have to run the given command in your docker container. Should be possible with ´docker exec --user=www-data partdb php bin/console partdb:migrations:import-partkeepr path/to/pk.xml, where partdb` is the name of your docker container.

@myval
Copy link
Author

myval commented Aug 19, 2023

Thank you for your response, but I still struggle. When I run the command you suggested it spits out this:

! [NOTE] This command is still in development. If you encounter any problems,
!        please report them to the issue tracker on GitHub.

[WARNING] This command will delete all existing data in the database (except
          users). Make sure that you have no important data in the database
          before you continue!

Please type "DELETE ALL DATA" to continue. []:
> {"message":"Error thrown while running command \"partdb:migrations:import-partkeepr 'pk.xml'\". Message: \"You did not type \"DELETE ALL DATA\"!\"","context":{"exception":{"class":"RuntimeException","message":"You did not type \"DELETE ALL DATA\"!","code":0,"file":"/var/www/html/src/Command/Migrations/ImportPartKeeprCommand.php:73","trace":["/var/www/html/vendor/symfony/console/Helper/QuestionHelper.php:173","/var/www/html/vendor/symfony/console/Helper/QuestionHelper.php:77","/var/www/html/vendor/symfony/console/Style/SymfonyStyle.php:346","/var/www/html/vendor/symfony/console/Style/SymfonyStyle.php:257","/var/www/html/src/Command/Migrations/ImportPartKeeprCommand.php:76","/var/www/html/vendor/symfony/console/Command/Command.php:326","/var/www/html/vendor/symfony/console/Application.php:1081","/var/www/html/vendor/symfony/framework-bundle/Console/Application.php:91","/var/www/html/vendor/symfony/console/Application.php:320","/var/www/html/vendor/symfony/framework-bundle/Console/Application.php:80","/var/www/html/vendor/symfony/console/Application.php:174","/var/www/html/vendor/symfony/runtime/Runner/Symfony/ConsoleApplicationRunner.php:54","/var/www/html/vendor/autoload_runtime.php:29","/var/www/html/bin/console:11"]},"command":"partdb:migrations:import-partkeepr 'pk.xml'","message":"You did not type \"DELETE ALL DATA\"!"},"level":500,"level_name":"CRITICAL","channel":"console","datetime":"2023-08-19T11:07:35.651836+00:00","extra":{"token":null,"command":{"name":"partdb:migrations:import-partkeepr","arguments":{"command":"partdb:migrations:import-partkeepr","file":"pk.xml"}}}}
11:07:35 CRITICAL  [console] Error thrown while running command "partdb:migrations:import-partkeepr 'pk.xml'". Message: "You did not type "DELETE ALL DATA"!" ["exception" => RuntimeException { …},"command" => "partdb:migrations:import-partkeepr 'pk.xml'","message" => "You did not type "DELETE ALL DATA"!"] ["token" => null,"command" => ["name" => "partdb:migrations:import-partkeepr","arguments" => ["command" => "partdb:migrations:import-partkeepr","file" => "pk.xml"]]]
{"message":"Command \"partdb:migrations:import-partkeepr 'pk.xml'\" exited with code \"1\"","context":{"command":"partdb:migrations:import-partkeepr 'pk.xml'","code":1},"level":100,"level_name":"DEBUG","channel":"console","datetime":"2023-08-19T11:07:35.659309+00:00","extra":{"token":null,"command":{"name":"partdb:migrations:import-partkeepr","arguments":{"command":"partdb:migrations:import-partkeepr","file":"pk.xml"}}}}

In ImportPartKeeprCommand.php line 73:

 You did not type "DELETE ALL DATA"!

partdb:migrations:import-partkeepr [--no-projects] [--import-users] [--] <file>

it has something about typing DELETE ALL DATA but where and when do I type it?

@myval
Copy link
Author

myval commented Aug 19, 2023

I am thinking I am not understanding the Path/To/ pk.xml
the pk.xml is in this folder E:\PART-DB and I run the command from this folder

If I use this command: E:\PART-DB>docker exec -it partdb php bin/console partdb:migrations:import-partkeepr pk.xml

I get this message

! [NOTE] This command is still in development. If you encounter any problems, please report them to the issue tracker
 !        on GitHub.


 [WARNING] This command will delete all existing data in the database (except users). Make sure that you have no
           important data in the database before you continue!


 Please type "DELETE ALL DATA" to continue. []:
 > DELETE ALL DATA

16:37:17 WARNING   [php] Warning: file_get_contents(pk.xml): Failed to open stream: No such file or directory ["exception" => ErrorException { …}] ["token" => null,"command" => ["name" => "partdb:migrations:import-partkeepr","arguments" => ["command" => "partdb:migrations:import-partkeepr","file" => "pk.xml"]]]
{"message":"User Deprecated: Using XML mapping driver with XSD validation disabled is deprecated and will not be supported in Doctrine ORM 3.0. (XmlDriver.php:65 called by App_KernelDockerContainer.php:290, https://github.com/doctrine/orm/pull/6728, package doctrine/orm)","context":{"exception":{"class":"ErrorException","message":"User Deprecated: Using XML mapping driver with XSD validation disabled is deprecated and will not be supported in Doctrine ORM 3.0. (XmlDriver.php:65 called by App_KernelDockerContainer.php:290, https://github.com/doctrine/orm/pull/6728, package doctrine/orm)","code":0,"file":"/var/www/html/vendor/doctrine/deprecations/lib/Doctrine/Deprecations/Deprecation.php:209","trace":["/var/www/html/vendor/doctrine/deprecations/lib/Doctrine/Deprecations/Deprecation.php:107","/var/www/html/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Driver/XmlDriver.php:65","/var/www/html/var/cache/docker/ContainerExkoa7x/App_KernelDockerContainer.php:290","/var/www/html/var/cache/docker/ContainerExkoa7x/App_KernelDockerContainer.php:283","/var/www/html/vendor/symfony/var-exporter/Internal/LazyObjectState.php:97","/var/www/html/vendor/symfony/var-exporter/LazyGhostTrait.php:176","/var/www/html/vendor/doctrine/orm/lib/Doctrine/ORM/EntityManager.php:207","/var/www/html/src/Doctrine/Purger/ResetAutoIncrementORMPurger.php:116","/var/www/html/src/Services/ImportExportSystem/PartKeeprImporter/PKImportHelper.php:46","/var/www/html/src/Command/Migrations/ImportPartKeeprCommand.php:82","/var/www/html/vendor/symfony/console/Command/Command.php:326","/var/www/html/vendor/symfony/console/Application.php:1081","/var/www/html/vendor/symfony/framework-bundle/Console/Application.php:91","/var/www/html/vendor/symfony/console/Application.php:320","/var/www/html/vendor/symfony/framework-bundle/Console/Application.php:80","/var/www/html/vendor/symfony/console/Application.php:174","/var/www/html/vendor/symfony/runtime/Runner/Symfony/ConsoleApplicationRunner.php:54","/var/www/html/vendor/autoload_runtime.php:29","/var/www/html/bin/console:11"]}},"level":200,"level_name":"INFO","channel":"deprecation","datetime":"2023-08-19T16:37:15.214868+00:00","extra":{"token":null,"command":{"name":"partdb:migrations:import-partkeepr","arguments":{"command":"partdb:migrations:import-partkeepr","file":"pk.xml"}}}}
{"message":"User Deprecated: Since symfony/doctrine-bridge 6.3: Using Doctrine subscribers as services is deprecated, declare listeners instead","context":{"exception":{"class":"ErrorException","message":"User Deprecated: Since symfony/doctrine-bridge 6.3: Using Doctrine subscribers as services is deprecated, declare listeners instead","code":0,"file":"/var/www/html/vendor/symfony/doctrine-bridge/ContainerAwareEventManager.php:192","trace":["/var/www/html/vendor/symfony/doctrine-bridge/ContainerAwareEventManager.php:101","/var/www/html/vendor/doctrine/dbal/src/Connection.php:384","/var/www/html/vendor/doctrine/dbal/src/Connection.php:450","/var/www/html/vendor/doctrine/dbal/src/Connection.php:408","/var/www/html/vendor/doctrine/dbal/src/Connection.php:316","/var/www/html/src/Doctrine/Purger/ResetAutoIncrementORMPurger.php:127","/var/www/html/src/Services/ImportExportSystem/PartKeeprImporter/PKImportHelper.php:46","/var/www/html/src/Command/Migrations/ImportPartKeeprCommand.php:82","/var/www/html/vendor/symfony/console/Command/Command.php:326","/var/www/html/vendor/symfony/console/Application.php:1081","/var/www/html/vendor/symfony/framework-bundle/Console/Application.php:91","/var/www/html/vendor/symfony/console/Application.php:320","/var/www/html/vendor/symfony/framework-bundle/Console/Application.php:80","/var/www/html/vendor/symfony/console/Application.php:174","/var/www/html/vendor/symfony/runtime/Runner/Symfony/ConsoleApplicationRunner.php:54","/var/www/html/vendor/autoload_runtime.php:29","/var/www/html/bin/console:11"]}},"level":200,"level_name":"INFO","channel":"deprecation","datetime":"2023-08-19T16:37:15.277701+00:00","extra":{"token":null,"command":{"name":"partdb:migrations:import-partkeepr","arguments":{"command":"partdb:migrations:import-partkeepr","file":"pk.xml"}}}}
{"message":"User Deprecated: Since symfony/doctrine-bridge 6.3: Using Doctrine subscribers as services is deprecated, declare listeners instead","context":{"exception":{"class":"ErrorException","message":"User Deprecated: Since symfony/doctrine-bridge 6.3: Using Doctrine subscribers as services is deprecated, declare listeners instead","code":0,"file":"/var/www/html/vendor/symfony/doctrine-bridge/ContainerAwareEventManager.php:192","trace":["/var/www/html/vendor/symfony/doctrine-bridge/ContainerAwareEventManager.php:101","/var/www/html/vendor/doctrine/dbal/src/Connection.php:384","/var/www/html/vendor/doctrine/dbal/src/Connection.php:450","/var/www/html/vendor/doctrine/dbal/src/Connection.php:408","/var/www/html/vendor/doctrine/dbal/src/Connection.php:316","/var/www/html/src/Doctrine/Purger/ResetAutoIncrementORMPurger.php:127","/var/www/html/src/Services/ImportExportSystem/PartKeeprImporter/PKImportHelper.php:46","/var/www/html/src/Command/Migrations/ImportPartKeeprCommand.php:82","/var/www/html/vendor/symfony/console/Command/Command.php:326","/var/www/html/vendor/symfony/console/Application.php:1081","/var/www/html/vendor/symfony/framework-bundle/Console/Application.php:91","/var/www/html/vendor/symfony/console/Application.php:320","/var/www/html/vendor/symfony/framework-bundle/Console/Application.php:80","/var/www/html/vendor/symfony/console/Application.php:174","/var/www/html/vendor/symfony/runtime/Runner/Symfony/ConsoleApplicationRunner.php:54","/var/www/html/vendor/autoload_runtime.php:29","/var/www/html/bin/console:11"]}},"level":200,"level_name":"INFO","channel":"deprecation","datetime":"2023-08-19T16:37:15.279297+00:00","extra":{"token":null,"command":{"name":"partdb:migrations:import-partkeepr","arguments":{"command":"partdb:migrations:import-partkeepr","file":"pk.xml"}}}}
{"message":"User Deprecated: Subscribing to postConnect events is deprecated. Implement a middleware instead. (Connection.php:389 called by Connection.php:450, https://github.com/doctrine/dbal/issues/5784, package doctrine/dbal)","context":{"exception":{"class":"ErrorException","message":"User Deprecated: Subscribing to postConnect events is deprecated. Implement a middleware instead. (Connection.php:389 called by Connection.php:450, https://github.com/doctrine/dbal/issues/5784, package doctrine/dbal)","code":0,"file":"/var/www/html/vendor/doctrine/deprecations/lib/Doctrine/Deprecations/Deprecation.php:209","trace":["/var/www/html/vendor/doctrine/deprecations/lib/Doctrine/Deprecations/Deprecation.php:107","/var/www/html/vendor/doctrine/dbal/src/Connection.php:389","/var/www/html/vendor/doctrine/dbal/src/Connection.php:450","/var/www/html/vendor/doctrine/dbal/src/Connection.php:408","/var/www/html/vendor/doctrine/dbal/src/Connection.php:316","/var/www/html/src/Doctrine/Purger/ResetAutoIncrementORMPurger.php:127","/var/www/html/src/Services/ImportExportSystem/PartKeeprImporter/PKImportHelper.php:46","/var/www/html/src/Command/Migrations/ImportPartKeeprCommand.php:82","/var/www/html/vendor/symfony/console/Command/Command.php:326","/var/www/html/vendor/symfony/console/Application.php:1081","/var/www/html/vendor/symfony/framework-bundle/Console/Application.php:91","/var/www/html/vendor/symfony/console/Application.php:320","/var/www/html/vendor/symfony/framework-bundle/Console/Application.php:80","/var/www/html/vendor/symfony/console/Application.php:174","/var/www/html/vendor/symfony/runtime/Runner/Symfony/ConsoleApplicationRunner.php:54","/var/www/html/vendor/autoload_runtime.php:29","/var/www/html/bin/console:11"]}},"level":200,"level_name":"INFO","channel":"deprecation","datetime":"2023-08-19T16:37:15.279404+00:00","extra":{"token":null,"command":{"name":"partdb:migrations:import-partkeepr","arguments":{"command":"partdb:migrations:import-partkeepr","file":"pk.xml"}}}}
{"message":"Warning: file_get_contents(pk.xml): Failed to open stream: No such file or directory","context":{"exception":{"class":"ErrorException","message":"Warning: file_get_contents(pk.xml): Failed to open stream: No such file or directory","code":0,"file":"/var/www/html/src/Command/Migrations/ImportPartKeeprCommand.php:85","trace":["/var/www/html/vendor/symfony/console/Command/Command.php:326","/var/www/html/vendor/symfony/console/Application.php:1081","/var/www/html/vendor/symfony/framework-bundle/Console/Application.php:91","/var/www/html/vendor/symfony/console/Application.php:320","/var/www/html/vendor/symfony/framework-bundle/Console/Application.php:80","/var/www/html/vendor/symfony/console/Application.php:174","/var/www/html/vendor/symfony/runtime/Runner/Symfony/ConsoleApplicationRunner.php:54","/var/www/html/vendor/autoload_runtime.php:29","/var/www/html/bin/console:11"]}},"level":300,"level_name":"WARNING","channel":"php","datetime":"2023-08-19T16:37:17.919637+00:00","extra":{"token":null,"command":{"name":"partdb:migrations:import-partkeepr","arguments":{"command":"partdb:migrations:import-partkeepr","file":"pk.xml"}}}}
{"message":"Error thrown while running command \"partdb:migrations:import-partkeepr 'pk.xml'\". Message: \"App\\Services\\ImportExportSystem\\PartKeeprImporter\\MySQLDumpXMLConverter::convertMySQLDumpXMLDataToArrayStructure(): Argument #1 ($xml_string) must be of type string, bool given, called in /var/www/html/src/Command/Migrations/ImportPartKeeprCommand.php on line 86\"","context":{"exception":{"class":"TypeError","message":"App\\Services\\ImportExportSystem\\PartKeeprImporter\\MySQLDumpXMLConverter::convertMySQLDumpXMLDataToArrayStructure(): Argument #1 ($xml_string) must be of type string, bool given, called in /var/www/html/src/Command/Migrations/ImportPartKeeprCommand.php on line 86","code":0,"file":"/var/www/html/src/Services/ImportExportSystem/PartKeeprImporter/MySQLDumpXMLConverter.php:48","trace":["/var/www/html/src/Command/Migrations/ImportPartKeeprCommand.php:86","/var/www/html/vendor/symfony/console/Command/Command.php:326","/var/www/html/vendor/symfony/console/Application.php:1081","/var/www/html/vendor/symfony/framework-bundle/Console/Application.php:91","/var/www/html/vendor/symfony/console/Application.php:320","/var/www/html/vendor/symfony/framework-bundle/Console/Application.php:80","/var/www/html/vendor/symfony/console/Application.php:174","/var/www/html/vendor/symfony/runtime/Runner/Symfony/ConsoleApplicationRunner.php:54","/var/www/html/vendor/autoload_runtime.php:29","/var/www/html/bin/console:11"]},"command":"partdb:migrations:import-partkeepr 'pk.xml'","message":"App\\Services\\ImportExportSystem\\PartKeeprImporter\\MySQLDumpXMLConverter::convertMySQLDumpXMLDataToArrayStructure(): Argument #1 ($xml_string) must be of type string, bool given, called in /var/www/html/src/Command/Migrations/ImportPartKeeprCommand.php on line 86"},"level":500,"level_name":"CRITICAL","channel":"console","datetime":"2023-08-19T16:37:17.923879+00:00","extra":{"token":null,"command":{"name":"partdb:migrations:import-partkeepr","arguments":{"command":"partdb:migrations:import-partkeepr","file":"pk.xml"}}}}
16:37:17 CRITICAL  [console] Error thrown while running command "partdb:migrations:import-partkeepr 'pk.xml'". Message: "App\Services\ImportExportSystem\PartKeeprImporter\MySQLDumpXMLConverter::convertMySQLDumpXMLDataToArrayStructure(): Argument #1 ($xml_string) must be of type string, bool given, called in /var/www/html/src/Command/Migrations/ImportPartKeeprCommand.php on line 86" ["exception" => TypeError { …},"command" => "partdb:migrations:import-partkeepr 'pk.xml'","message" => "App\Services\ImportExportSystem\PartKeeprImporter\MySQLDumpXMLConverter::convertMySQLDumpXMLDataToArrayStructure(): Argument #1 ($xml_string) must be of type string, bool given, called in /var/www/html/src/Command/Migrations/ImportPartKeeprCommand.php on line 86"] ["token" => null,"command" => ["name" => "partdb:migrations:import-partkeepr","arguments" => ["command" => "partdb:migrations:import-partkeepr","file" => "pk.xml"]]]
{"message":"Command \"partdb:migrations:import-partkeepr 'pk.xml'\" exited with code \"1\"","context":{"command":"partdb:migrations:import-partkeepr 'pk.xml'","code":1},"level":100,"level_name":"DEBUG","channel":"console","datetime":"2023-08-19T16:37:17.927831+00:00","extra":{"token":null,"command":{"name":"partdb:migrations:import-partkeepr","arguments":{"command":"partdb:migrations:import-partkeepr","file":"pk.xml"}}}}
{"message":"Uncaught Error: App\\Services\\ImportExportSystem\\PartKeeprImporter\\MySQLDumpXMLConverter::convertMySQLDumpXMLDataToArrayStructure(): Argument #1 ($xml_string) must be of type string, bool given, called in /var/www/html/src/Command/Migrations/ImportPartKeeprCommand.php on line 86","context":{"exception":{"class":"TypeError","message":"App\\Services\\ImportExportSystem\\PartKeeprImporter\\MySQLDumpXMLConverter::convertMySQLDumpXMLDataToArrayStructure(): Argument #1 ($xml_string) must be of type string, bool given, called in /var/www/html/src/Command/Migrations/ImportPartKeeprCommand.php on line 86","code":0,"file":"/var/www/html/src/Services/ImportExportSystem/PartKeeprImporter/MySQLDumpXMLConverter.php:48","trace":["/var/www/html/src/Command/Migrations/ImportPartKeeprCommand.php:86","/var/www/html/vendor/symfony/console/Command/Command.php:326","/var/www/html/vendor/symfony/console/Application.php:1081","/var/www/html/vendor/symfony/framework-bundle/Console/Application.php:91","/var/www/html/vendor/symfony/console/Application.php:320","/var/www/html/vendor/symfony/framework-bundle/Console/Application.php:80","/var/www/html/vendor/symfony/console/Application.php:174","/var/www/html/vendor/symfony/runtime/Runner/Symfony/ConsoleApplicationRunner.php:54","/var/www/html/vendor/autoload_runtime.php:29","/var/www/html/bin/console:11"]}},"level":500,"level_name":"CRITICAL","channel":"php","datetime":"2023-08-19T16:37:17.927999+00:00","extra":{"token":null,"command":{"name":"partdb:migrations:import-partkeepr","arguments":{"command":"partdb:migrations:import-partkeepr","file":"pk.xml"}}}}

In MySQLDumpXMLConverter.php line 48:

  App\Services\ImportExportSystem\PartKeeprImporter\MySQLDumpXMLConverter::convertMySQLDumpXMLDataToArrayStructure(): Argument #1 ($xml_string) must be of type string, bool given, called in /var/www/html/src/Command/Migrations/Import
  PartKeeprCommand.php on line 86


partdb:migrations:import-partkeepr [--no-projects] [--import-users] [--] <file>

@jbtronics
Copy link
Member

Put the pk.xml into the uploads folder mapped into the docker container (in the default docker-compose.yaml this should be the upload folder in the directory where the docker-compose.yaml lives). Then you can execute docker exec -it partdb php bin/console partdb:migrations:import-partkeepr /var/www/html/uploads/pk.xml

@myval
Copy link
Author

myval commented Aug 19, 2023

yeah thanks it is getting better but still getting some errors and there are no components imported at all:

[INFO] Importing distributors...



 [OK] Imported 2 distributors.



 [INFO] Importing part measurement units...



 [OK] Imported 1 measurement units.



 [INFO] Importing manufacturers...



 [OK] Imported 285 manufacturers.



 [INFO] Importing categories...



 [OK] Imported 156 categories.



 [INFO] Importing Footprints...



 [OK] Imported 189 footprints.



 [INFO] Importing storage locations...


17:43:51 WARNING   [php] Warning: Undefined array key "footprint_id" ["exception" => ErrorException { …}] ["token" => null,"command" => ["name" => "partdb:migrations:import-partkeepr","arguments" => ["command" => "partdb:migrations:import-partkeepr","file" => "/var/www/html/uploads/pk.xml"]]]
{"message":"User Deprecated: Using XML mapping driver with XSD validation disabled is deprecated and will not be supported in Doctrine ORM 3.0. (XmlDriver.php:65 called by App_KernelDockerContainer.php:290, https://github.com/doctrine/orm/pull/6728, package doctrine/orm)","context":{"exception":{"class":"ErrorException","message":"User Deprecated: Using XML mapping driver with XSD validation disabled is deprecated and will not be supported in Doctrine ORM 3.0. (XmlDriver.php:65 called by App_KernelDockerContainer.php:290, https://github.com/doctrine/orm/pull/6728, package doctrine/orm)","code":0,"file":"/var/www/html/vendor/doctrine/deprecations/lib/Doctrine/Deprecations/Deprecation.php:209","trace":["/var/www/html/vendor/doctrine/deprecations/lib/Doctrine/Deprecations/Deprecation.php:107","/var/www/html/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Driver/XmlDriver.php:65","/var/www/html/var/cache/docker/ContainerExkoa7x/App_KernelDockerContainer.php:290","/var/www/html/var/cache/docker/ContainerExkoa7x/App_KernelDockerContainer.php:283","/var/www/html/vendor/symfony/var-exporter/Internal/LazyObjectState.php:97","/var/www/html/vendor/symfony/var-exporter/LazyGhostTrait.php:176","/var/www/html/vendor/doctrine/orm/lib/Doctrine/ORM/EntityManager.php:207","/var/www/html/src/Doctrine/Purger/ResetAutoIncrementORMPurger.php:116","/var/www/html/src/Services/ImportExportSystem/PartKeeprImporter/PKImportHelper.php:46","/var/www/html/src/Command/Migrations/ImportPartKeeprCommand.php:82","/var/www/html/vendor/symfony/console/Command/Command.php:326","/var/www/html/vendor/symfony/console/Application.php:1081","/var/www/html/vendor/symfony/framework-bundle/Console/Application.php:91","/var/www/html/vendor/symfony/console/Application.php:320","/var/www/html/vendor/symfony/framework-bundle/Console/Application.php:80","/var/www/html/vendor/symfony/console/Application.php:174","/var/www/html/vendor/symfony/runtime/Runner/Symfony/ConsoleApplicationRunner.php:54","/var/www/html/vendor/autoload_runtime.php:29","/var/www/html/bin/console:11"]}},"level":200,"level_name":"INFO","channel":"deprecation","datetime":"2023-08-19T17:43:44.165939+00:00","extra":{"token":null,"command":{"name":"partdb:migrations:import-partkeepr","arguments":{"command":"partdb:migrations:import-partkeepr","file":"/var/www/html/uploads/pk.xml"}}}}
{"message":"User Deprecated: Since symfony/doctrine-bridge 6.3: Using Doctrine subscribers as services is deprecated, declare listeners instead","context":{"exception":{"class":"ErrorException","message":"User Deprecated: Since symfony/doctrine-bridge 6.3: Using Doctrine subscribers as services is deprecated, declare listeners instead","code":0,"file":"/var/www/html/vendor/symfony/doctrine-bridge/ContainerAwareEventManager.php:192","trace":["/var/www/html/vendor/symfony/doctrine-bridge/ContainerAwareEventManager.php:101","/var/www/html/vendor/doctrine/dbal/src/Connection.php:384","/var/www/html/vendor/doctrine/dbal/src/Connection.php:450","/var/www/html/vendor/doctrine/dbal/src/Connection.php:408","/var/www/html/vendor/doctrine/dbal/src/Connection.php:316","/var/www/html/src/Doctrine/Purger/ResetAutoIncrementORMPurger.php:127","/var/www/html/src/Services/ImportExportSystem/PartKeeprImporter/PKImportHelper.php:46","/var/www/html/src/Command/Migrations/ImportPartKeeprCommand.php:82","/var/www/html/vendor/symfony/console/Command/Command.php:326","/var/www/html/vendor/symfony/console/Application.php:1081","/var/www/html/vendor/symfony/framework-bundle/Console/Application.php:91","/var/www/html/vendor/symfony/console/Application.php:320","/var/www/html/vendor/symfony/framework-bundle/Console/Application.php:80","/var/www/html/vendor/symfony/console/Application.php:174","/var/www/html/vendor/symfony/runtime/Runner/Symfony/ConsoleApplicationRunner.php:54","/var/www/html/vendor/autoload_runtime.php:29","/var/www/html/bin/console:11"]}},"level":200,"level_name":"INFO","channel":"deprecation","datetime":"2023-08-19T17:43:44.228252+00:00","extra":{"token":null,"command":{"name":"partdb:migrations:import-partkeepr","arguments":{"command":"partdb:migrations:import-partkeepr","file":"/var/www/html/uploads/pk.xml"}}}}
{"message":"User Deprecated: Since symfony/doctrine-bridge 6.3: Using Doctrine subscribers as services is deprecated, declare listeners instead","context":{"exception":{"class":"ErrorException","message":"User Deprecated: Since symfony/doctrine-bridge 6.3: Using Doctrine subscribers as services is deprecated, declare listeners instead","code":0,"file":"/var/www/html/vendor/symfony/doctrine-bridge/ContainerAwareEventManager.php:192","trace":["/var/www/html/vendor/symfony/doctrine-bridge/ContainerAwareEventManager.php:101","/var/www/html/vendor/doctrine/dbal/src/Connection.php:384","/var/www/html/vendor/doctrine/dbal/src/Connection.php:450","/var/www/html/vendor/doctrine/dbal/src/Connection.php:408","/var/www/html/vendor/doctrine/dbal/src/Connection.php:316","/var/www/html/src/Doctrine/Purger/ResetAutoIncrementORMPurger.php:127","/var/www/html/src/Services/ImportExportSystem/PartKeeprImporter/PKImportHelper.php:46","/var/www/html/src/Command/Migrations/ImportPartKeeprCommand.php:82","/var/www/html/vendor/symfony/console/Command/Command.php:326","/var/www/html/vendor/symfony/console/Application.php:1081","/var/www/html/vendor/symfony/framework-bundle/Console/Application.php:91","/var/www/html/vendor/symfony/console/Application.php:320","/var/www/html/vendor/symfony/framework-bundle/Console/Application.php:80","/var/www/html/vendor/symfony/console/Application.php:174","/var/www/html/vendor/symfony/runtime/Runner/Symfony/ConsoleApplicationRunner.php:54","/var/www/html/vendor/autoload_runtime.php:29","/var/www/html/bin/console:11"]}},"level":200,"level_name":"INFO","channel":"deprecation","datetime":"2023-08-19T17:43:44.229700+00:00","extra":{"token":null,"command":{"name":"partdb:migrations:import-partkeepr","arguments":{"command":"partdb:migrations:import-partkeepr","file":"/var/www/html/uploads/pk.xml"}}}}
{"message":"User Deprecated: Subscribing to postConnect events is deprecated. Implement a middleware instead. (Connection.php:389 called by Connection.php:450, https://github.com/doctrine/dbal/issues/5784, package doctrine/dbal)","context":{"exception":{"class":"ErrorException","message":"User Deprecated: Subscribing to postConnect events is deprecated. Implement a middleware instead. (Connection.php:389 called by Connection.php:450, https://github.com/doctrine/dbal/issues/5784, package doctrine/dbal)","code":0,"file":"/var/www/html/vendor/doctrine/deprecations/lib/Doctrine/Deprecations/Deprecation.php:209","trace":["/var/www/html/vendor/doctrine/deprecations/lib/Doctrine/Deprecations/Deprecation.php:107","/var/www/html/vendor/doctrine/dbal/src/Connection.php:389","/var/www/html/vendor/doctrine/dbal/src/Connection.php:450","/var/www/html/vendor/doctrine/dbal/src/Connection.php:408","/var/www/html/vendor/doctrine/dbal/src/Connection.php:316","/var/www/html/src/Doctrine/Purger/ResetAutoIncrementORMPurger.php:127","/var/www/html/src/Services/ImportExportSystem/PartKeeprImporter/PKImportHelper.php:46","/var/www/html/src/Command/Migrations/ImportPartKeeprCommand.php:82","/var/www/html/vendor/symfony/console/Command/Command.php:326","/var/www/html/vendor/symfony/console/Application.php:1081","/var/www/html/vendor/symfony/framework-bundle/Console/Application.php:91","/var/www/html/vendor/symfony/console/Application.php:320","/var/www/html/vendor/symfony/framework-bundle/Console/Application.php:80","/var/www/html/vendor/symfony/console/Application.php:174","/var/www/html/vendor/symfony/runtime/Runner/Symfony/ConsoleApplicationRunner.php:54","/var/www/html/vendor/autoload_runtime.php:29","/var/www/html/bin/console:11"]}},"level":200,"level_name":"INFO","channel":"deprecation","datetime":"2023-08-19T17:43:44.229810+00:00","extra":{"token":null,"command":{"name":"partdb:migrations:import-partkeepr","arguments":{"command":"partdb:migrations:import-partkeepr","file":"/var/www/html/uploads/pk.xml"}}}}
{"message":"User Deprecated: Method Doctrine\\ORM\\Event\\OnFlushEventArgs::getEntityManager() is deprecated and will be removed in Doctrine ORM 3.0. Use getObjectManager() instead. (OnFlushEventArgs.php:34 called by BroadcastListener.php:68, https://github.com/doctrine/orm/issues/9875, package doctrine/orm)","context":{"exception":{"class":"ErrorException","message":"User Deprecated: Method Doctrine\\ORM\\Event\\OnFlushEventArgs::getEntityManager() is deprecated and will be removed in Doctrine ORM 3.0. Use getObjectManager() instead. (OnFlushEventArgs.php:34 called by BroadcastListener.php:68, https://github.com/doctrine/orm/issues/9875, package doctrine/orm)","code":0,"file":"/var/www/html/vendor/doctrine/deprecations/lib/Doctrine/Deprecations/Deprecation.php:209","trace":["/var/www/html/vendor/doctrine/deprecations/lib/Doctrine/Deprecations/Deprecation.php:107","/var/www/html/vendor/doctrine/orm/lib/Doctrine/ORM/Event/OnFlushEventArgs.php:34","/var/www/html/vendor/symfony/ux-turbo/src/Doctrine/BroadcastListener.php:68","/var/www/html/vendor/symfony/doctrine-bridge/ContainerAwareEventManager.php:62","/var/www/html/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php:3573","/var/www/html/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php:420","/var/www/html/vendor/doctrine/orm/lib/Doctrine/ORM/EntityManager.php:403","/var/www/html/src/Services/ImportExportSystem/PartKeeprImporter/PKDatastructureImporter.php:90","/var/www/html/src/Command/Migrations/ImportPartKeeprCommand.php:116","/var/www/html/src/Command/Migrations/ImportPartKeeprCommand.php:95","/var/www/html/vendor/symfony/console/Command/Command.php:326","/var/www/html/vendor/symfony/console/Application.php:1081","/var/www/html/vendor/symfony/framework-bundle/Console/Application.php:91","/var/www/html/vendor/symfony/console/Application.php:320","/var/www/html/vendor/symfony/framework-bundle/Console/Application.php:80","/var/www/html/vendor/symfony/console/Application.php:174","/var/www/html/vendor/symfony/runtime/Runner/Symfony/ConsoleApplicationRunner.php:54","/var/www/html/vendor/autoload_runtime.php:29","/var/www/html/bin/console:11"]}},"level":200,"level_name":"INFO","channel":"deprecation","datetime":"2023-08-19T17:43:47.228155+00:00","extra":{"token":null,"command":{"name":"partdb:migrations:import-partkeepr","arguments":{"command":"partdb:migrations:import-partkeepr","file":"/var/www/html/uploads/pk.xml"}}}}
{"message":"User Deprecated: Accessing Doctrine\\Common\\Lexer\\Token properties via ArrayAccess is deprecated, use the value, type or position property instead (Token.php:108 called by DocParser.php:691, https://github.com/doctrine/lexer/pull/79, package doctrine/lexer)","context":{"exception":{"class":"ErrorException","message":"User Deprecated: Accessing Doctrine\\Common\\Lexer\\Token properties via ArrayAccess is deprecated, use the value, type or position property instead (Token.php:108 called by DocParser.php:691, https://github.com/doctrine/lexer/pull/79, package doctrine/lexer)","code":0,"file":"/var/www/html/vendor/doctrine/deprecations/lib/Doctrine/Deprecations/Deprecation.php:209","trace":["/var/www/html/vendor/doctrine/deprecations/lib/Doctrine/Deprecations/Deprecation.php:107","/var/www/html/vendor/doctrine/lexer/src/Token.php:108","/var/www/html/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/DocParser.php:691","/var/www/html/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/DocParser.php:377","/var/www/html/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationReader.php:366","/var/www/html/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationReader.php:301","/var/www/html/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationReader.php:142","/var/www/html/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/PsrCachedReader.php:155","/var/www/html/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/PsrCachedReader.php:57","/var/www/html/vendor/symfony/ux-turbo/src/Doctrine/BroadcastListener.php:139","/var/www/html/vendor/symfony/ux-turbo/src/Doctrine/BroadcastListener.php:71","/var/www/html/vendor/symfony/doctrine-bridge/ContainerAwareEventManager.php:62","/var/www/html/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php:3573","/var/www/html/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php:420","/var/www/html/vendor/doctrine/orm/lib/Doctrine/ORM/EntityManager.php:403","/var/www/html/src/Services/ImportExportSystem/PartKeeprImporter/PKDatastructureImporter.php:90","/var/www/html/src/Command/Migrations/ImportPartKeeprCommand.php:116","/var/www/html/src/Command/Migrations/ImportPartKeeprCommand.php:95","/var/www/html/vendor/symfony/console/Command/Command.php:326","/var/www/html/vendor/symfony/console/Application.php:1081","/var/www/html/vendor/symfony/framework-bundle/Console/Application.php:91","/var/www/html/vendor/symfony/console/Application.php:320","/var/www/html/vendor/symfony/framework-bundle/Console/Application.php:80","/var/www/html/vendor/symfony/console/Application.php:174","/var/www/html/vendor/symfony/runtime/Runner/Symfony/ConsoleApplicationRunner.php:54","/var/www/html/vendor/autoload_runtime.php:29","/var/www/html/bin/console:11"]}},"level":200,"level_name":"INFO","channel":"deprecation","datetime":"2023-08-19T17:43:47.228986+00:00","extra":{"token":null,"command":{"name":"partdb:migrations:import-partkeepr","arguments":{"command":"partdb:migrations:import-partkeepr","file":"/var/www/html/uploads/pk.xml"}}}}
{"message":"Warning: Undefined array key \"footprint_id\"","context":{"exception":{"class":"ErrorException","message":"Warning: Undefined array key \"footprint_id\"","code":0,"file":"/var/www/html/src/Services/ImportExportSystem/PartKeeprImporter/PKImportHelperTrait.php:144","trace":["/var/www/html/src/Services/ImportExportSystem/PartKeeprImporter/PKDatastructureImporter.php:269","/var/www/html/src/Command/Migrations/ImportPartKeeprCommand.php:138","/var/www/html/src/Command/Migrations/ImportPartKeeprCommand.php:95","/var/www/html/vendor/symfony/console/Command/Command.php:326","/var/www/html/vendor/symfony/console/Application.php:1081","/var/www/html/vendor/symfony/framework-bundle/Console/Application.php:91","/var/www/html/vendor/symfony/console/Application.php:320","/var/www/html/vendor/symfony/framework-bundle/Console/Application.php:80","/var/www/html/vendor/symfony/console/Application.php:174","/var/www/html/vendor/symfony/runtime/Runner/Symfony/ConsoleApplicationRunner.php:54","/var/www/html/vendor/autoload_runtime.php:29","/var/www/html/bin/console:11"]}},"level":300,"level_name":"WARNING","channel":"php","datetime":"2023-08-19T17:43:51.808794+00:00","extra":{"token":null,"command":{"name":"partdb:migrations:import-partkeepr","arguments":{"command":"partdb:migrations:import-partkeepr","file":"/var/www/html/uploads/pk.xml"}}}}
{"message":"Error thrown while running command \"partdb:migrations:import-partkeepr '/var/www/html/uploads/pk.xml'\". Message: \"Could not find target entity with ID 0\"","context":{"exception":{"class":"RuntimeException","message":"Could not find target entity with ID 0","code":0,"file":"/var/www/html/src/Services/ImportExportSystem/PartKeeprImporter/PKImportHelperTrait.php:148","trace":["/var/www/html/src/Services/ImportExportSystem/PartKeeprImporter/PKDatastructureImporter.php:269","/var/www/html/src/Command/Migrations/ImportPartKeeprCommand.php:138","/var/www/html/src/Command/Migrations/ImportPartKeeprCommand.php:95","/var/www/html/vendor/symfony/console/Command/Command.php:326","/var/www/html/vendor/symfony/console/Application.php:1081","/var/www/html/vendor/symfony/framework-bundle/Console/Application.php:91","/var/www/html/vendor/symfony/console/Application.php:320","/var/www/html/vendor/symfony/framework-bundle/Console/Application.php:80","/var/www/html/vendor/symfony/console/Application.php:174","/var/www/html/vendor/symfony/runtime/Runner/Symfony/ConsoleApplicationRunner.php:54","/var/www/html/vendor/autoload_runtime.php:29","/var/www/html/bin/console:11"]},"command":"partdb:migrations:import-partkeepr '/var/www/html/uploads/pk.xml'","message":"Could not find target entity with ID 0"},"level":500,"level_name":"CRITICAL","channel":"console","datetime":"2023-08-19T17:43:51.816063+00:00","extra":{"token":null,"command":{"name":"partdb:migrations:import-partkeepr","arguments":{"command":"partdb:migrations:import-partkeepr","file":"/var/www/html/uploads/pk.xml"}}}}
17:43:51 CRITICAL  [console] Error thrown while running command "partdb:migrations:import-partkeepr '/var/www/html/uploads/pk.xml'". Message: "Could not find target entity with ID 0" ["exception" => RuntimeException { …},"command" => "partdb:migrations:import-partkeepr '/var/www/html/uploads/pk.xml'","message" => "Could not find target entity with ID 0"] ["token" => null,"command" => ["name" => "partdb:migrations:import-partkeepr","arguments" => ["command" => "partdb:migrations:import-partkeepr","file" => "/var/www/html/uploads/pk.xml"]]]
{"message":"Command \"partdb:migrations:import-partkeepr '/var/www/html/uploads/pk.xml'\" exited with code \"1\"","context":{"command":"partdb:migrations:import-partkeepr '/var/www/html/uploads/pk.xml'","code":1},"level":100,"level_name":"DEBUG","channel":"console","datetime":"2023-08-19T17:43:51.820965+00:00","extra":{"token":null,"command":{"name":"partdb:migrations:import-partkeepr","arguments":{"command":"partdb:migrations:import-partkeepr","file":"/var/www/html/uploads/pk.xml"}}}}

In PKImportHelperTrait.php line 148:

  Could not find target entity with ID 0

@jbtronics
Copy link
Member

To debug that I will most likely need your pk.xml file.

You can censor sensitive information in it.

@myval
Copy link
Author

myval commented Aug 19, 2023

I don't think there is anything sensitive in it.
here it is:

pk.zip

jbtronics added a commit that referenced this issue Aug 19, 2023
@jbtronics
Copy link
Member

The import issue was related to the attachments of the storage locations. This is nox fixed.

The fix will be included in the next release (most likely 1.7.0). For now you can use the docker image tagged with the edge tag. (so replace the image: jbtronics/part-db1:latest with image: jbtronics/part-db1:edge and run a docker-compose pull and docker-compose up afterwards).

@myval
Copy link
Author

myval commented Aug 20, 2023

Yes this works like a charm, thanks.

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

No branches or pull requests

2 participants