Bug 1261433 - 500 errors when trying to delete a project immediately after a build failure
500 errors when trying to delete a project immediately after a build failure
Status: CLOSED CURRENTRELEASE
Product: Copr
Classification: Community
Component: frontend (Show other bugs)
unspecified
Unspecified Unspecified
unspecified Severity medium
: ---
: ---
Assigned To: clime
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-09-09 06:21 EDT by Radek Holy
Modified: 2016-02-04 03:58 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-02-04 03:58:14 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Radek Holy 2015-09-09 06:21:39 EDT
(I am not sure against which component should I file this - I'm not sure what is the root cause)


Description of problem:
When using the Python "API", if I try to build something and if it fails and if I immediately try to delete the project then, I get 500 Internal Server Error. After multiple attempts, the project can be deleted.


Version-Release number of selected component (if applicable):
python-copr-1.58-1.fc21.noarch
I don't know the version of the server, it's the one that is running at https://copr.fedoraproject.org/.
Copr frontend build version: 1.66-1.fc21 


How reproducible:
Always


Steps to Reproduce:
    from __future__ import unicode_literals
    import time
    import copr


    try:
        client = copr.client.CoprClient.create_from_file_config()
        result = client.create_new_build(project, pkgs=['https://kojipkgs.fedoraproject.org//packages/librepo/1.7.16/2.fc23/src/librepo-1.7.16-2.fc23.src.rpm'])
    except Exception:
        raise ValueError('Copr failed - reason unknown')
    for dummy in range(90):
        for build in result.builds_list:
            try:
                status = build.handle.get_build_details().status
            except Exception:
                raise ValueError('Copr failed - reason unknown')
            if status not in {'skipped', 'failed', 'succeeded'}:
                break
        else:
            break
        time.sleep(10)
    else:
        raise ValueError('too long')
    for dummy in range(60):
        try:
            client.delete_project(project)
        except Exception as err:
            print('Copr failed with: {}'.format(err))
        else:
            break
        time.sleep(10)
    else:
        raise ValueError('too long')
    print('done')


Actual results:
    Copr failed with: Unknown response from the server. Code: 500, raw response: 
     <!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>

    done

(the number of errors may be different)


Expected results:
    done

(no errors)


Additional info:
I didn't notice this after a successful build.

BTW, this package fails (IIRC) because extended file attributes doesn't seem to be enabled. This apparently is not case in Koji. But I have no idea whether you would consider this a bug in Copr.
Comment 2 clime 2016-01-04 02:57:19 EST
By using the provided script I could not reproduce the problem in the current frontend version (1.76).
Comment 3 Miroslav Suchý 2016-02-03 07:28:43 EST
Code with this fix is currently deployed on copr-fe-dev.cloud.fedoraproject.org. You can test it there before it will be deployed to production.
Comment 4 Miroslav Suchý 2016-02-04 03:58:14 EST
This fix has been just deployed to production.

Note You need to log in before you can comment on or make changes to this bug.