Project

Profile

Help

Issue #4896

closed

[Ruby client] Chunked Uploads API doesn't recognize file parameter

Added by sajha almost 5 years ago. Updated almost 4 years ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
Normal
Category:
-
Sprint/Milestone:
Start date:
Due date:
Estimated time:
Severity:
1. Low
Version:
Platform Release:
OS:
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Katello
Sprint:
Sprint 56
Quarter:

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

Related to Pulp - Story #4196: As a user, I can upload files in chunks.CLOSED - CURRENTRELEASEdaviddavis

Actions
Related to Pulp - Test #4197: Test upload of large artifactsCLOSED - WONTFIXkersomActions
Actions #1

Updated by amacdona@redhat.com almost 5 years ago

  • Triaged changed from No to Yes
  • Sprint set to Sprint 53
Actions #2

Updated by kersom almost 5 years ago

  • Related to Story #4196: As a user, I can upload files in chunks. added
Actions #3

Updated by kersom almost 5 years ago

  • Related to Test #4197: Test upload of large artifacts added
Actions #4

Updated by amacdona@redhat.com almost 5 years ago

  • Sprint changed from Sprint 53 to Sprint 54
Actions #5

Updated by dkliban@redhat.com almost 5 years ago

  • Status changed from NEW to ASSIGNED
  • Assignee set to dkliban@redhat.com

Added by dkliban@redhat.com almost 5 years ago

Revision 8487f0ed | View on GitHub

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

Actions #7

Updated by dkliban@redhat.com almost 5 years ago

  • Status changed from POST to MODIFIED

Added by dkliban@redhat.com almost 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

re: #4896 https://pulp.plan.io/issues/4896

Actions #8

Updated by dkliban@redhat.com almost 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

Actions #9

Updated by dkliban@redhat.com almost 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
Actions #10

Updated by ttereshc almost 5 years ago

  • Sprint changed from Sprint 54 to Sprint 55
Actions #11

Updated by jsherril@redhat.com almost 5 years ago

  • Tags Katello-P2 added
  • Tags deleted (Katello-P4)
Actions #12

Updated by sajha almost 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

Actions #13

Updated by dkliban@redhat.com almost 5 years ago

  • Sprint changed from Sprint 55 to Sprint 56
Actions #14

Updated by dkliban@redhat.com almost 5 years ago

  • Tags Katello-P1 added
  • Tags deleted (Katello-P2)

Added by dkliban@redhat.com almost 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

re: #4896 https://pulp.plan.io/issues/4896

Added by dkliban@redhat.com almost 5 years ago

Revision d7489f6e | View on GitHub

Problem: no script for testing Ruby bindings

Solution: add a script for testing with Ruby bindings

re: #4896 https://pulp.plan.io/issues/4896

Added by dkliban@redhat.com almost 5 years ago

Revision 7a3b7372 | View on GitHub

Problem: ruby client is not tested

Solution: run the .travis/test_bindings.rb with each PR

re: #4896 https://pulp.plan.io/issues/4896

Actions #16

Updated by dkliban@redhat.com over 4 years ago

  • Status changed from POST to MODIFIED
Actions #17

Updated by bmbouter over 4 years ago

  • Sprint/Milestone set to 3.0.0
Actions #18

Updated by bmbouter over 4 years ago

  • Status changed from MODIFIED to CLOSED - CURRENTRELEASE
Actions #19

Updated by ggainey almost 4 years ago

  • Tags Katello added
  • Tags deleted (Katello-P1)

Also available in: Atom PDF