-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
file_upload fails with aptly-cli, but works with curl #152
Comments
Forgot to mention that in the
|
Can you try removing the initial '/' for the directory? and try with a new file name.
|
The
|
Ok. I have a Vagrant-aptly git repo we can use to debug a bit more. I might have some time to debug this week as well.On Jan 14, 2019 1:59 AM, Kristian Rønningen <notifications@github.com> wrote:The / prefix is necessary, because it becomes part of the URL, so without it, the result is a 404:
# aptly-cli file_upload --trace --upload aptly-test-file2.txt --directory testfile2
opening connection to my.aptly.server:443...
opened
starting SSL for my.aptly.server:443...
SSL established
<- "POST /api/filestestfile2 HTTP/1.1\r\nAccept-Encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3\r\nAccept: */*\r\nUser-Agent: Ruby\r\nContent-Type: multipart/form-data; boundary=-----------RubyMultipartPost\r\nContent-Length: 449\r\nAuthorization: Basic <redacted>\r\nConnection: close\r\nHost: my.aptly.server\r\n\r\n"
-> "HTTP/1.1 404 Not Found\r\n"
-> "Server: nginx/1.14.1\r\n"
-> "Date: Mon, 14 Jan 2019 09:54:06 GMT\r\n"
-> "Content-Type: text/plain\r\n"
-> "Content-Length: 18\r\n"
-> "Connection: close\r\n"
-> "\r\n"
reading 18 bytes...
-> "404 page not found"
read 18 bytes
Conn close
404 page not found
—You are receiving this because you commented.Reply to this email directly, view it on GitHub, or mute the thread.
|
Can you please try with providing the relative path to the local file that needs to be uploaded?
|
It seems to make no difference:
I have also tried using the full static path ( |
Hmm, I’m thinking it is a bug with the httpmultiparty gem (which is unmaintained). I just took a look and httparty gen now supports multipart upload. I think we need to switch over to httparty for uploads. |
Yeah, I saw the unmaintained notice for that gem as well, when trying to dive into the code. I didn't dive deeper into it though. Bad ruby skills and not enough time. :) |
@kristianronningen I was able to replicate the issue. And I have discovered the issue. The lastest version of HTTParty breaks aptly-cli. I need to put in some work to move to HTTParty from HTTPMultiParty. Until then, you can downgrade your httparty gem to '0.13.7'
I'm also releasing a new version of aptly-cli that will require this version upon install. Can you tell me what version of |
The version was:
Then I installed 0.13.7 and uninstalled 0.16.3 (they both ended up being installed, and aptly-cli still failed):
And now it works:
Thanks! |
Thanks for reporting the issue! Sorry it took me a few days to gear up. Glad we figured it out! ⭐️ |
I'm having trouble getting
file_upload
to work, and I can't find any obvious errors anywhere. Suspecting some kind of bug. Uploading a file by accessing the aptly API using curl works. Other aptly-cli commands work, such asfile_list
,repo_upload
andpublish_update
.My aptly-cli server is Debian 9.6, Ruby 2.3.3, aptly_cli 0.4.1.
My aptly api server is Debian 9.6, aptly 1.3.0.
File to upload:
Uploading the file using aptly-cli causes the directory to be created on the server, but the file is not uploaded. The response also does not contain the filename as expected:
My
/etc/aptly-cli.conf
looks like this:Using curl to upload the same file works, and shows a significant difference in the reported Content-Length of the upload. I'm not sure exactly how this is calculated:
These requests are, as you can see, all done through Nginx, but I have tried to also talk directly to the aptly API on port 8080, which gives me the exact same results.
For completeness, this is the relevant part in the Nginx config that handles requests to
/api/
:And this is the supervisor config, used to start the
aptly api serve
:The text was updated successfully, but these errors were encountered: