Coreshop! Migration failed during Execution

Hi,

I have now tried for 2 days getting Coreshop installed on top of Pimcore.

Latest Pimcore I did was the skeleton edition. But still getting the same error. I can´t figure out what it is. And if I try to do another installation, I cant reproduce because of a dublicate error on database.

The error looks like this:

Migration 20180904201947 failed during Execution. Error The column ‘place’ on table ‘element_workflow_state’ already exists.

In SchemaException.php line 119:

The column ‘place’ on table ‘element_workflow_state’ already exists.

pimcore:migrations:migrate [–write-sql [WRITE-SQL]] [–dry-run] [–query-time] [–allow-no-migration] [–configuration [CONFIGURATION]] [–db-configuration [DB-CONFIGURATION]] [–db DB] [–em EM] [–shard SHARD] [-b|–bundle BUNDLE] [-s|–set SET] [-h|–help] [-q|–quiet] [-v|vv|vvv|–verbose] [-V|–version] [–ansi] [–no-ansi] [-n|–no-interaction] [–ignore-maintenance-mode] [–maintenance-mode] [-e|–env ENV] [–no-debug] [–] []

Script Pimcore\Composer::executeMigrationsUp handling the post-update-cmd event terminated with an exception

Installation failed, reverting ./composer.json to its original content.

[RuntimeException]
An error occurred when executing the ““pimcore:migrations:migrate -s pimcore_core -n”” command:

                  Pimcore Core Migrations                                   

Migrating up to 20190508074339 from 20190508074339

++ migrating 20180724144005                                                 
                                                                            
   -> Initial Migration                                                     
                                                                            
++ migrated (0.01s)                                                         
                                                                            
++ migrating 20180830113528                                                 
                                                                            
                                                                            
++ migrated (0.7s)                                                          
                                                                            
++ migrating 20180830122128                                                 
                                                                            
                                                                            
++ migrated (0s)                                                            
                                                                            
++ migrating 20180904201947                                                 
                                                                            
   -> Changing Database schema for new workflows. Please see upgrade notes for migration of data!

Migration 20180904201947 failed during Execution. Error The column ‘place’ on table ‘element_workflow_state’ alread
y exists.

In SchemaException.php line 119:

The column 'place' on table 'element_workflow_state' already exists.        

pimcore:migrations:migrate [–write-sql [WRITE-SQL]] [–dry-run] [–query-time] [–allow-no-migration] [–configura
tion [CONFIGURATION]] [–db-configuration [DB-CONFIGURATION]] [–db DB] [–em EM] [–shard SHARD] [-b|–bundle BUND
LE] [-s|–set SET] [-h|–help] [-q|–quiet] [-v|vv|vvv|–verbose] [-V|–version] [–ansi] [–no-ansi] [-n|–no-inte
raction] [–ignore-maintenance-mode] [–maintenance-mode] [-e|–env ENV] [–no-debug] [–] []

This has nothing todo with CoreShop, that is a Pimcore issue. How are you trying to install CoreShop and ending up getting Pimcore issues?

Hey.

that seems like a fair question. Bothers me to…

However I installed both, through Composer as described on each Git, and documentation.

First Pimcore, then Coreshop ofcourse…

Try starting all over again, with the latest Pimcore Stable Skeleton from here:

and then install CoreShop with:

1. composer req coreshop/core-shop
2. bin/console pimcore:bundle:enable CoreShopCoreBundle
3. bin/console coreshop:install
4. OPTIONAL: bin/console coreshop:install:demo

yessir, Ill do that. - I am pretty sure I read somewhere that the Coreshop install should be in the same dir as Pimcore, - however should that be the WEB folder? (because that I have not tried)

Ill update after…

No, CoreShop is just a composer dependency, the Project dir is outside web. So, basically you do:

1. composer create project pimcore/skeleton pimcore
2. cd pimcore
3. [FOLLOW Pimcore INSTALL INSTRUCTIONS]
4. [FOLLOW CoreShop INSTALL INSTRUCTIONS]

okay! Im on it…

Hey,
okay! It is what I am doing. Seems to me that it is running the install script again, and therefor also the migrations.
The CoreShop files getting installed, but the composer.json reverts to last configuration.
Where is the scripts located, so I can check if that is the issue?

Also: I get this information in my Terminal at the end of step 1.

Skipping migrations … (either Pimcore is not installed yet or current status of migrations is not available)

It should not migrate anything yet right?

can you show me the log output?

