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

File attachment size #33

Open
mmallejac opened this issue Jul 22, 2020 · 19 comments
Open

File attachment size #33

mmallejac opened this issue Jul 22, 2020 · 19 comments

Comments

@mmallejac
Copy link
Collaborator

Hello Tim,

Hope you're doing good.
I've noticed that attachment size is limited to 1M, most probably the default value for Nginx. Is that on purpose ? I would set it to 10M to address our own needs.

What do you think ?

All the best,
Michel

@timlegge
Copy link
Owner

Someone at work mentioned that recently. Its not limited on purpose. I would say 10 or 20 M would be fine. PR?

Tim

@timlegge
Copy link
Owner

Hi

Looking at

sed /client_max_body_size/s/1m/50m/g /etc/nginx/nginx.conf

TIm

@mmallejac
Copy link
Collaborator Author

mmallejac commented Jul 29, 2020 via email

@mmallejac
Copy link
Collaborator Author

fixed by e0164df

@mmallejac
Copy link
Collaborator Author

Hi Tim,

Attaching files with size up to 50M works fine now, but something is not good here.

Within a new Docker instance, attaching a PDF file is ok but opening it afterwards leads to an error : the browser receives a zero size file, while the file within pub/web/topic is correct.

I see that in the Nginx errorlog file, but not sure to understand it :

172.20.0.1 - - [03/Aug/2020:12:40:34 +0000] "GET /pub/Main/WebHome/8H_AC04.pdf?_t=1596458422 HTTP/1.1" 200 5 "http://localhost:8765/Main/WebHome" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:79.0) Gecko/20100101 Firefox/79.0"

==> foswiki-error.log <==
2020/08/03 12:40:34 [notice] 25#25: *63 "^/pub/(.*)$" matches "/pub/Main/WebHome/8H_AC04.pdf", client: 172.20.0.1, server: _, request: "GET /pub/Main/WebHome/8H_AC04.pdf?_t=1596458422 HTTP/1.1", host: "localhost:8765", referrer: "http://localhost:8765/Main/WebHome"
2020/08/03 12:40:34 [notice] 25#25: *63 rewritten data: "/bin/xsendfile/Main/WebHome/8H_AC04.pdf", args: "_t=1596458422", client: 172.20.0.1, server: _, request: "GET /pub/Main/WebHome/8H_AC04.pdf?_t=1596458422 HTTP/1.1", host: "localhost:8765", referrer: "http://localhost:8765/Main/WebHome"

I've also updated one of my instances, and on this one the behavior is slightly different : while opening the newly attached file, and instead of receiving an empty file, Foswiki answers :

image

On this one, the complete URL is :
https://(myWiki)/pub/Cuisine/MielPissenlit/8H_AC04.pdf?_t=1596449443

If the attached file is a picture, it is correctly shown in the topic, the error occurs when trying to open the attached file from the topic.

Any idea ??

@mmallejac mmallejac reopened this Aug 3, 2020
@timlegge
Copy link
Owner

timlegge commented Aug 3, 2020

Strange - it mentions rewritten data: "/bin/xsendfile/Main/WebHome/8H_AC04.pdf" I wonder if the xsendfile change is related. @MichaelDaum any thoughts?

@timlegge
Copy link
Owner

timlegge commented Aug 4, 2020

@mmallejac this version uses xfilesend do you have the XSendFileContrib enabled?

@mmallejac
Copy link
Collaborator Author

mmallejac commented Aug 4, 2020 via email

@timlegge
Copy link
Owner

timlegge commented Aug 4, 2020 via email

@timlegge
Copy link
Owner

timlegge commented Aug 4, 2020

I removed xsendfilecontrib from my test volume and I get a 502 error. Reinstalling it and the attachment worked ine (refresh the page though with F5 or +)

@mmallejac
Copy link
Collaborator Author

mmallejac commented Aug 4, 2020 via email

@timlegge
Copy link
Owner

timlegge commented Aug 4, 2020 via email

@mmallejac
Copy link
Collaborator Author

mmallejac commented Aug 4, 2020 via email

@timlegge
Copy link
Owner

timlegge commented Aug 5, 2020

I am tracking it down:

$Foswiki::cfg{XSendFileContrib}{Header} = 'X-Accel-Redirect';
$Foswiki::cfg{XSendFileContrib}{Location} = '/files';

Will have more info shortly and a patch

@timlegge
Copy link
Owner

timlegge commented Aug 6, 2020

The problem appears to be that I had the settings in the dockerfile before the Contrib was installed. However, right now the auuto builds at github are failing. If you want to try v1.18 at dockerhub it should be fine

@mmallejac
Copy link
Collaborator Author

Hi Tim,

Si I've juste tested the new image (5797d249fe98).

With exiting data :

  • First I still get the same error " Missing or illegal web name - You are trying to view in a web that does not exist"
  • nothing worth mentioning in the volumes/foswiki_www/working/logs files (nothing about the download tentative)
  • the nginx error log mention xsendfile : 2020/08/06 13:59:19 [notice] 21#21: *50 rewritten data: "/bin/xsendfile/Myweb/MyTopic/Myfile.pdf", ...
  • So I install the XSendFileContrib
  • it looks better : the choosen attached file is sent to the browser, but size is 0
  • no error in the logs (Foswiki and Nginx)

With fresh install :

  • works like a charm

So in my existing instances, I am probably missing another contrib or ?

@timlegge
Copy link
Owner

timlegge commented Aug 6, 2020 via email

@mmallejac
Copy link
Collaborator Author

Hello Tim,

Just did it, and it now works fine with my existing instances ! thanks

Just one minor thing : when deleting an attachment, the "Deleting" message stays, I have then to refresh to have it gone.
But that happens only on existing instances.

@timlegge
Copy link
Owner

@mmallejac Weird about the refresh. I take it the logs don't say much. I will try to reproduce

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants