#1228 `copr build omajid/source-build src.rpm` fails with "Request is not in JSON format"
Closed: Fixed 4 years ago by praiskup. Opened 4 years ago by omajid.

$ rpm -q copr-cli python3-copr
copr-cli-1.84-1.fc31.noarch
python3-copr-1.100-1.fc31.noarch

I regenerated the credentials earlier today. I know they are valid because this works:

copr modify omajid/source-build --description '**DO NOT USE**'

But this always fails:

$ copr-cli build omajid/source-build /home/omajid/fedora-git/source-build-reference-packages/source-build-reference-packages-0.1-1.fc31.src.rpm
Uploading package /home/omajid/fedora-git/source-build-reference-packages/source-build-reference-packages-0.1-1.fc31.src.rpm
 |################################| 457.7 MB 1.3 MB/s eta 0:00:00Request is not in JSON format, there is probably a bug in the API code.

The error says "Request is not in JSON format", which I have no idea what that means.

I have tried different variants without any luck either:

$ copr-cli build omajid/source-build source-build-reference-packages-0.1-1.fc31.src.rpm
$ copr-cli build source-build source-build-reference-packages-0.1-1.fc31.src.rpm

cc @msuchy


Metadata Update from @praiskup:
- Issue assigned to schlupov

4 years ago

I tried with --debug, renaming the package and using a new copr repo:

$ copr --debug build foobarbaz referencepackages-0.1-1.fc31.src.rpm
#  Debug log enabled  #
[10:22:56] {/usr/lib/python3.7/site-packages/urllib3/connectionpool.py:959} DEBUG - Starting new HTTPS connection (1): copr.fedorainfracloud.org:443
[10:22:56] {/usr/lib/python3.7/site-packages/urllib3/connectionpool.py:437} DEBUG - https://copr.fedorainfracloud.org:443 "GET /api_3/auth-check HTTP/1.1" 200 27
Uploading package referencepackages-0.1-1.fc31.src.rpm
[10:22:56] {/usr/lib/python3.7/site-packages/urllib3/connectionpool.py:959} DEBUG - Starting new HTTPS connection (1): copr.fedorainfracloud.org:443
 |################################| 458.1 MB 1.2 MB/s eta 0:00:00[10:29:18] {/usr/lib/python3.7/site-packages/urllib3/connectionpool.py:437} DEBUG - https://copr.fedorainfracloud.org:443 "POST /api_3/build/create/upload HTTP/1.1" 500 527
Request is not in JSON format, there is probably a bug in the API code.

I stripped out most of the contents of the "source archive" to get it to become much smaller. That seems to make it work:

$ copr --debug build foobarbaz referencepackages-0.1-1.fc31.src.rpm
#  Debug log enabled  #
[11:05:18] {/usr/lib/python3.7/site-packages/urllib3/connectionpool.py:959} DEBUG - Starting new HTTPS connection (1): copr.fedorainfracloud.org:443
[11:05:20] {/usr/lib/python3.7/site-packages/urllib3/connectionpool.py:437} DEBUG - https://copr.fedorainfracloud.org:443 "GET /api_3/auth-check HTTP/1.1" 200 27
Uploading package referencepackages-0.1-1.fc31.src.rpm
[11:05:20] {/usr/lib/python3.7/site-packages/urllib3/connectionpool.py:959} DEBUG - Starting new HTTPS connection (1): copr.fedorainfracloud.org:443
 |################################| 155.6 kB 275.5 kB/s eta 0:00:00[11:05:20] {/usr/lib/python3.7/site-packages/urllib3/connectionpool.py:437} DEBUG - https://copr.fedorainfracloud.org:443 "POST /api_3/build/create/upload HTTP/1.1" 200 42
3
Build was added to foobarbaz:
  https://copr.fedorainfracloud.org/coprs/build/1173384
Created builds: 1173384
Watching build(s): (this may be safely interrupted)
[11:05:21] {/usr/lib/python3.7/site-packages/urllib3/connectionpool.py:959} DEBUG - Starting new HTTPS connection (1): copr.fedorainfracloud.org:443
[11:05:21] {/usr/lib/python3.7/site-packages/urllib3/connectionpool.py:437} DEBUG - https://copr.fedorainfracloud.org:443 "GET /api_3/build/1173384 HTTP/1.1" 301 315
[11:05:21] {/usr/lib/python3.7/site-packages/urllib3/connectionpool.py:437} DEBUG - https://copr.fedorainfracloud.org:443 "GET /api_3/build/1173384/ HTTP/1.1" 200 423
  11:05:21 Build 1173384: pending

Is there a size restriction here? Can that restriction be made more lax? And can the error messages be improved?

I'm not aware of any restriction. There's also somewhat duplicate #1196,
@schlupov is looking at both of them.

Metadata Update from @praiskup:
- Issue tagged with: bug

4 years ago

