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

Upload fails on big files (>32MB) #28

Open
chiptus opened this issue Oct 11, 2018 · 11 comments
Open

Upload fails on big files (>32MB) #28

chiptus opened this issue Oct 11, 2018 · 11 comments
Labels
bug Something isn't working

Comments

@chiptus
Copy link
Contributor

chiptus commented Oct 11, 2018

When uploading big files, the handler return 404 error with the following message:

{
  "err": "Invalid request payload",
  "details": "Invalid file path"
}

I checked some file sizes and it seems like 32MB is the limit.

@olljanat
Copy link
Contributor

I'm just curious that what you are actually trying upload to there is you need support for that big files?

@deviantony deviantony added the bug Something isn't working label Oct 11, 2018
@deviantony deviantony added this to the 1.2.0 milestone Oct 11, 2018
@deviantony
Copy link
Member

Could be related to portainer/libhttp#1

Especially https://github.com/portainer/libhttp/blob/develop/request/request.go#L44

@kendrickm could you investigate?

@deviantony
Copy link
Member

Did a quick investigation on this, you can get more details about the issue by replacing the browsePutPayload Validate method with this one:

func (payload *browsePutPayload) Validate(r *http.Request) error {
	file, filename, err := request.RetrieveMultiPartFormFile(r, "file")
	if err != nil {
		return err
		// return agent.Error("Invalid uploaded file")
	}
	payload.File = file
	payload.Filename = filename

	path, err := request.RetrieveMultiPartFormValue(r, "Path", false)
	if err != nil {
		return agent.Error("Invalid file path")
	}
	payload.Path = path

	return nil
}

I was not able to figure out more details about this. Not a priority though, I'd rather see #25 closed first.

@deviantony
Copy link
Member

@olljanat just because we give the ability to upload files means that some users will try to upload any kind of files :-)

@olljanat
Copy link
Contributor

Sure but IMO at least on first version it would good enough to give user friendly error message.

Uploading big files is anyway bit tricky as there is many times other components too which user need to take care of. Example on NGINX (which is most common reverse proxy on container world) default upload limit is 1MB.

@deviantony deviantony removed this from the 1.2.0 milestone Oct 12, 2018
@deviantony deviantony added bug Something isn't working and removed bug Something isn't working labels Oct 15, 2018
@vast-z
Copy link

vast-z commented Apr 13, 2020

Hello, I wonder if this problem is solved or is there a solution? Thank u very much.

@deviantony
Copy link
Member

Hi @vast-z we don't have any solution for that issue yet. As it was reported in the comments, some other components (such as reverse proxies) can also limit the request size.

@vast-z
Copy link

vast-z commented Apr 14, 2020

Thank you very much, can you tell me about the reverse proxy part of the project? I can make some modifications myself to use.

@deviantony
Copy link
Member

@vast-z there is no reverse proxy shipped with Portainer. If you are using one (such as haproxy, nginx...) you might need to tune the configuration of the reverse proxy.

If you're not using any (accessing Portainer via IP directly) then this is an issue with the agent that we might need to investigate.

@vast-z
Copy link

vast-z commented Apr 14, 2020

Thank u very much.
Yes, I didn't use a proxy and used ip directly, but the problem I encountered was that a timeout setting in portainer could not upload. I used chrome to slow down the internet speed and then uploaded a small file. After about 7-8 seconds, the connection timeout and turned off. I want to find this timeout setting and I can complete the upload.

@deviantony
Copy link
Member

@vast-z We do not know what might be causing this issue at the moment.

See my two previous comments about this:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants