List for cgit developers and users
 help / color / Atom feed
* Error downloading snapshots from remote sites
@ 2020-05-04  9:45 roy
  2020-05-04 13:23 ` alex_y_xu
  0 siblings, 1 reply; 3+ messages in thread
From: roy @ 2020-05-04  9:45 UTC (permalink / raw)


Hi

I only get this error downloading from a remote VM.
Another user has reported the error here:
https://roy.marples.name/archives/dhcpcd-discuss/0002955.html

Error is a sample error logged by nginx:
I use uwsgi to proxy the cgi to nginx.

*248 open() "/var/db/nginx/uwsgi_temp/6/00/0000000006" failed (13: Permission 
denied) while reading upstream, client: 2001:470:a085:999::80, server: 
roy.marples.name, request: "GET /cgit/dhcpcd.git/snapshot/master.tar.xz 
HTTP/1.1", upstream: "uwsgi://unix:/var/run/uwsgi/cgit.sock:", host: 
"roy.marples.name"

Otherwise this setup works fine.
The user uwsgi/cgit runs as owns the directory /var/db/nginx/uwsgi_temp.

Any pointers on how to fix this?

Thanks

Roy


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Error downloading snapshots from remote sites
  2020-05-04  9:45 Error downloading snapshots from remote sites roy
@ 2020-05-04 13:23 ` alex_y_xu
  2020-05-04 13:29   ` roy
  0 siblings, 1 reply; 3+ messages in thread
From: alex_y_xu @ 2020-05-04 13:23 UTC (permalink / raw)


Excerpts from Roy Marples's message of May 4, 2020 5:45 am:
> Hi
> 
> I only get this error downloading from a remote VM.
> Another user has reported the error here:
> https://roy.marples.name/archives/dhcpcd-discuss/0002955.html
> 
> Error is a sample error logged by nginx:
> I use uwsgi to proxy the cgi to nginx.
> 
> *248 open() "/var/db/nginx/uwsgi_temp/6/00/0000000006" failed (13: Permission 
> denied) while reading upstream, client: 2001:470:a085:999::80, server: 
> roy.marples.name, request: "GET /cgit/dhcpcd.git/snapshot/master.tar.xz 
> HTTP/1.1", upstream: "uwsgi://unix:/var/run/uwsgi/cgit.sock:", host: 
> "roy.marples.name"
> 
> Otherwise this setup works fine.
> The user uwsgi/cgit runs as owns the directory /var/db/nginx/uwsgi_temp.
> 
> Any pointers on how to fix this?
> 
> Thanks
> 
> Roy
> 

nginx buffers large responses to disk by default. most likely your whole
uwsgi buffering is broken, but you only see it with snapshots because
nginx decides that the response cannot fit into memory. in particular, 
/var/db/nginx needs to be owned by the nginx user (nginx/http/www-data), 
not the uwsgi user.

this behavior can be adjusted with various tuning knobs:
https://nginx.org/en/docs/http/ngx_http_uwsgi_module.html. you may want
to set uwsgi_buffering off. however, this prevents some useful features,
including as I recall output compression. you can also try setting
something like location ^ /snapshot/ { uwsgi_buffering off; }. that
won't fix your temp_path issues though, which you will still have if
someone requests some other large file.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Error downloading snapshots from remote sites
  2020-05-04 13:23 ` alex_y_xu
@ 2020-05-04 13:29   ` roy
  0 siblings, 0 replies; 3+ messages in thread
From: roy @ 2020-05-04 13:29 UTC (permalink / raw)


Hi Alex

On 04/05/2020 14:23, Alex Xu (Hello71) wrote:
> Excerpts from Roy Marples's message of May 4, 2020 5:45 am:
>> Hi
>>
>> I only get this error downloading from a remote VM.
>> Another user has reported the error here:
>> https://roy.marples.name/archives/dhcpcd-discuss/0002955.html
>>
>> Error is a sample error logged by nginx:
>> I use uwsgi to proxy the cgi to nginx.
>>
>> *248 open() "/var/db/nginx/uwsgi_temp/6/00/0000000006" failed (13: Permission
>> denied) while reading upstream, client: 2001:470:a085:999::80, server:
>> roy.marples.name, request: "GET /cgit/dhcpcd.git/snapshot/master.tar.xz
>> HTTP/1.1", upstream: "uwsgi://unix:/var/run/uwsgi/cgit.sock:", host:
>> "roy.marples.name"
>>
>> Otherwise this setup works fine.
>> The user uwsgi/cgit runs as owns the directory /var/db/nginx/uwsgi_temp.
>>
>> Any pointers on how to fix this?
>>
>> Thanks
>>
>> Roy
>>
> 
> nginx buffers large responses to disk by default. most likely your whole
> uwsgi buffering is broken, but you only see it with snapshots because
> nginx decides that the response cannot fit into memory. in particular,
> /var/db/nginx needs to be owned by the nginx user (nginx/http/www-data),
> not the uwsgi user.
> 
> this behavior can be adjusted with various tuning knobs:
> https://nginx.org/en/docs/http/ngx_http_uwsgi_module.html. you may want
> to set uwsgi_buffering off. however, this prevents some useful features,
> including as I recall output compression. you can also try setting
> something like location ^ /snapshot/ { uwsgi_buffering off; }. that
> won't fix your temp_path issues though, which you will still have if
> someone requests some other large file.

Thanks for the reply.
It turned out the process needed to access ALL the folders in the path and one 
was locked out.
Discovered thanks to this post:
https://serverfault.com/questions/872271/uwsgi-permission-denied-on-chdir-that-does-have-permissions-for-that-uid

Thanks

Roy


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, back to index

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-04  9:45 Error downloading snapshots from remote sites roy
2020-05-04 13:23 ` alex_y_xu
2020-05-04 13:29   ` roy

List for cgit developers and users

Archives are clonable: git clone --mirror http://inbox.vuxu.org/cgit

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://inbox.vuxu.org/vuxu.archive.cgit


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git