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

Cron job is crashing because of project anyterm #702

Closed
Zlopez opened this issue Jan 14, 2019 · 4 comments
Closed

Cron job is crashing because of project anyterm #702

Zlopez opened this issue Jan 14, 2019 · 4 comments
Labels

Comments

@Zlopez
Copy link
Contributor

Zlopez commented Jan 14, 2019

Project anyterm (https://release-monitoring.org/project/8330/) is causing crash of cron job when checking for latest version when it is already retrieved.

This is in the cron job log:

sqlalchemy.orm.exc.FlushError: New instance <ProjectVersion at 0x7f27714f3e10> with identity key (<class 'anitya.db.models.ProjectVersion'>, (8330, '1.2.3'), None) conflicts with persistent instance <ProjectVersion at 0x7f2771107f60>

This looks like it can't recognize that the version was already retrieved.
anitya-1547478000-nhgqd.log

@n-cc
Copy link

n-cc commented Aug 20, 2019

I'm still running into this on 0.16.1 when querying api/version/get:

sqlalchemy.orm.exc.FlushError: New instance <ProjectVersion at 0x7f60da315550> with identity key (<class 'anitya.db.models.ProjectVersion'>, (1, '4.1.0'), None) conflicts with persistent instance <ProjectVersion at 0x7f60da2e1fd0>

I've confirmed it happens with multiple projects

@n-cc
Copy link

n-cc commented Aug 20, 2019

Not checking Check latest release on submit when creating the project seems to fix this issue.

@Zlopez
Copy link
Contributor Author

Zlopez commented Aug 21, 2019

@n-cc The Check latest release on submit doesn't call the cron job, also the cron job is now replaced by service, so this issue shouldn't happen again.

I did a small change in #786 that should prevent this when using the check.

@n-cc
Copy link

n-cc commented Aug 22, 2019

I just want to confirm that what I'm seeing on 0.16.1 will be fixed:

I'm adding a new project pointing to an internal gitlab repository with two releases, not checking the Check latest release on submit box, and then querying the api successfully once, but subsequent queries fail:

$ curl --data "id=1" https://anitya.internal/api/version/get
{"backend":"GitLab","created_on":1566486465.0,"ecosystem":"https://gitlab.internal/n-cc/test_anitya","homepage":"https://gitlab.internal/n-cc/test_anitya","id":1,"name":"test_anitya","packages":[],"regex":null,"updated_on":1566486495.0,"version":"1.0.1","version_url":"https://gitlab.internal/n-cc/test_anitya","versions":["1.0.0","1.0.1"]}
$ curl --data "id=1" https://anitya.internal/api/version/get
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<title>500 Internal Server Error</title>
<h1>Internal Server Error</h1>
<p>The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.</p>
$

The error reported on the backend the second time is the sqlalchemy.orm.exc.FlushError: New instance <ProjectVersion at 0x7f3e4f437c18> with identity key (<class 'anitya.db.models.ProjectVersion'>, (1, '1.0.1'), None) conflicts with persistent instance <ProjectVersion at 0x7f3e4e94ea58> error.

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

Successfully merging a pull request may close this issue.

2 participants