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

t/python/manage_script_name broken? #1076

Closed
pajod opened this issue Oct 18, 2015 · 4 comments
Closed

t/python/manage_script_name broken? #1076

pajod opened this issue Oct 18, 2015 · 4 comments

Comments

@pajod
Copy link

pajod commented Oct 18, 2015

When trying to figure how exactly mount= xx=script.py is supposed to work i ran into a problem.
Please clarify (either docs or the test)

This is what i did

!/bin/bash
set -e
cd $(mktemp -d)
echo "Dont forget to quit uwsgi and clean up $(pwd) when done investigating"
virtualenv -p $(which python3) .
source bin/activate
set -v
git clone https://github.com/unbit/uwsgi uwsgi
pip install ./uwsgi requests.
uwsgi --ini uwsgi/t/python/manage_script_name/manage_script_name_test.ini --daemonize uwsgi.log
python uwsgi/t/python/manage_script_name/test_manage_script_name.py

This is what i got

Successfully installed requests uWSGI
uwsgi --ini uwsgi/t/python/manage_script_name/manage_script_name_test.ini --daemonize uwsgi.log
[uWSGI] getting INI configuration from uwsgi/t/python/manage_script_name/manage_script_name_test.ini
python uwsgi/t/python/manage_script_name/test_manage_script_name.py
test_classic_mountpoints (__main__.ManageScriptNameTest) ... FAIL
test_intriguing_mountpoints (__main__.ManageScriptNameTest) ... ok
======================================================================
FAIL: test_classic_mountpoints (__main__.ManageScriptNameTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "uwsgi/t/python/manage_script_name/test_manage_script_name.py", line 32, in test_classic_mountpoints
    self.assertEqual(r.text, mp)
AssertionError: '' != '/footris/'
+ /footris/
----------------------------------------------------------------------
Ran 2 tests in 0.013s
FAILED (failures=1)
@xrmx
Copy link
Collaborator

xrmx commented Oct 18, 2015

Does the log say something interesting? cc @aldur

@pajod
Copy link
Author

pajod commented Oct 18, 2015

I dont know. Afaik "0 bytes" is not whats supposed to happen. BTW, tried with the version shipping with ubuntu, same results.

*** Starting uWSGI 2.1-dev-1b96a63 (64bit) on [Sun Oct 18 23:54:11 2015] ***
compiled with version: 4.8.4 on 18 October 2015 23:53:27
os: Linux-3.13.0-042stab108.7 #1 SMP Wed Jul 15 15:49:08 MSK 2015
nodename: domain.tld
machine: x86_64
clock source: unix
detected number of CPU cores: 1
current working directory: /tmp/tmp.v2oKRJmceR
detected binary path: /tmp/tmp.v2oKRJmceR/bin/uwsgi
!!! no internal routing support, rebuild with pcre support !!!
your processes number limit is 2061982
your memory page size is 4096 bytes
detected max file descriptor number: 1024
lock engine: pthread robust mutexes
thunder lock: disabled (you can enable it with --thunder-lock)
uwsgi socket 0 bound to TCP address :8080 fd 3
Python version: 3.4.3 (default, Jul 28 2015, 18:24:08)  [GCC 4.8.4]
*** Python threads support is disabled. You can enable it with --enable-threads ***
Python main interpreter initialized at 0x12af150
your server socket listen backlog is limited to 100 connections
your mercy for graceful operations on workers is 60 seconds
your request buffer size is 4096 bytes
mapped 145584 bytes (142 KB) for 1 cores
*** Operational MODE: single process ***
WSGI app 0 (mountpoint='') ready in 0 seconds on interpreter 0x12af150 pid: 28697 (default app)
mounting /tmp/tmp.v2oKRJmceR/uwsgi/t/python/manage_script_name//useless_app.py on /foo
WSGI app 1 (mountpoint='/foo') ready in 0 seconds on interpreter 0x132aac0 pid: 28697
mounting /tmp/tmp.v2oKRJmceR/uwsgi/t/python/manage_script_name//useless_app.py on /foobis/
WSGI app 2 (mountpoint='/foobis/') ready in 0 seconds on interpreter 0x13c5f40 pid: 28697
mounting /tmp/tmp.v2oKRJmceR/uwsgi/t/python/manage_script_name//useless_app.py on /footris/
WSGI app 3 (mountpoint='/footris/') ready in 0 seconds on interpreter 0x142f310 pid: 28697
*** uWSGI is running in multiple interpreter mode ***
spawned uWSGI master process (pid: 28697)
spawned uWSGI worker 1 (pid: 28698, cores: 1)
[pid: 28698|app: 3|req: 1/1] 127.0.0.1 () {28 vars in 337 bytes} [Sun Oct 18 23:54:12 2015] GET /footris/ => generated 0 bytes in 0 msecs (HTTP/1.1 200) 1 headers in 44 bytes (9 switches on core 0)
[pid: 28698|app: 0|req: 1/2] 127.0.0.1 () {28 vars in 343 bytes} [Sun Oct 18 23:54:12 2015] GET /fooanything => generated 0 bytes in 0 msecs (HTTP/1.1 200) 1 headers in 44 bytes (0 switches on core 0)
[pid: 28698|app: 0|req: 2/3] 127.0.0.1 () {28 vars in 339 bytes} [Sun Oct 18 23:54:12 2015] GET /foobisis/ => generated 0 bytes in 0 msecs (HTTP/1.1 200) 1 headers in 44 bytes (0 switches on  core 0)
[pid: 28698|app: 0|req: 3/4] 127.0.0.1 () {28 vars in 343 bytes} [Sun Oct 18 23:54:12 2015] GET /foofighters => generated 0 bytes in 0 msecs (HTTP/1.1 200) 1 headers in 44 bytes (0 switches on core 0)

@pajod
Copy link
Author

pajod commented Oct 18, 2015

Thanks for your assistance. The log does say one thing indeed: I am using Python 3.
I just need to add .encode("charset") to the useless_app.
Now on to debugging the actual problem i was needing this for..

@pajod pajod closed this as completed Oct 18, 2015
@xrmx
Copy link
Collaborator

xrmx commented Oct 19, 2015

@pajod well if you can cook a patch to make it work with py2 and py3 that would be awesome.

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