From lhmwzy at 126.com Tue Jan 2 07:12:11 2018 From: lhmwzy at 126.com (lhmwzy) Date: Tue, 2 Jan 2018 15:12:11 +0800 (CST) Subject: Memory allocation failed Message-ID: <4d3e8354.6e0c.160b5b69ca1.Coremail.lhmwzy@126.com> uname -a: DragonFly lhm.com 5.1-DEVELOPMENT DragonFly v5.1.0.467.gb76875-DEVELOPMENT #0: Wed Dec 20 20:37:51 CST 2017 root at lhm.com:/usr/obj/usr/src/sys/lhmwzy x86_64 ./configure php --module=php7 \ --config=/usr/local/bin/php-config \ --lib-path=/usr/local/lib When run : curl -X PUT -d @config/blogs.json --unix-socket ./control.unit.sock http://10.66.23.99/ output: { "error": "Memory allocation failed." } logs says: 1 2018/01/02 15:04:52 [info] 280908#34366357696 discovery started 2 2018/01/02 15:04:52 [notice] 280908#34366357696 module: php 7.0.26 "build/php7.unit.so" 3 2018/01/02 15:04:52 [notice] 280907#34366357696 process 280908 exited with code 0 4 2018/01/02 15:04:52 [info] 280909#34366357696 controller started 5 2018/01/02 15:04:52 [info] 280910#34366357696 router started 6 2018/01/02 15:05:00 [crit] 280909#34366357696 *3 shm_open(/unit.280909.e8bd919c) failed (13: Permission denied) -------------- next part -------------- An HTML attachment was scrubbed... URL: From lexxua at gmail.com Tue Jan 2 08:57:19 2018 From: lexxua at gmail.com (Volodymyr Fedorov) Date: Tue, 2 Jan 2018 09:57:19 +0100 Subject: How to define callable function for Python webapp in Unit Message-ID: Hi, I have the simple question is there any option to define callable for python script? In uwgi xml config I have following section: start:app But this seems like does not work for Unit. Thanks for any advice. -- Best regards, Volodymyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From vbart at nginx.com Tue Jan 2 12:45:46 2018 From: vbart at nginx.com (Valentin V. Bartenev) Date: Tue, 02 Jan 2018 15:45:46 +0300 Subject: How to define callable function for Python webapp in Unit In-Reply-To: References: Message-ID: <1601762.oDZ2qJNq4a@vbart-laptop> On Tuesday, 2 January 2018 11:57:19 MSK Volodymyr Fedorov wrote: > Hi, I have the simple question is there any option to define callable for > python script? > In uwgi xml config I have following section: > start:app > But this seems like does not work for Unit. > > Thanks for any advice. > There's no way to redefine the callable function name in the Unit configuration at the moment. Such option will be added in the next version. Currently, as a workaround you can create separate modules with the "application()" callable that will call other callables. Thank you for testing. wbr, Valentin V. Bartenev From vbart at nginx.com Tue Jan 2 13:44:56 2018 From: vbart at nginx.com (Valentin V. Bartenev) Date: Tue, 02 Jan 2018 16:44:56 +0300 Subject: Memory allocation failed In-Reply-To: <4d3e8354.6e0c.160b5b69ca1.Coremail.lhmwzy@126.com> References: <4d3e8354.6e0c.160b5b69ca1.Coremail.lhmwzy@126.com> Message-ID: <1650504.KIhbPlAl4Y@vbart-laptop> On Tuesday, 2 January 2018 10:12:11 MSK lhmwzy wrote: > uname -a: > DragonFly lhm.com 5.1-DEVELOPMENT DragonFly v5.1.0.467.gb76875-DEVELOPMENT #0: Wed Dec 20 20:37:51 CST 2017 root at lhm.com:/usr/obj/usr/src/sys/lhmwzy x86_64 > > > ./configure php --module=php7 \ > --config=/usr/local/bin/php-config \ > --lib-path=/usr/local/lib > When run : > curl -X PUT -d @config/blogs.json --unix-socket ./control.unit.sock http://10.66.23.99/ > > output: > { > "error": "Memory allocation failed." > } > logs says: > 1 2018/01/02 15:04:52 [info] 280908#34366357696 discovery started > 2 2018/01/02 15:04:52 [notice] 280908#34366357696 module: php 7.0.26 "build/php7.unit.so" > 3 2018/01/02 15:04:52 [notice] 280907#34366357696 process 280908 exited with code 0 > 4 2018/01/02 15:04:52 [info] 280909#34366357696 controller started > 5 2018/01/02 15:04:52 [info] 280910#34366357696 router started > 6 2018/01/02 15:05:00 [crit] 280909#34366357696 *3 shm_open(/unit.280909.e8bd919c) failed (13: Permission denied) > It seems, DragonFly treats SHM segments as regular files and doesn't create a separate namespace. I assume, the "/tmp" directory should work for you. Please, try the following patch: diff -r 81d135e2f7c9 src/go/unit/nxt_go_port_memory.c --- a/src/go/unit/nxt_go_port_memory.c Mon Jan 01 20:50:57 2018 +0300 +++ b/src/go/unit/nxt_go_port_memory.c Tue Jan 02 16:42:37 2018 +0300 @@ -49,7 +49,7 @@ nxt_go_new_port_mmap(nxt_go_process_t *p return NULL; } - name_len = snprintf(name, sizeof(name) - 1, "/unit.go.%p", name); + name_len = snprintf(name, sizeof(name) - 1, "/tmp/unit.go.%p", name); #if (NXT_HAVE_MEMFD_CREATE) diff -r 81d135e2f7c9 src/nxt_port_memory.c --- a/src/nxt_port_memory.c Mon Jan 01 20:50:57 2018 +0300 +++ b/src/nxt_port_memory.c Tue Jan 02 16:42:37 2018 +0300 @@ -280,7 +280,7 @@ nxt_port_new_port_mmap(nxt_task_t *task, return NULL; } - p = nxt_sprintf(name, name + sizeof(name), "/unit.%PI.%uxD", + p = nxt_sprintf(name, name + sizeof(name), "/tmp/unit.%PI.%uxD", nxt_pid, nxt_random(&task->thread->random)); *p = '\0'; From lhmwzy at 126.com Wed Jan 3 02:55:35 2018 From: lhmwzy at 126.com (lhmwzy) Date: Wed, 3 Jan 2018 10:55:35 +0800 (CST) Subject: Memory allocation failed In-Reply-To: <1650504.KIhbPlAl4Y@vbart-laptop> References: <4d3e8354.6e0c.160b5b69ca1.Coremail.lhmwzy@126.com> <1650504.KIhbPlAl4Y@vbart-laptop> Message-ID: <6eaa6183.3758.160b9f209d0.Coremail.lhmwzy@126.com> Yes,that's Ok. At 2018-01-02 21:44:56, "Valentin V. Bartenev" wrote: >On Tuesday, 2 January 2018 10:12:11 MSK lhmwzy wrote: >> uname -a: >> DragonFly lhm.com 5.1-DEVELOPMENT DragonFly v5.1.0.467.gb76875-DEVELOPMENT #0: Wed Dec 20 20:37:51 CST 2017 root at lhm.com:/usr/obj/usr/src/sys/lhmwzy x86_64 >> >> >> ./configure php --module=php7 \ >> --config=/usr/local/bin/php-config \ >> --lib-path=/usr/local/lib >> When run : >> curl -X PUT -d @config/blogs.json --unix-socket ./control.unit.sock http://10.66.23.99/ >> >> output: >> { >> "error": "Memory allocation failed." >> } >> logs says: >> 1 2018/01/02 15:04:52 [info] 280908#34366357696 discovery started >> 2 2018/01/02 15:04:52 [notice] 280908#34366357696 module: php 7.0.26 "build/php7.unit.so" >> 3 2018/01/02 15:04:52 [notice] 280907#34366357696 process 280908 exited with code 0 >> 4 2018/01/02 15:04:52 [info] 280909#34366357696 controller started >> 5 2018/01/02 15:04:52 [info] 280910#34366357696 router started >> 6 2018/01/02 15:05:00 [crit] 280909#34366357696 *3 shm_open(/unit.280909.e8bd919c) failed (13: Permission denied) >> > > >It seems, DragonFly treats SHM segments as regular files >and doesn't create a separate namespace. > >I assume, the "/tmp" directory should work for you. > >Please, try the following patch: > >diff -r 81d135e2f7c9 src/go/unit/nxt_go_port_memory.c >--- a/src/go/unit/nxt_go_port_memory.c Mon Jan 01 20:50:57 2018 +0300 >+++ b/src/go/unit/nxt_go_port_memory.c Tue Jan 02 16:42:37 2018 +0300 >@@ -49,7 +49,7 @@ nxt_go_new_port_mmap(nxt_go_process_t *p > return NULL; > } > >- name_len = snprintf(name, sizeof(name) - 1, "/unit.go.%p", name); >+ name_len = snprintf(name, sizeof(name) - 1, "/tmp/unit.go.%p", name); > > #if (NXT_HAVE_MEMFD_CREATE) > >diff -r 81d135e2f7c9 src/nxt_port_memory.c >--- a/src/nxt_port_memory.c Mon Jan 01 20:50:57 2018 +0300 >+++ b/src/nxt_port_memory.c Tue Jan 02 16:42:37 2018 +0300 >@@ -280,7 +280,7 @@ nxt_port_new_port_mmap(nxt_task_t *task, > return NULL; > } > >- p = nxt_sprintf(name, name + sizeof(name), "/unit.%PI.%uxD", >+ p = nxt_sprintf(name, name + sizeof(name), "/tmp/unit.%PI.%uxD", > nxt_pid, nxt_random(&task->thread->random)); > *p = '\0'; > > > >_______________________________________________ >unit mailing list >unit at nginx.org >https://mailman.nginx.org/mailman/listinfo/unit -------------- next part -------------- An HTML attachment was scrubbed... URL: From lhmwzy at 126.com Sun Jan 7 08:14:14 2018 From: lhmwzy at 126.com (lhmwzy) Date: Sun, 7 Jan 2018 16:14:14 +0800 (CST) Subject: Can't run phpmyadmin under nginxunit In-Reply-To: <6eaa6183.3758.160b9f209d0.Coremail.lhmwzy@126.com> References: <4d3e8354.6e0c.160b5b69ca1.Coremail.lhmwzy@126.com> <1650504.KIhbPlAl4Y@vbart-laptop> <6eaa6183.3758.160b9f209d0.Coremail.lhmwzy@126.com> Message-ID: <34951d04.21b7.160cfaf3431.Coremail.lhmwzy@126.com> # cat config/blogs.json { "listeners": { "*:8300": { "application": "blog" } }, "applications": { "blog": { "type": "php", "workers": 20, "root": "/home/www/phpmyadmin/", "index": "index.php" } } } # curl -X PUT -d @config/blogs.json --unix-socket ./control.unit.sock http://10.66.23.99:8300 { "success": "Reconfiguration done." } But when access http://10.66.23.99:8300 the page is blank. the app which run is https://www.phpmyadmin.net/. -------------- next part -------------- An HTML attachment was scrubbed... URL: From vbart at nginx.com Sun Jan 7 17:59:22 2018 From: vbart at nginx.com (Valentin V. Bartenev) Date: Sun, 07 Jan 2018 20:59:22 +0300 Subject: Can't run phpmyadmin under nginxunit In-Reply-To: <34951d04.21b7.160cfaf3431.Coremail.lhmwzy@126.com> References: <4d3e8354.6e0c.160b5b69ca1.Coremail.lhmwzy@126.com> <6eaa6183.3758.160b9f209d0.Coremail.lhmwzy@126.com> <34951d04.21b7.160cfaf3431.Coremail.lhmwzy@126.com> Message-ID: <6087891.6tSEu1k9Cm@vbart-laptop> On Sunday, 7 January 2018 11:14:14 MSK lhmwzy wrote: > # cat config/blogs.json > { > "listeners": { > "*:8300": { > "application": "blog" > } > }, > "applications": { > "blog": { > "type": "php", > "workers": 20, > "root": "/home/www/phpmyadmin/", > "index": "index.php" > } > } > } > # curl -X PUT -d @config/blogs.json --unix-socket ./control.unit.sock http://10.66.23.99:8300 > { > "success": "Reconfiguration done." > } > But when access http://10.66.23.99:8300 > the page is blank. > the app which run is https://www.phpmyadmin.net/. What's in the unit.log? wbr, Valentin V. Bartenev From lhmwzy at 126.com Fri Jan 12 03:25:30 2018 From: lhmwzy at 126.com (lhmwzy) Date: Fri, 12 Jan 2018 11:25:30 +0800 (CST) Subject: Can't run phpmyadmin under nginxunit In-Reply-To: <6087891.6tSEu1k9Cm@vbart-laptop> References: <4d3e8354.6e0c.160b5b69ca1.Coremail.lhmwzy@126.com> <6eaa6183.3758.160b9f209d0.Coremail.lhmwzy@126.com> <34951d04.21b7.160cfaf3431.Coremail.lhmwzy@126.com> <6087891.6tSEu1k9Cm@vbart-laptop> Message-ID: <4d5cdd10.3872.160e866a878.Coremail.lhmwzy@126.com> cat config/blogs.json
{
"listeners": {
"*:8300": {
"application": "blog"
}
},
"applications": {
"blog": {
"type": "php",
"workers": 20,
"root": "/home/www/phpmyadmin",
"index": "index.php"
}
}
}