@schlupov, now I rememberred that we don't store the uploaded src.rpm files in /tmp, but in /var/lib/copr/data/srpm_storage, if that helps with reproducing the issue.

Metadata Update from @schlupov:
- Issue close_status updated to: Fixed
- Issue status updated to: Closed (was: Open)

4 years ago

TimeOut for the post request has been raised so you should be able to use copr with such a big src.rpm.

I dont think this has been fixed. I just tried it right now:

$ copr-cli --version
copr version 1.85
$ copr-cli build omajid/source-build /home/omajid/fedora-git/dotnet-3-1/dotnet3.1-3.1.101-2.fc33.src.rpm
Uploading package /home/omajid/fedora-git/dotnet-3-1/dotnet3.1-3.1.101-2.fc33.src.rpm
 |################################| 2.5 GB 1.3 MB/s eta 0:00:00Request is not in JSON format, there is probably a bug  in the API code.

Metadata Update from @omajid:
- Issue status updated to: Open (was: Closed)

4 years ago

I'm not sure right now where might be the problem, I will let you know once I will know more. I'm able to reproduce this issue with very big src.rpm, over 1.8 GB. I can upload smaller src.rpm and start a new build.

copr --debug build schlupov/Test file_big.src.rpm 
#  Debug log enabled  #
[13:49:18] {/usr/lib/python3.7/site-packages/urllib3/connectionpool.py:959} DEBUG - Starting new HTTPS connection (1): copr.fedorainfracloud.org:443
[13:49:19] {/usr/lib/python3.7/site-packages/urllib3/connectionpool.py:437} DEBUG - https://copr.fedorainfracloud.org:443 "GET /api_3/auth-check HTTP/1.1" 200 30
Uploading package file_big.src.rpm
[13:49:19] {/usr/lib/python3.7/site-packages/urllib3/connectionpool.py:959} DEBUG - Starting new HTTPS connection (1): copr.fedorainfracloud.org:443
 |################################| 1.6 GB 12.3 MB/s eta 0:00:00[13:51:18] {/usr/lib/python3.7/site-packages/urllib3/connectionpool.py:437} DEBUG - https://copr.fedorainfracloud.org:443 "POST /api_3/build/create/upload HTTP/1.1" 200 397
Build was added to Test:
  https://copr.fedorainfracloud.org/coprs/build/1250702
Created builds: 1250702
Watching build(s): (this may be safely interrupted)
[13:51:18] {/usr/lib/python3.7/site-packages/urllib3/connectionpool.py:959} DEBUG - Starting new HTTPS connection (1): copr.fedorainfracloud.org:443
[13:51:18] {/usr/lib/python3.7/site-packages/urllib3/connectionpool.py:437} DEBUG - https://copr.fedorainfracloud.org:443 "GET /api_3/build/1250702 HTTP/1.1" 301 315
[13:51:18] {/usr/lib/python3.7/site-packages/urllib3/connectionpool.py:437} DEBUG - https://copr.fedorainfracloud.org:443 "GET /api_3/build/1250702/ HTTP/1.1" 200 397
  13:51:18 Build 1250702: pending

My recommendation, for now, would be to make src.rpm smaller or you can try some better internet connectivity.

As reported here, this still happens.

I tried it today and can reproduce it almost every other time with a 35MB srpm, both on production and on staging (well, it's more rare on staging than on production). I tried to debug it with no luck.

Hello, I have the same issue.
The SRPM I upload has ~70-100MB and the success rate it about 1/3.
The upload time is over a minute.

Fedora 30, "copr version 1.86", "copr-cli-1.86-1.fc30.noarch"

I've been unable to build recent GCC snapshots for months due to this.

Metadata Update from @praiskup:
- Issue assigned to praiskup (was: schlupov)

4 years ago

I meet the same problem with some "big" package.
Via the COPR web interface, the server always hangs.
Via copr-cli, I've got the "JSON" error message.
The only way to get the package uploaded was to put the package on a personnal server and send the URL on the COPR Web interface ...

I've done several updates in ansible.git today to make the httpd configuration
more straight forward, and what fixed this problem is probably this.

Tested by:

15:30:22 /tmp$ copr build ping test.src.rpm
Uploading package test.src.rpm
 |################################| 1.6 GB 1.5 MB/s eta 0:00:00Build was added to ping:
  https://copr.fedorainfracloud.org/coprs/build/1340287
Created builds: 1340287
Watching build(s): (this may be safely interrupted)
  15:53:06 Build 1340287: pending
^C
15:53:09 /tmp$

So upload taking 23 minutes, 1.5G, finished just fine. I hope it is fixed, so closing.
Thanks for the reports, and sorry for inconvenience.

Metadata Update from @praiskup:
- Issue close_status updated to: Fixed
- Issue status updated to: Closed (was: Open)

4 years ago

Login to comment on this ticket.

Metadata