Skip to content
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

Pilets larger than 10mb can't be uploaded to the feed in piral-cli 0.13.0/0.13.1 #375

Closed
3 tasks done
kingb12 opened this issue Apr 16, 2021 · 4 comments
Closed
3 tasks done
Labels
bug Something isn't working cli Concerns the piral-cli application.
Milestone

Comments

@kingb12
Copy link
Contributor

kingb12 commented Apr 16, 2021

Bug Report

For more information, see the CONTRIBUTING guide.

Prerequisites

  • Can you reproduce the problem in a MWE?
  • Are you running the latest version?
  • Did you perform a search in the issues?

Environment Details and Version

Running from a mac (though I believe this is also seen on our linux TeamCity hosts), using piral-cli version 0.12.4, I am able to upload a pilet over 10mb successfully. On 0.13.0 and 0.13.1, I receive this error:

Failure cases: piral-cli versions 0.13.0 and 0.13.1
Last success: version 0.12.4
Feed service: both our internal implementation and piral.cloud (https://feed.piral.cloud/api/v1/pilet/brendanking)

Description

Publishing with 0.13.x we see:

> yarn pilet publish --source $PILET_PATH --url $FEED_URL --api-key $API_KEY --log-level 4  --ca-cert ops/certs/cacert.pem                                                                                                   
yarn run v1.22.4
warning package.json: No license field
warning ../package.json: No license field
$ /Users/bking/workspace/my-pilet/node_modules/.bin/pilet publish --source my-pilet-1.0.3.tgz --url https://feed.piral.cloud/api/v1/pilet/brendanking --log-level 4 --ca-cert ops/certs/cacert.pem
[11:21:28 AM]: Reading configuration ...
[11:21:28 AM]: [0003] Checking if certificate exists.
[11:21:28 AM]: [0003] Reading certificate file "cacert.pem" from "ops/certs".
[11:21:28 AM]: [0003] Getting the tgz files ...
[11:21:28 AM]: [0003] Did not find fresh flag. Trying to match from "local".
[11:21:28 AM]: [0003] Matching files using "my-pilet-1.0.3.tgz".
[11:21:28 AM]: [0003] Received available tgz files.
[11:21:28 AM]: [0000] Using feed service "https://feed.piral.cloud/api/v1/pilet/brendanking".
[11:21:28 AM]: [0003] Reading the file for upload ...
[11:21:28 AM]: Publishing "/Users/bking/workspace/my-pilet/my-pilet-1.0.3.tgz" ... https://feed.piral.cloud/api/v1/pilet/brendanking
[11:21:28 AM]: 🚨  [0065] Failed to upload via HTTP: Request body larger than maxBodyLength limit.
[11:21:28 AM]: ⚠️  [0062] Could not upload "my-pilet-1.0.3.tgz" to feed service.
[11:21:28 AM]: [0003] Finished uploading the file.
[11:21:28 AM]: 🚨  [0064] Failed to upload some pilet(s)!
Codes Reference: https://docs.piral.io/code/search
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Where $PILET_PATH is a > 10mb tgz pilet, other args as normal.

This happens both pointing at our own feed service implementation internally, and using the one hosted on piral.cloud. I believe this is related to some interceptor prior to a request being made, as leaving off the api key argument still results in the same issue against piral.cloud (where using 0.12.4 shows the expected 401, adding the arg results in successful publish). Similarly, we don't see logs in our internal feed service or ingress that would correspond with a rejected request.

Steps to Reproduce

  1. Create a pilet overr 10mb in tgz size
  2. Publish it to some feed using piral-cli 0.13.0 or 0.13.1

Expected behavior

Successful publish

Actual behavior

[11:21:28 AM]: 🚨 [0065] Failed to upload via HTTP: Request body larger than maxBodyLength limit.
(no apparent post request made)

Possible Origin / Solution

See above, possibly an axios default? (yakovkhalinsky/backblaze-b2#45). Our observations indicate no request ever reaches a feed service implementation.

Thanks in advance team! Let me know if theres more information I can provide or anything I can do to help 🍻

@kingb12 kingb12 added the bug Something isn't working label Apr 16, 2021
@FlorianRappl
Copy link
Contributor

We set the content length to Infinity already:

https://github.com/smapiot/piral/blob/develop/src/tooling/piral-cli/src/common/http.ts#L89

I guess its worth also setting the maxBodyLength as you suggest.

I've pushed the change - should be out in a couple of minutes in the preview version @next.

@FlorianRappl FlorianRappl added cli Concerns the piral-cli application. in-testing The item is already out in preview and can be tested. labels Apr 16, 2021
@FlorianRappl FlorianRappl added this to the 0.13.2 milestone Apr 16, 2021
@FlorianRappl
Copy link
Contributor

Just pinging @kingb12 - can you confirm that the issue is fixed in the preview version? Thanks!

@FlorianRappl
Copy link
Contributor

So I guess we can assume its working fine, or @kingb12 ? Thanks!

@kingb12
Copy link
Contributor Author

kingb12 commented Apr 22, 2021

Sorry for losing track of this! Was able to verify this morning, all is working. Thanks for the quick turn-around

@FlorianRappl FlorianRappl removed the in-testing The item is already out in preview and can be tested. label Apr 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working cli Concerns the piral-cli application.
Projects
None yet
Development

No branches or pull requests

2 participants