[2019-06-11 15:09:48] console.ERROR: Error thrown while running command “–ansi pimcore:migrations:status -s pimcore_core -o current_version”. Message: “An exception occurred while executing ‘SHOW FULL TABLES WHERE Table_type = ‘BASE TABLE’’: SQLSTATE[3D000]: Invalid catalog name: 1046 No database selected” {“exception”:"[object] (Doctrine\DBAL\Exception\ConnectionException(code: 0):
An exception occurred while executing ‘SHOW FULL TABLES WHERE Table_type = ‘BASE TABLE’’:\n\nSQLSTATE[3D000]: Invalid catalog name: 1046 No database selected at D:\www\room1006\pimcore\vendor\doctrine\dbal\lib\Doctrine\DBAL\Driver\AbstractMySQLDriver.php:93, Doctrine\DBAL\Driver\PDOException(code: 3D000): SQLSTATE[3D000]: Invalid catalog name:
1046 No database selected at D:\www\room1006\pimcore\vendor\doctrine\dbal\lib\Doctrine\DBAL\Driver\PDOConnection.php:90, PDOException(code: 3D000): SQLSTATE[3D000]:
Invalid catalog name: 1046 No database selected at D:\www\room1006\pimcore\vendor\doctrine\dbal\lib\Doctrine\DBAL\Driver\PDOConnection.php:88)",“command”:"–ansi pimcore:migrations:status -s pimcore_core -o current_version",“message”:“An exception occurred while executing ‘SHOW FULL TABLES WHERE Table_type = ‘BASE TABLE’’:\n\nSQLSTATE[3D000]: Invalid catalog name: 1046 No database selected”} []
[2019-06-11 15:09:48] console.DEBUG: Command “–ansi pimcore:migrations:status -s pimcore_core -o current_version” exited with code “1” {“command”:"–ansi pimcore:migrations:status -s pimcore_core -o current_version",“code”:1} []
[2019-06-11 15:10:12] console.ERROR: Error thrown while running command “–ansi pimcore:migrations:status -s pimcore_core -o current_version”. Message: “An exception occurred while executing ‘SHOW FULL TABLES WHERE Table_type = ‘BASE TABLE’’: SQLSTATE[3D000]: Invalid catalog name: 1046 No database selected” {“exception”:"[object] (Doctrine\DBAL\Exception\ConnectionException(code: 0): An exception occurred while executing ‘SHOW FULL TABLES WHERE Table_type = ‘BASE TABLE’’:\n\nSQLSTATE[3D000]: Invalid catalog name: 1046 No database selected at D:\www\room1006\pimcore\vendor\doctrine\dbal\lib\Doctrine\DBAL\Driver\AbstractMySQLDriver.php:93, Doctrine\DBAL\Driver\PDOException(code: 3D000): SQLSTATE[3D000]: Invalid catalog name: 1046 No database selected at D:\www\room1006\pimcore\vendor\doctrine\dbal\lib\Doctrine\DBAL\Driver\PDOConnection.php:90, PDOException(code: 3D000): SQLSTATE[3D000]: Invalid catalog name: 1046 No database selected at D:\www\room1006\pimcore\vendor\doctrine\dbal\lib\Doctrine\DBAL\Driver\PDOConnection.php:88)",“command”:"–ansi pimcore:migrations:status -s pimcore_core -o current_version",“message”:“An exception occurred while executing ‘SHOW FULL TABLES WHERE Table_type = ‘BASE TABLE’’:\n\nSQLSTATE[3D000]: Invalid catalog name: 1046 No database selected”} []
[2019-06-11 15:10:12] console.DEBUG: Command “–ansi pimcore:migrations:status -s pimcore_core -o current_version” exited with code “1” {“command”:"–ansi pimcore:migrations:status -s pimcore_core -o current_version",“code”:1} []

This is still at step 1.

I mean the whole log from composer req coreshop/core-shop

I noticed that the composer.json is not equal to the one that´s in the git-rep.
So I cloned the git, and then installed the dependencies.
Then installed PimCore,
and finally CoreShop… that failed.

update!
To have a reference I installed Ampps, and installed Pimcore 4.6 from there.
oh boy…
There is a world difference… Success on first try… On the same system!

So my question is: (Forgive me for need this to be spelled out, I am just wired differently)
For vers. 5.x: Should the folder and file structure be similar on the Pimcore 4.6 installation? Should the web folder and the Pimcore folder be installed alongside of eachother?

On the same directory level? Right?
In fact, it should be installed of the very root of the web server?

  • wish for… a tiny installer for future versions.

There is an installer, it’s called composer. Just follow the instructions on the Pimcore docs, it can’t be more clear than that.

hmmm, let me see…

/project-folder
“my-project”,
/your/project/"
documentroot
webfolder/public-folder.

uhhm I don´t know… to me it could…

but I am wired differently. And less experienced.
But of course when you have figured it out one time - you quickly forget about it :wink:

The a some some major differences between the file and project structure of Pimcore 4.6 an Pimcore 5.x

Pimcore 5 is based on Symfony and not an Zend Framework 1. I highly recommend you to go through the Pimcore 5 installation guide and not try to upgrade your Pimcore 4.6 installation. For a new project this makes no sense…

If you follow the guid, you should end up with a fresh installation of Pimcore 5 where you can install Coreshop pretty easy…

Please note that, as mentioned before, you need to use the install script ./vendor/bin/pimcore-install and not just composer install…