Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.
Bug 1334102 - dist-git traceback with "unknown source type: 0"
Summary: dist-git traceback with "unknown source type: 0"
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Copr
Classification: Community
Component: frontend
Version: unspecified
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: clime
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-05-08 14:38 UTC by Miroslav Suchý
Modified: 2016-10-03 20:21 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-09-12 17:07:43 UTC
Embargoed:


Attachments (Terms of Use)

Description Miroslav Suchý 2016-05-08 14:38:12 UTC
I am seeing in dist-git log this error:

[14:31:51][DEBUG][dist_git.dist_git_importer][dist_git_importer:394] 1. Try to get task data
[14:31:51][ERROR][dist_git.dist_git_importer][dist_git_importer:405] Failed acquire new packages for import:
[14:31:51][ERROR][dist_git.dist_git_importer][dist_git_importer:406] Got unknown source type: 0
Traceback (most recent call last):
  File "/usr/share/copr/dist_git/dist_git_importer.py", line 403, in try_to_obtain_new_task
    return ImportTask.from_dict(builds_list[0], self.opts)
  File "/usr/share/copr/dist_git/dist_git_importer.py", line 114, in from_dict
    raise PackageImportException("Got unknown source type: {}".format(task.source_type))
PackageImportException: Got unknown source type: 0


This has been very likely triggered by:

https://copr.fedorainfracloud.org/coprs/ablu/tiled-dailies/build/190045/

I did not tried to reproduce, but I will bet that the steps are:

1. Create package, without any defintion
2. Configure webhook for this package
3. Github initiate webhook connection
4. Dist-git is trying to create SRPM without any source type defined.

I would expect that any incoming webhook for Sourcetype 0 is discarded.

Comment 1 Miroslav Suchý 2016-05-08 14:41:13 UTC
Additionally anything which gets to:
  raise PackageImportException("Got unknown source type: {}".format(task.source_type))
is left in "importing state" and is processes again and again.

Such task should be marked as failed.

Comment 2 clime 2016-05-09 15:12:57 UTC
It should not be possible to create a package without any definition (step 1 from "How to reproduce").

What is possible though is to make a package that have source_json set but source_type unset (0). The whole reproducer goes like this:

1) Set git_and_tito source_type for some package
2) Set webhook for this package in a github
3) Press Reset in package's default source definition (this clears source_type but leaves source_json untouched)
4) Invoke a webhook push event from github (by committing into the repository)

This will go through packages_logic:commits_belong_to_package, which will return True and consequently packages_logic:get_for_webhook_rebuild will return this package having source_type zero.

In https://github.com/fedora-copr/copr/commit/813030ae I have fixed the reset button to reset also source_json so this problem can no longer occur.

Comment 3 Fedora Update System 2016-05-27 15:37:30 UTC
copr-frontend-1.93-1.fc23 has been submitted as an update to Fedora 23. https://bodhi.fedoraproject.org/updates/FEDORA-2016-af777aa589

Comment 4 Fedora Update System 2016-05-28 03:24:17 UTC
copr-frontend-1.93-1.fc23 has been pushed to the Fedora 23 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-af777aa589

Comment 5 clime 2016-06-03 14:34:21 UTC
New COPR version was released.

Comment 6 Fedora Update System 2016-07-01 14:45:18 UTC
copr-frontend-1.97-1.fc23 has been submitted as an update to Fedora 23. https://bodhi.fedoraproject.org/updates/FEDORA-2016-ec39f79e18

Comment 7 Fedora Update System 2016-07-02 20:55:25 UTC
copr-frontend-1.97-1.fc23 has been pushed to the Fedora 23 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-ec39f79e18

Comment 8 Fedora Update System 2016-08-17 14:44:07 UTC
copr-frontend-1.99-1.fc23 has been submitted as an update to Fedora 23. https://bodhi.fedoraproject.org/updates/FEDORA-2016-c38bc25dbc

Comment 9 Fedora Update System 2016-08-18 01:50:41 UTC
copr-frontend-1.99-1.fc23 has been pushed to the Fedora 23 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-c38bc25dbc

Comment 10 clime 2016-08-18 16:25:30 UTC
New Copr has been released.

Comment 11 Fedora Update System 2016-09-12 06:25:50 UTC
copr-frontend-1.101-1.fc23 has been submitted as an update to Fedora 23. https://bodhi.fedoraproject.org/updates/FEDORA-2016-5a3cdc5801

Comment 12 Fedora Update System 2016-09-12 14:51:12 UTC
copr-frontend-1.101-1.fc23 has been pushed to the Fedora 23 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-5a3cdc5801

Comment 13 Fedora Update System 2016-10-03 20:21:20 UTC
copr-frontend-1.101-1.fc23 has been pushed to the Fedora 23 stable repository. If problems still persist, please make note of it in this bug report.


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