Issue #4896
closed[Ruby client] Chunked Uploads API doesn't recognize file parameter
Description
The Pulpcore API client has the UploadsAPI method uploads_create
For the below inputs:
file = File.new("/path/to/file")
file_chunk_string = "Random String chunk"
The calls below produce the following requests:
pulp3_api.uploads_create(file)
HTTP Request formed:
2019-05-31T02:18:09 [D|kat|] Calling API: UploadsApi.uploads_create ...
2019-05-31T02:18:09 [D|kat|] HTTP request body param ~BEGIN~
| {"file"=>#<File:/home/vagrant/katello/Gemfile>}
| ~END~
pulp3_api.uploads_create(file_chunk_string)
HTTP Request formed:
2019-05-31T02:18:09 [D|kat|] Calling API: UploadsApi.uploads_create ...
2019-05-31T02:18:09 [D|kat|] HTTP request body param ~BEGIN~
| {"file"=>"Random String chunk"}
| ~END~
In both cases, server returns:¶
PulpcoreClient::ApiError (Error message: the server returns an error)
HTTP status code: 400
Response headers: {"Server"=>"nginx/1.12.1", "Date"=>"Fri, 31 May 2019 02:18:10 GMT", "Content-Type"=>"application/json", "Content-Length"=>"40", "Connection"=>"keep-alive", "Vary"=>"Accept, Cookie", "Allow"=>"GET, POST, PUT, HEAD, OPTIONS", "X-Frame-Options"=>"SAMEORIGIN"}
Response body: {"detail":"No chunk file was submitted"}
PS:¶
The UploadsAPI has another method uploads_create_and_check which works with file (file = File.new("/path/to/file")) as an input.
Related issues
Updated by amacdona@redhat.com over 5 years ago
- Triaged changed from No to Yes
- Sprint set to Sprint 53
Updated by kersom over 5 years ago
- Related to Story #4196: As a user, I can upload files in chunks. added
Updated by kersom over 5 years ago
- Related to Test #4197: Test upload of large artifacts added
Updated by amacdona@redhat.com over 5 years ago
- Sprint changed from Sprint 53 to Sprint 54
Updated by dkliban@redhat.com over 5 years ago
- Status changed from NEW to ASSIGNED
- Assignee set to dkliban@redhat.com
Added by dkliban@redhat.com over 5 years ago
Updated by dkliban@redhat.com over 5 years ago
- Status changed from ASSIGNED to POST
Updated by dkliban@redhat.com over 5 years ago
- Status changed from POST to MODIFIED
Applied in changeset pulpcore|8487f0ed21b76244be54c2dec2a08205a8df9e01.
Added by dkliban@redhat.com over 5 years ago
Revision c2b713f3 | View on GitHub
Problem: Uploads API bindings are not tested
Solution: Add a test for Uploads API bindings
Required PR: https://github.com/pulp/pulpcore/pull/168
Updated by dkliban@redhat.com over 5 years ago
- Status changed from MODIFIED to ASSIGNED
The original problem reported still exists. This is only a problem for Ruby bindings. I filed an issue[0] against openapi-generator after finding an existing issue[1] in the library used to make requests in the Ruby client.
[0] https://github.com/OpenAPITools/openapi-generator/issues/3138
[1] https://github.com/typhoeus/typhoeus/issues/389
Updated by dkliban@redhat.com over 5 years ago
- Subject changed from Chunked Uploads API doesn't recognize file parameter to [Ruby client] Chunked Uploads API doesn't recognize file parameter
Updated by ttereshc over 5 years ago
- Sprint changed from Sprint 54 to Sprint 55
Updated by jsherril@redhat.com over 5 years ago
- Tags Katello-P2 added
- Tags deleted (
Katello-P4)
Updated by sajha over 5 years ago
So I am seeing this on the latest dev box: Here are the steps to reproduce: https://gist.github.com/sjha4/65078285778b3d80891202ec4c3fb569
Updated by dkliban@redhat.com over 5 years ago
- Sprint changed from Sprint 55 to Sprint 56
Updated by dkliban@redhat.com over 5 years ago
- Tags Katello-P1 added
- Tags deleted (
Katello-P2)
Added by dkliban@redhat.com over 5 years ago
Revision 028b3332 | View on GitHub
Problem: ruby client can't form-encode PUT requests
Solution: switch ruby client to use Faraday
This patch relies on a forked version of the openapi-generator-cli. Once the PR that introduces this functionality is merged into openapi-generator, the ruby client generation should be switched back to using the docker container for openapi-generator.
https://github.com/OpenAPITools/openapi-generator/pull/3405
Required PR: https://github.com/pulp/pulpcore/pull/226
Added by dkliban@redhat.com over 5 years ago
Revision d7489f6e | View on GitHub
Problem: no script for testing Ruby bindings
Solution: add a script for testing with Ruby bindings
Updated by dkliban@redhat.com over 5 years ago
- Status changed from ASSIGNED to POST
Added by dkliban@redhat.com over 5 years ago
Revision 7a3b7372 | View on GitHub
Problem: ruby client is not tested
Solution: run the .travis/test_bindings.rb with each PR
Updated by dkliban@redhat.com over 5 years ago
- Status changed from POST to MODIFIED
Updated by bmbouter almost 5 years ago
- Status changed from MODIFIED to CLOSED - CURRENTRELEASE
Updated by ggainey over 4 years ago
- Tags Katello added
- Tags deleted (
Katello-P1)
Problem: OpenAPI schema for Uploads APIs is wrong
Solution: Add Content-Range header to the OpenAPI schema
Required PR: https://github.com/pulp/pulp-openapi-generator/pull/17
fixes: #4896 https://pulp.plan.io/issues/4896