Red Hat Bugzilla – Bug 1285734
Error 403 downloading src.rpm
Last modified: 2015-11-27 04:15:50 EST
I have a website where I put .src.rpm and .spec files. I can download those files fine using a browser or urlgrabber, but when I run fedora-review I get a 403 error.
Example: review request #1282575
$ fedora-review -m fedora-rawhide-x86_64 -b 1285042
INFO: Processing bugzilla bug: 1285042
INFO: Getting .spec and .srpm Urls from : 1285042
INFO: --> SRPM url: http://www.coolbits.it/fedora/kpmcore-1.9.50-3.fc23.src.rpm
INFO: --> Spec url: http://www.coolbits.it/fedora/kpmcore.spec
INFO: Using review directory: /home/rpmbuild/1285042-kpmcore
INFO: Downloading .spec and .srpm files
ERROR: 'Error 403 downloading http://www.coolbits.it/fedora/kpmcore-1.9.50-3.fc23.src.rpm' (logs in /home/rpmbuild/.cache/fedora-review.log)
The fedora-review.log doesn't say anything more about the error.
With urlgrabber I can download it fine:
$ urlgrabber -D http://www.coolbits.it/fedora/kpmcore-1.9.50-3.fc23.src.rpm
2015-11-26 12:03:55,723 attempt 1/None: http://www.coolbits.it/fedora/kpmcore-1.9.50-3.fc23.src.rpm
2015-11-26 12:03:55,723 opening local file "kpmcore-1.9.50-3.fc23.src.rpm" with mode wb
kpmcore-1.9.50-3.fc23.src.rpm | 352 kB 00:00:00
2015-11-26 12:03:56,156 success
I cannot reproduce this. The example runs fine for me. Closing for now, please re-open if there is more info.
Created attachment 1099315 [details]
I attach the log of fedora-review which shows some debug information.
Another user has reported the same failure on review request #1236488
As you say, the debug info doesn't give that much. The core is that it replies with a 403 (i. e., "forbidden") status message. I can reproduce it on the url in comment #2.
This basically boils down to that that some web servers does not allow fedora-review to download data. Until it can be shown that f-r downloads in a non-standard way I can't really see that the bug is on the f-r side. That it works for me in the first case is yet another sign that this is about the web server configuration.
Given that you can download the srpm this also isn't much of a problem; f-r has the necessary hooks to run the review on a local srpm.
Bottom line: while I do see the problem, I'm not ready to blame f-r at this point. Will close again unless there is more input pointing out f-r as the culprit.
Ok for closing. The culprit can also be the fact I'm using a CDN (Cloudflare) for my site (I don't know why), I will do some testing with CDN disable.
But what exactly f-r use to download files? Am I right supposing it uses python urlgrabber? So, why using urlgrabber from cli works? Does f-r uses some parameters on calling urlgrabber?
No, it uses urllib. Code: https://git.fedorahosted.org/cgit/FedoraReview.git/tree/src/FedoraReview/helpers_mixin.py?h=devel#n78
Just for information: it was a problem related to the use of CDN Cloudflare, maybe some setting of cache or browser integrity check was blocking f-r to work.
Sorry for the noise.