curl -X PUT -d @config/blogs.json \
--unix-socket ./control.unit.sock http://127.0.0.1


nginx.conf:

.....
upstream nginxunit {
server 127.0.0.1:8300;
}
......

server {
listen 8008;
root /home/www/;
location / {
index index.html index.php;
}
location ~ \.php$ {
proxy_pass http://nginxunit;
proxy_set_header Host $host;
#proxy_redirect http://$host:$server_port/;
}
}

phpmyadmin is in /home/www
then access http://xx:8008/phpmyadmin
the page is blank;
cat unit.log:
2018/01/12 11:04:12 [info] 1600#34366357696 discovery started
2018/01/12 11:04:12 [notice] 1600#34366357696 module: php 7.0.26 "build/php7.unit.so"
2018/01/12 11:04:12 [info] 1601#34366357696 controller started
2018/01/12 11:04:12 [notice] 1599#34366357696 process 1600 exited with code 0
2018/01/12 11:04:12 [info] 1602#34366357696 router started
2018/01/12 11:06:20 [info] 1611#34366357696 "blog" application started
2018/01/12 11:06:20 [info] 1611#34366357696 (non ABS_MODE) php root: "/home/www/phpmyadmin"
2018/01/12 11:07:14 [notice] 1599#34366357696 process 1611 exited with code 0
2018/01/12 11:07:17 [info] 1617#34366357696 "blog" application started
2018/01/12 11:07:17 [info] 1617#34366357696 (non ABS_MODE) php root: "/home/www/phpmyadmin" At 2018-01-08 01:59:22, "Valentin V. Bartenev" wrote: >On Sunday, 7 January 2018 11:14:14 MSK lhmwzy wrote: >> # cat config/blogs.json >> { >> "listeners": { >> "*:8300": { >> "application": "blog" >> } >> }, >> "applications": { >> "blog": { >> "type": "php", >> "workers": 20, >> "root": "/home/www/phpmyadmin/", >> "index": "index.php" >> } >> } >> } >> # curl -X PUT -d @config/blogs.json --unix-socket ./control.unit.sock http://10.66.23.99:8300 >> { >> "success": "Reconfiguration done." >> } >> But when access http://10.66.23.99:8300 >> the page is blank. >> the app which run is https://www.phpmyadmin.net/. > >What's in the unit.log? > > wbr, Valentin V. Bartenev > >_______________________________________________ >unit mailing list >unit at nginx.org >https://mailman.nginx.org/mailman/listinfo/unit From lhmwzy at 126.com Fri Jan 12 03:32:19 2018 From: lhmwzy at 126.com (lhmwzy) Date: Fri, 12 Jan 2018 11:32:19 +0800 (CST) Subject: Can't run phpmyadmin under nginxunit In-Reply-To: <6087891.6tSEu1k9Cm@vbart-laptop> References: <4d3e8354.6e0c.160b5b69ca1.Coremail.lhmwzy@126.com> <6eaa6183.3758.160b9f209d0.Coremail.lhmwzy@126.com> <34951d04.21b7.160cfaf3431.Coremail.lhmwzy@126.com> <6087891.6tSEu1k9Cm@vbart-laptop> Message-ID: <2f5cb83c.3a2b.160e86ce8a9.Coremail.lhmwzy@126.com> cat config/blogs.json { "listeners": { "*:8300": { "application": "blog" } }, "applications": { "blog": { "type": "php", "workers": 20, "root": "/home/www", "index": "index.php" } } } access http://xx:8008/phpmyadmin/ gives 502 Bad Gateway. cat unit.log 2018/01/12 11:04:12 [info] 1600#34366357696 discovery started 2018/01/12 11:04:12 [notice] 1600#34366357696 module: php 7.0.26 "build/php7.unit.so" 2018/01/12 11:04:12 [info] 1601#34366357696 controller started 2018/01/12 11:04:12 [notice] 1599#34366357696 process 1600 exited with code 0 2018/01/12 11:04:12 [info] 1602#34366357696 router started 2018/01/12 11:06:20 [info] 1611#34366357696 "blog" application started 2018/01/12 11:06:20 [info] 1611#34366357696 (non ABS_MODE) php root: "/home/www/phpmyadmin" 2018/01/12 11:07:14 [notice] 1599#34366357696 process 1611 exited with code 0 2018/01/12 11:07:17 [info] 1617#34366357696 "blog" application started 2018/01/12 11:07:17 [info] 1617#34366357696 (non ABS_MODE) php root: "/home/www/phpmyadmin" 2018/01/12 11:29:36 [notice] 1599#34366357696 process 1617 exited with code 0 2018/01/12 11:29:55 [info] 1873#34366357696 "blog" application started 2018/01/12 11:29:55 [info] 1873#34366357696 (non ABS_MODE) php root: "/home/www" 2018/01/12 11:30:07 [crit] 1873#34366357696 sendmsg(9, -1, 2) failed (32: Broken pipe) 2018/01/12 11:30:07 [crit] 1599#34366357696 process 1602 exited on signal 11 2018/01/12 11:30:07 [info] 1876#34366357696 router started 2018/01/12 11:30:07 [crit] 1873#34366357696 sendmsg(9, -1, 2) failed (32: Broken pipe) 2018/01/12 11:30:09 [info] 1877#34366357696 "blog" application started 2018/01/12 11:30:09 [info] 1877#34366357696 (non ABS_MODE) php root: "/home/www" 2018/01/12 11:30:10 [crit] 1599#34366357696 process 1876 exited on signal 11 2018/01/12 11:30:10 [info] 1878#34366357696 router started -------------- next part -------------- An HTML attachment was scrubbed... URL: From vbart at nginx.com Fri Jan 12 21:36:07 2018 From: vbart at nginx.com (Valentin V. Bartenev) Date: Sat, 13 Jan 2018 00:36:07 +0300 Subject: Can't run phpmyadmin under nginxunit In-Reply-To: <2f5cb83c.3a2b.160e86ce8a9.Coremail.lhmwzy@126.com> References: <4d3e8354.6e0c.160b5b69ca1.Coremail.lhmwzy@126.com> <6087891.6tSEu1k9Cm@vbart-laptop> <2f5cb83c.3a2b.160e86ce8a9.Coremail.lhmwzy@126.com> Message-ID: <2095706.FVM5TR7mcX@vbart-laptop> On Friday, 12 January 2018 06:32:19 MSK lhmwzy wrote: [..] > 2018/01/12 11:30:07 [crit] 1873#34366357696 sendmsg(9, -1, 2) failed (32: Broken pipe) > 2018/01/12 11:30:07 [crit] 1599#34366357696 process 1602 exited on signal 11 > 2018/01/12 11:30:07 [info] 1876#34366357696 router started > 2018/01/12 11:30:07 [crit] 1873#34366357696 sendmsg(9, -1, 2) failed (32: Broken pipe) > 2018/01/12 11:30:09 [info] 1877#34366357696 "blog" application started > 2018/01/12 11:30:09 [info] 1877#34366357696 (non ABS_MODE) php root: "/home/www" > 2018/01/12 11:30:10 [crit] 1599#34366357696 process 1876 exited on signal 11 > 2018/01/12 11:30:10 [info] 1878#34366357696 router started > This bug should be fixed already in current version 0.4, which is planned to be released on Monday. Or you can build it right now out of the source repository: hg clone https://hg.nginx.org/unit or git clone https://github.com/nginx/unit.git or https://hg.nginx.org/unit/archive/tip.tar.gz wbr, Valentin V. Bartenev From lhmwzy at 126.com Sun Jan 14 07:59:15 2018 From: lhmwzy at 126.com (lhmwzy) Date: Sun, 14 Jan 2018 15:59:15 +0800 (CST) Subject: XHR request return 502 In-Reply-To: <2095706.FVM5TR7mcX@vbart-laptop> References: <4d3e8354.6e0c.160b5b69ca1.Coremail.lhmwzy@126.com> <6087891.6tSEu1k9Cm@vbart-laptop> <2f5cb83c.3a2b.160e86ce8a9.Coremail.lhmwzy@126.com> <2095706.FVM5TR7mcX@vbart-laptop> Message-ID: <492ae3d3.1754.160f3ae0364.Coremail.lhmwzy@126.com> When access through chrome: Request URL: http://10.69.124.88:8008/test/index.php?user-app-login Request Method: POST Status Code: 502 Bad Gateway Remote Address: 10.69.124.88:8008 Referrer Policy: no-referrer-when-downgrade Response Headersview source Connection: keep-alive Content-Length: 581 Content-Type: text/html Date: Sun, 14 Jan 2018 07:53:19 GMT Server: openresty/1.13.6.1 Request Headersview source Accept: */* Accept-Encoding: gzip, deflate Accept-Language: zh-CN,zh;q=0.9 Connection: keep-alive Content-Length: 145 Content-Type: application/x-www-form-urlencoded; charset=UTF-8 Cookie: PHPSESSID=d07e10f0f2fdeaab6d4b0f60b8cee871; exam_psid=d07e10f0f2fdeaab6d4b0f60b8cee871; exam_currentuser=%25D9%25A8q%259E%25F4%25DF%25AD%259DckT%25A3%2595%25A5%25EB%25D7%25A8%25D2%25EE%25DF%25D8%25DE%2599%2595Tk%25A3l%25AA%25A8%255B%259C%25B1%258E%25AE%25DFjbgjR%25A5%25DD%25E1%25AC%25CD%25E8%25DA%25E3%25CD%25A3%25A4%25A9%259F%25A2%2596%259A%25A9%25AC%259E%25AC%259E%25AD%258E%2595bb%2591%2594%2595%25AB%25A7m%259D%25DB%25CD%25A8%25A5%2591%2593%2594%2595eh%25DD%259En%259B%25DF%259E%25A3%25D2hie%2595Rm%25EB%25A8r%259E%259B%25DF%25D8%25DF%25A3%259A%25A1%259E%2599%25A2%259A%25A9%25AC%259E%25B2%25A6%2595%259Dbh%2560%2560%255Eb%25A6%259F%255B%259F%25EC%25A6%25A4%25A0jS%25A5%2595%25A3%25A5%25E1%25DD%25A7%25CB%25EB%25DB%25E8%25DC%2599%2595Tk%25A3l%25A9%25A8%255B%259C%259B%25A7%25E6%25A6aglR%25A3%2597%25EB%25E1%25A2%25D3%25E7%25D8%25E2%25D3%2599%259F%25A6%2599%259D%2597%259A%25A9%25A2%259E%25AA%25A1%25A4%25A1ibgb%2560i%25B3%25E1s%2595%25AE%25A6%2595%25DF%2595%25A4%25A5%2599%259F%25A0%25ED%25E1%259E%25D6%25E7%25CD%25E0%25D1Rl%25A5jil%259AS%25C1%25FC_%2B%251DR%25C8%25BFTk%25A3l%25A9%25A4s%2586%25EC%25D1%25E6%25DF%2599%25A0%25A0%25A4%2599%259F%25DD%25DA%25A2%25D1%25E2%25E0%2595%25A7%2599kceag%25B1%259Fn%2596%25A9%25A3%25AE%25DFjjlR%25A3%2597%25EB%25E1%25A2%25D3%25E7%25D5%25D7%258Ek%25A4lcbl%259A%25D2i%259B%25DE%259D%25A3%25D2%2560%2597d%2596%2594%2597%25D9%25CF%259B%259A%25DD%25A0%25D5%259C%2596gb%2592h%2595%25DD%25D3q%259B%25AA%258E%25AE%25E9 Host: 10.69.124.88:8008 Origin: http://10.69.124.88:8008 Referer: http://10.69.124.88:8008/test/index.php?user-app-login User-Agent: Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36 X-Requested-With: XMLHttpRequest Query String Parametersview sourceview URL encoded user-app-login: Form Dataview sourceview URL encoded args[username]:lhm args[userpassword]: 123456 userlogin: 1 userhash: 0.29749395570341153 userhash: 0.4738217323310716 return 502 Bad Gateway ---------- access by curl: curl "http://10.69.124.88:8008/test/index.php?user-app-login" -H "Cookie: PHPSESSID=d07e10f0f2fdeaab6d4b0f60b8cee871; exam_psid=d07e10f0f2fdeaab6d4b0f60b8cee871; exam_currentuser=^%^25D9^%^25A8q^%^259E^%^25F4^%^25DF^%^25AD^%^259DckT^%^25A3^%^2595^%^25A5^%^25EB^%^25D7^%^25A8^%^25D2^%^25EE^%^25DF^%^25D8^%^25DE^%^2599^%^2595Tk^%^25A3l^%^25AA^%^25A8^%^255B^%^259C^%^25B1^%^258E^%^25AE^%^25DFjbgjR^%^25A5^%^25DD^%^25E1^%^25AC^%^25CD^%^25E8^%^25DA^%^25E3^%^25CD^%^25A3^%^25A4^%^25A9^%^259F^%^25A2^%^2596^%^259A^%^25A9^%^25AC^%^259E^%^25AC^%^259E^%^25AD^%^258E^%^2595bb^%^2591^%^2594^%^2595^%^25AB^%^25A7m^%^259D^%^25DB^%^25CD^%^25A8^%^25A5^%^2591^%^2593^%^2594^%^2595eh^%^25DD^%^259En^%^259B^%^25DF^%^259E^%^25A3^%^25D2hie^%^2595Rm^%^25EB^%^25A8r^%^259E^%^259B^%^25DF^%^25D8^%^25DF^%^25A3^%^259A^%^25A1^%^259E^%^2599^%^25A2^%^259A^%^25A9^%^25AC^%^259E^%^25B2^%^25A6^%^2595^%^259Dbh^%^2560^%^2560^%^255Eb^%^25A6^%^259F^%^255B^%^259F^%^25EC^%^25A6^%^25A4^%^25A0jS^%^25A5^%^2595^%^25A3^%^25A5^%^25E1^%^25DD^%^25A7^%^25CB^%^25EB^%^25DB^%^25E8^%^25DC^%^2599^%^2595Tk^%^25A3l^%^25A9^%^25A8^%^255B^%^259C^%^259B^%^25A7^%^25E6^%^25A6aglR^%^25A3^%^2597^%^25EB^%^25E1^%^25A2^%^25D3^%^25E7^%^25D8^%^25E2^%^25D3^%^2599^%^259F^%^25A6^%^2599^%^259D^%^2597^%^259A^%^25A9^%^25A2^%^259E^%^25AA^%^25A1^%^25A4^%^25A1ibgb^%^2560i^%^25B3^%^25E1s^%^2595^%^25AE^%^25A6^%^2595^%^25DF^%^2595^%^25A4^%^25A5^%^2599^%^259F^%^25A0^%^25ED^%^25E1^%^259E^%^25D6^%^25E7^%^25CD^%^25E0^%^25D1Rl^%^25A5jil^%^259AS^%^25C1^%^25FC_^%^2B^%^251DR^%^25C8^%^25BFTk^%^25A3l^%^25A9^%^25A4s^%^2586^%^25EC^%^25D1^%^25E6^%^25DF^%^2599^%^25A0^%^25A0^%^25A4^%^2599^%^259F^%^25DD^%^25DA^%^25A2^%^25D1^%^25E2^%^25E0^%^2595^%^25A7^%^2599kceag^%^25B1^%^259Fn^%^2596^%^25A9^%^25A3^%^25AE^%^25DFjjlR^%^25A3^%^2597^%^25EB^%^25E1^%^25A2^%^25D3^%^25E7^%^25D5^%^25D7^%^258Ek^%^25A4lcbl^%^259A^%^25D2i^%^259B^%^25DE^%^259D^%^25A3^%^25D2^%^2560^%^2597d^%^2596^%^2594^%^2597^%^25D9^%^25CF^%^259B^%^259A^%^25DD^%^25A0^%^25D5^%^259C^%^2596gb^%^2592h^%^2595^%^25DD^%^25D3q^%^259B^%^25AA^%^258E^%^25AE^%^25E9" -H "Origin: http://10.69.124.88:8008" -H "Accept-Encoding: gzip, deflate" -H "Accept-Language: zh-CN,zh;q=0.9" -H "User-Agent: Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36" -H "Content-Type: application/x-www-form-urlencoded; charset=UTF-8" -H "Accept: */*" -H "Referer: http://10.69.124.88:8008/test/index.php?user-app-login" -H "X-Requested-With: XMLHttpRequest" -H "Connection: keep-alive" --data "args^%^5Busername^%^5D=^%^E5^%^88^%^98^%^E6^%^B4^%^AA^%^E6^%^98^%^8E^&args^%^5Buserpassword^%^5D=123456^&userlogin=1^&userhash=0.41284224765651256^&userhash=0.0678490920620114" --compressed the return is OK: {"statusCode":300,"errorinput":"args[username]","message":"\u767b\u5f55\u5931\u8d25\uff0c\u56e0\u4e3a\u7528\u6237\u540d\u4e0d\u5b58\u5728"} cat unit.log: 2018/01/14 15:32:31 [notice] 15142#34366357696 module: php 7.0.26 "build/php70.unit.so" 2018/01/14 15:32:31 [info] 15143#34366357696 controller started 2018/01/14 15:32:31 [notice] 15141#34366357696 process 15142 exited with code 0 2018/01/14 15:32:31 [info] 15144#34366357696 router started 2018/01/14 15:32:36 [info] 15146#34366357696 "blog" application started 2018/01/14 15:32:36 [info] 15146#34366357696 (non ABS_MODE) php root: "/home/www" 2018/01/14 15:33:41 [info] 15147#34366357696 "blog" application started 2018/01/14 15:33:41 [info] 15147#34366357696 (non ABS_MODE) php root: "/home/www" -------------- next part -------------- An HTML attachment was scrubbed... URL: From lhmwzy at 126.com Sun Jan 14 07:59:16 2018 From: lhmwzy at 126.com (lhmwzy) Date: Sun, 14 Jan 2018 15:59:16 +0800 (CST) Subject: XHR request return 502 In-Reply-To: <2095706.FVM5TR7mcX@vbart-laptop> References: <4d3e8354.6e0c.160b5b69ca1.Coremail.lhmwzy@126.com> <6087891.6tSEu1k9Cm@vbart-laptop> <2f5cb83c.3a2b.160e86ce8a9.Coremail.lhmwzy@126.com> <2095706.FVM5TR7mcX@vbart-laptop> Message-ID: When access through chrome: Request URL: http://10.69.124.88:8008/test/index.php?user-app-login Request Method: POST Status Code: 502 Bad Gateway Remote Address: 10.69.124.88:8008 Referrer Policy: no-referrer-when-downgrade Response Headersview source Connection: keep-alive Content-Length: 581 Content-Type: text/html Date: Sun, 14 Jan 2018 07:53:19 GMT Server: openresty/1.13.6.1 Request Headersview source Accept: */* Accept-Encoding: gzip, deflate Accept-Language: zh-CN,zh;q=0.9 Connection: keep-alive Content-Length: 145 Content-Type: application/x-www-form-urlencoded; charset=UTF-8 Cookie: PHPSESSID=d07e10f0f2fdeaab6d4b0f60b8cee871; exam_psid=d07e10f0f2fdeaab6d4b0f60b8cee871; exam_currentuser=%25D9%25A8q%259E%25F4%25DF%25AD%259DckT%25A3%2595%25A5%25EB%25D7%25A8%25D2%25EE%25DF%25D8%25DE%2599%2595Tk%25A3l%25AA%25A8%255B%259C%25B1%258E%25AE%25DFjbgjR%25A5%25DD%25E1%25AC%25CD%25E8%25DA%25E3%25CD%25A3%25A4%25A9%259F%25A2%2596%259A%25A9%25AC%259E%25AC%259E%25AD%258E%2595bb%2591%2594%2595%25AB%25A7m%259D%25DB%25CD%25A8%25A5%2591%2593%2594%2595eh%25DD%259En%259B%25DF%259E%25A3%25D2hie%2595Rm%25EB%25A8r%259E%259B%25DF%25D8%25DF%25A3%259A%25A1%259E%2599%25A2%259A%25A9%25AC%259E%25B2%25A6%2595%259Dbh%2560%2560%255Eb%25A6%259F%255B%259F%25EC%25A6%25A4%25A0jS%25A5%2595%25A3%25A5%25E1%25DD%25A7%25CB%25EB%25DB%25E8%25DC%2599%2595Tk%25A3l%25A9%25A8%255B%259C%259B%25A7%25E6%25A6aglR%25A3%2597%25EB%25E1%25A2%25D3%25E7%25D8%25E2%25D3%2599%259F%25A6%2599%259D%2597%259A%25A9%25A2%259E%25AA%25A1%25A4%25A1ibgb%2560i%25B3%25E1s%2595%25AE%25A6%2595%25DF%2595%25A4%25A5%2599%259F%25A0%25ED%25E1%259E%25D6%25E7%25CD%25E0%25D1Rl%25A5jil%259AS%25C1%25FC_%2B%251DR%25C8%25BFTk%25A3l%25A9%25A4s%2586%25EC%25D1%25E6%25DF%2599%25A0%25A0%25A4%2599%259F%25DD%25DA%25A2%25D1%25E2%25E0%2595%25A7%2599kceag%25B1%259Fn%2596%25A9%25A3%25AE%25DFjjlR%25A3%2597%25EB%25E1%25A2%25D3%25E7%25D5%25D7%258Ek%25A4lcbl%259A%25D2i%259B%25DE%259D%25A3%25D2%2560%2597d%2596%2594%2597%25D9%25CF%259B%259A%25DD%25A0%25D5%259C%2596gb%2592h%2595%25DD%25D3q%259B%25AA%258E%25AE%25E9 Host: 10.69.124.88:8008 Origin: http://10.69.124.88:8008 Referer: http://10.69.124.88:8008/test/index.php?user-app-login User-Agent: Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36 X-Requested-With: XMLHttpRequest Query String Parametersview sourceview URL encoded user-app-login: Form Dataview sourceview URL encoded args[username]:lhm args[userpassword]: 123456 userlogin: 1 userhash: 0.29749395570341153 userhash: 0.4738217323310716 return 502 Bad Gateway ---------- access by curl: curl "http://10.69.124.88:8008/test/index.php?user-app-login" -H "Cookie: PHPSESSID=d07e10f0f2fdeaab6d4b0f60b8cee871; exam_psid=d07e10f0f2fdeaab6d4b0f60b8cee871; exam_currentuser=^%^25D9^%^25A8q^%^259E^%^25F4^%^25DF^%^25AD^%^259DckT^%^25A3^%^2595^%^25A5^%^25EB^%^25D7^%^25A8^%^25D2^%^25EE^%^25DF^%^25D8^%^25DE^%^2599^%^2595Tk^%^25A3l^%^25AA^%^25A8^%^255B^%^259C^%^25B1^%^258E^%^25AE^%^25DFjbgjR^%^25A5^%^25DD^%^25E1^%^25AC^%^25CD^%^25E8^%^25DA^%^25E3^%^25CD^%^25A3^%^25A4^%^25A9^%^259F^%^25A2^%^2596^%^259A^%^25A9^%^25AC^%^259E^%^25AC^%^259E^%^25AD^%^258E^%^2595bb^%^2591^%^2594^%^2595^%^25AB^%^25A7m^%^259D^%^25DB^%^25CD^%^25A8^%^25A5^%^2591^%^2593^%^2594^%^2595eh^%^25DD^%^259En^%^259B^%^25DF^%^259E^%^25A3^%^25D2hie^%^2595Rm^%^25EB^%^25A8r^%^259E^%^259B^%^25DF^%^25D8^%^25DF^%^25A3^%^259A^%^25A1^%^259E^%^2599^%^25A2^%^259A^%^25A9^%^25AC^%^259E^%^25B2^%^25A6^%^2595^%^259Dbh^%^2560^%^2560^%^255Eb^%^25A6^%^259F^%^255B^%^259F^%^25EC^%^25A6^%^25A4^%^25A0jS^%^25A5^%^2595^%^25A3^%^25A5^%^25E1^%^25DD^%^25A7^%^25CB^%^25EB^%^25DB^%^25E8^%^25DC^%^2599^%^2595Tk^%^25A3l^%^25A9^%^25A8^%^255B^%^259C^%^259B^%^25A7^%^25E6^%^25A6aglR^%^25A3^%^2597^%^25EB^%^25E1^%^25A2^%^25D3^%^25E7^%^25D8^%^25E2^%^25D3^%^2599^%^259F^%^25A6^%^2599^%^259D^%^2597^%^259A^%^25A9^%^25A2^%^259E^%^25AA^%^25A1^%^25A4^%^25A1ibgb^%^2560i^%^25B3^%^25E1s^%^2595^%^25AE^%^25A6^%^2595^%^25DF^%^2595^%^25A4^%^25A5^%^2599^%^259F^%^25A0^%^25ED^%^25E1^%^259E^%^25D6^%^25E7^%^25CD^%^25E0^%^25D1Rl^%^25A5jil^%^259AS^%^25C1^%^25FC_^%^2B^%^251DR^%^25C8^%^25BFTk^%^25A3l^%^25A9^%^25A4s^%^2586^%^25EC^%^25D1^%^25E6^%^25DF^%^2599^%^25A0^%^25A0^%^25A4^%^2599^%^259F^%^25DD^%^25DA^%^25A2^%^25D1^%^25E2^%^25E0^%^2595^%^25A7^%^2599kceag^%^25B1^%^259Fn^%^2596^%^25A9^%^25A3^%^25AE^%^25DFjjlR^%^25A3^%^2597^%^25EB^%^25E1^%^25A2^%^25D3^%^25E7^%^25D5^%^25D7^%^258Ek^%^25A4lcbl^%^259A^%^25D2i^%^259B^%^25DE^%^259D^%^25A3^%^25D2^%^2560^%^2597d^%^2596^%^2594^%^2597^%^25D9^%^25CF^%^259B^%^259A^%^25DD^%^25A0^%^25D5^%^259C^%^2596gb^%^2592h^%^2595^%^25DD^%^25D3q^%^259B^%^25AA^%^258E^%^25AE^%^25E9" -H "Origin: http://10.69.124.88:8008" -H "Accept-Encoding: gzip, deflate" -H "Accept-Language: zh-CN,zh;q=0.9" -H "User-Agent: Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36" -H "Content-Type: application/x-www-form-urlencoded; charset=UTF-8" -H "Accept: */*" -H "Referer: http://10.69.124.88:8008/test/index.php?user-app-login" -H "X-Requested-With: XMLHttpRequest" -H "Connection: keep-alive" --data "args^%^5Busername^%^5D=^%^E5^%^88^%^98^%^E6^%^B4^%^AA^%^E6^%^98^%^8E^&args^%^5Buserpassword^%^5D=123456^&userlogin=1^&userhash=0.41284224765651256^&userhash=0.0678490920620114" --compressed the return is OK: {"statusCode":300,"errorinput":"args[username]","message":"\u767b\u5f55\u5931\u8d25\uff0c\u56e0\u4e3a\u7528\u6237\u540d\u4e0d\u5b58\u5728"} cat unit.log: 2018/01/14 15:32:31 [notice] 15142#34366357696 module: php 7.0.26 "build/php70.unit.so" 2018/01/14 15:32:31 [info] 15143#34366357696 controller started 2018/01/14 15:32:31 [notice] 15141#34366357696 process 15142 exited with code 0 2018/01/14 15:32:31 [info] 15144#34366357696 router started 2018/01/14 15:32:36 [info] 15146#34366357696 "blog" application started 2018/01/14 15:32:36 [info] 15146#34366357696 (non ABS_MODE) php root: "/home/www" 2018/01/14 15:33:41 [info] 15147#34366357696 "blog" application started 2018/01/14 15:33:41 [info] 15147#34366357696 (non ABS_MODE) php root: "/home/www" -------------- next part -------------- An HTML attachment was scrubbed... URL: From vbart at nginx.com Sun Jan 14 13:50:38 2018 From: vbart at nginx.com (Valentin V. Bartenev) Date: Sun, 14 Jan 2018 16:50:38 +0300 Subject: XHR request return 502 In-Reply-To: References: <4d3e8354.6e0c.160b5b69ca1.Coremail.lhmwzy@126.com> <2095706.FVM5TR7mcX@vbart-laptop> Message-ID: <1880555.oUS3WsSjY7@vbart-laptop> On Sunday, 14 January 2018 10:59:16 MSK lhmwzy wrote: [..] > Server: > openresty/1.13.6.1 [..] This is not Unit returning 502, but openresty. You should find out why it returns 502 in its own error log. wbr, Valentin V. Bartenev From vbart at nginx.com Mon Jan 15 15:38:23 2018 From: vbart at nginx.com (Valentin V. Bartenev) Date: Mon, 15 Jan 2018 18:38:23 +0300 Subject: Unit 0.4 beta release Message-ID: <43318614.IOMKgTIORT@vbart-workstation> Hello, I'm glad to announce a new beta of NGINX Unit. This is mostly bugfix release in order to eliminate significant regressions in the previous version. Changes with Unit 0.4 15 Jan 2018 *) Feature: compatibility with DragonFly BSD. *) Feature: "configure php --lib-static" option. *) Bugfix: HTTP request body was not passed to application; the bug had appeared in 0.3. *) Bugfix: HTTP large header buffers allocation and deallocation fixed; the bug had appeared in 0.3. *) Bugfix: some PHP applications might not work with relative "root" path. You can find links to the source code and precompiled Linux packages here: - https://unit.nginx.org/installation/ Internally, we use Buildbot to build each commit and run tests on a large number of systems. We also use various static analysis tools to improve code quality and check tests coverage. There is ongoing work on functional tests framework that will allow to avoid such regressions in the future. And there are plans to add fuzz testing. You can learn more about recent Unit changes in this detailed blogpost: - https://www.nginx.com/blog/unit-0-3-beta-release-available-now/ Besides that, please welcome Alexander Borisov who's joined our Unit dev team today. His first task is going to be adding Perl/PSGI support. wbr, Valentin V. Bartenev From f.potapov18 at yandex.ru Mon Jan 22 11:55:50 2018 From: f.potapov18 at yandex.ru (Fedor Potapov) Date: Mon, 22 Jan 2018 14:55:50 +0300 Subject: Unit + wsgi.py + POST handler sample Message-ID: <123931516622150@web35g.yandex.ru> An HTML attachment was scrubbed... URL: From vlad.kras at gmail.com Mon Jan 22 12:01:52 2018 From: vlad.kras at gmail.com (=?UTF-8?B?0JLQu9Cw0LQg0JrRgNCw0YE=?=) Date: Mon, 22 Jan 2018 12:01:52 +0000 Subject: Unit + wsgi.py + POST handler sample In-Reply-To: <123931516622150@web35g.yandex.ru> References: <123931516622150@web35g.yandex.ru> Message-ID: Try to update Unit to version 0.4 first On Mon, Jan 22, 2018 at 2:56 PM Fedor Potapov wrote: > Hello, > > I'm trying to learn nginx unit. GET queries work fine, thanks to examples. > Nevertheless, when I try to process a POST, I get: > > -- > ERROR:root:The client disconnected while sending the body (12 more bytes > were expected) > Traceback (most recent call last): > File "/usr/local/lib/python2.7/site-packages/webapp2.py", line 1535, in > __call__ > rv = self.handle_exception(request, response, e) > File "/usr/local/lib/python2.7/site-packages/webapp2.py", line 1529, in > __call__ > rv = self.router.dispatch(request, response) > File "/usr/local/lib/python2.7/site-packages/webapp2.py", line 1278, in > default_dispatcher > return route.handler_adapter(request, response) > File "/usr/local/lib/python2.7/site-packages/webapp2.py", line 1102, in > __call__ > return handler.dispatch() > File "/usr/local/lib/python2.7/site-packages/webapp2.py", line 572, in > dispatch > return self.handle_exception(e, self.app.debug) > File "/usr/local/lib/python2.7/site-packages/webapp2.py", line 570, in > dispatch > return method(*args, **kwargs) > File "/usr/local/www/unit/py/wsgi.py", line 24, in post > self.response.out.write(self.request.get('content')) > File "/usr/local/lib/python2.7/site-packages/webapp2.py", line 175, in > get > param_value = self.get_all(argument_name) > File "/usr/local/lib/python2.7/site-packages/webapp2.py", line 212, in > get_all > param_value = self.params.getall(argument_name) > File "/usr/local/lib/python2.7/site-packages/webob/request.py", line > 851, in params > params = NestedMultiDict(self.GET, self.POST) > File "/usr/local/lib/python2.7/site-packages/webob/request.py", line > 787, in POST > self.make_body_seekable() > File "/usr/local/lib/python2.7/site-packages/webob/request.py", line > 941, in make_body_seekable > self.copy_body() > File "/usr/local/lib/python2.7/site-packages/webob/request.py", line > 965, in copy_body > data = input.read(min(todo, 65535)) > File "/usr/local/lib/python2.7/site-packages/webob/request.py", line > 1557, in readinto > "(%d more bytes were expected)" % (self.remaining,) > DisconnectionError: The client disconnected while sending the body (12 > more bytes were expected) > -- > > > My sample code: > -- > #!/usr/bin/env python > > import atexit, webapp2 > > def cleanup(): > print('Cleanup done.') > atexit.register(cleanup) > > class Forms(webapp2.RequestHandler): > def get(self): > self.response.write(""" > > >
>
>
>
> > """) > > class Sign(webapp2.RequestHandler): > def post(self): > self.response.out.write('You wrote:
')
>       self.response.out.write(self.request.get('content'))
>       self.response.out.write('
') > > application = webapp2.WSGIApplication([ > (r'/', Forms), > (r'/sign', Sign), > ]) > -- > > I'm assuming that the unitd drop connection before request.get and unitd > does not know anything about the need to process POST here. How to > correctly process POST here? Any timeout's ro read data upon POST ? Thank > you. > > Env: Python 2.7, Unit-0.3, FreeBSD 11.1 > > _______________________________________________ > unit mailing list > unit at nginx.org > https://mailman.nginx.org/mailman/listinfo/unit -- ? ?????????, ?????????? ????. -------------- next part -------------- An HTML attachment was scrubbed... URL: From f.potapov18 at yandex.ru Mon Jan 22 12:12:10 2018 From: f.potapov18 at yandex.ru (Fedor Potapov) Date: Mon, 22 Jan 2018 15:12:10 +0300 Subject: Unit + wsgi.py + POST handler sample In-Reply-To: References: <123931516622150@web35g.yandex.ru> Message-ID: <239641516623130@web35g.yandex.ru> An HTML attachment was scrubbed... URL: From vbart at nginx.com Wed Jan 24 12:21:52 2018 From: vbart at nginx.com (Valentin V. Bartenev) Date: Wed, 24 Jan 2018 15:21:52 +0300 Subject: Unit + wsgi.py + POST handler sample In-Reply-To: <239641516623130@web35g.yandex.ru> References: <123931516622150@web35g.yandex.ru> <239641516623130@web35g.yandex.ru> Message-ID: <1705753.YiAO2JYWN6@vbart-workstation> On Monday 22 January 2018 15:12:10 Fedor Potapov wrote: > Wow, great! Issue was solved in 0.4. > Are there any personal settings for the timeout on the POST request? > [..] What kind of timeout do you mean? A timeout for application execution or a timeout for reading request body? There's an application timeout that you can control using: /applications/example/limits/timeout e.g.: { "type": "python 3", "workers": 2, "module": "wsgi", "path": "/www/example", "limits": { "timeout": 10 } } There's also a 5 seconds timeout between body read operations and no way to change it from the configuration API. An option to specify this timeout will be added in the future versions. wbr, Valentin V. Bartenev