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

Error 500: Sync GitLab Remote - Fatal error: Uncaught PDOException #78

Open
strausmann opened this issue Jan 17, 2018 · 7 comments
Open
Labels
Milestone

Comments

@strausmann
Copy link

After click on the Sync Button for my GitLab Remote i got an Error 500.

Fatal error: Uncaught PDOException: SQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails (devpackages.packages_gitlab_configurations, CONSTRAINT FK_1FE0005DF44CABFF FOREIGN KEY (package_id) REFERENCES packages (id)) in /var/www/vhosts/mydomain.de/httpdocs/packages/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:105 Stack trace: #0 /var/www/vhosts/mydomain.de/httpdocs/packages/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php(105): PDOStatement->execute(NULL) #1 /var/www/vhosts/mydomain.de/httpdocs/packages/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(1006): Doctrine\DBAL\Driver\PDOStatement->execute() #2 /var/www/vhosts/mydomain.de/httpdocs/packages/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(596): Doctrine\DBAL\Connection->executeUpdate('DELETE FROM pac...', Array, Array) #3 /var/www/vhosts/mydomain.de/htt in /var/www/vhosts/mydomain.de/httpdocs/packages/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php on line 60

@strausmann
Copy link
Author

The Issue comes after on gitlab is a repository renamed or removed.

@tyler-sommer
Copy link
Member

Thanks for the bug report! I thought this issue was already fixed, but apparently not!

@NeoBlack
Copy link
Contributor

can confirm the issue, with the same scenario, rename or remove a repository on gitlab break sync of the complete remote. should be fixed with prio I think, because it is a breaking bug and has a big impact.

@tyler-sommer
Copy link
Member

Agreed, this is a pretty bad issue. It looks like it's going to require a database migration or improvements in how packages are deleted.

I'll take a look at what possible solutions we have as soon as possible.

As always, thanks for your contributions @strausmann and @NeoBlack ! It's very much appreciated.

@NeoBlack
Copy link
Contributor

I would recommend to add a delete flag to the model and mark the packages as "deleted", this make it possible to show this information also in the admin interface or frontend.

The information that a package is missing is very interesting, and a hard delete could be realized in the admin interface. anyway, the problem on delete is a wrong cascade definition in the database definition. Not sure where exactly, but the error message is really clear: " Integrity constraint violation"

@tyler-sommer
Copy link
Member

Agreed on the soft delete implementation, @NeoBlack. Should have gone that way from the start. No matter what, we can handle whatever logic is necessary in a doctrine preRemove event subscriber.

FrankGiesecke added a commit to FrankGiesecke/packages that referenced this issue Nov 15, 2018
This will temporary avoid the constraint violation described in terramar-labs#78.
@tyler-sommer
Copy link
Member

#109 is a simple fix for now. I'd like to see a new column added (deleted?) that is then used to simply not show the package in the UI. Leaving this open

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

3 participants