curl: (52) Empty reply from server

Asked by titog

Hi,

I am trying to test the API server and I am getting the following response:

linux-bau1:~ # curl http://localhost:35000/
curl: (52) Empty reply from server

I am using SLES12 SP3:

linux-bau1:~ # cat /etc/uwsgi.d/zcc.ini
[uwsgi]
chmod-socket = 666
uwsgi-socket = 127.0.0.1:35000
lazy-apps = true
add-header = Connection: close
buffer-size = 65535
thunder-lock = true
plugins = python
enable-threads = true
exit-on-reload = true
die-on-term = true
master = true
processes = 2
wsgi-file = /usr/bin/zvmsdk-wsgi
pidfile = /tmp/zvmsdk-wsgi.pid
socket = /tmp/zvmsdk-wsgi.socket
uid = zvmsdk
gid = zvmsdk
threads = 16
linux-bau1:~ # ps -ef | grep uwsgi
zvmsdk 52245 1 0 13:23 ? 00:00:00 /usr/bin/uwsgi --ini /etc/uwsgi.d/zcc.ini
zvmsdk 52248 52245 0 13:23 ? 00:00:00 /usr/bin/uwsgi --ini /etc/uwsgi.d/zcc.ini
zvmsdk 52249 52245 0 13:23 ? 00:00:00 /usr/bin/uwsgi --ini /etc/uwsgi.d/zcc.ini
root 52303 51929 0 13:25 pts/0 00:00:00 grep --color=auto uwsgi

linux-bau1:~ # systemctl status zvmsdk-wsgi.service -l
● zvmsdk-wsgi.service - z/VM Cloud Connector uwsgi
   Loaded: loaded (/usr/lib/systemd/system/zvmsdk-wsgi.service; enabled; vendor preset: disabled)
   Active: active (running) since Fri 2018-03-02 13:23:06 -03; 2min 57s ago
  Process: 52242 ExecStop=/usr/bin/uwsgi --stop /etc/uwsgi.d/zcc.ini (code=killed, signal=INT)
 Main PID: 52245 (uwsgi)
    Tasks: 33 (limit: 512)
   CGroup: /system.slice/zvmsdk-wsgi.service
           ├─52245 /usr/bin/uwsgi --ini /etc/uwsgi.d/zcc.ini
           ├─52248 /usr/bin/uwsgi --ini /etc/uwsgi.d/zcc.ini
           └─52249 /usr/bin/uwsgi --ini /etc/uwsgi.d/zcc.ini

Mar 02 13:23:06 linux-bau1 uwsgi[52245]: your server socket listen backlog is limited to 100 connections
Mar 02 13:23:06 linux-bau1 uwsgi[52245]: your mercy for graceful operations on workers is 60 seconds
Mar 02 13:23:06 linux-bau1 uwsgi[52245]: mapped 3638352 bytes (3553 KB) for 32 cores
Mar 02 13:23:06 linux-bau1 uwsgi[52245]: *** Operational MODE: preforking+threaded ***
Mar 02 13:23:06 linux-bau1 uwsgi[52245]: *** uWSGI is running in multiple interpreter mode ***
Mar 02 13:23:06 linux-bau1 uwsgi[52245]: spawned uWSGI master process (pid: 52245)
Mar 02 13:23:06 linux-bau1 uwsgi[52245]: spawned uWSGI worker 1 (pid: 52248, cores: 16)
Mar 02 13:23:06 linux-bau1 uwsgi[52245]: spawned uWSGI worker 2 (pid: 52249, cores: 16)
Mar 02 13:23:07 linux-bau1 uwsgi[52245]: WSGI app 0 (mountpoint='') ready in 1 seconds on interpreter 0x3d432260 pid: 52249 (default app)
Mar 02 13:23:07 linux-bau1 uwsgi[52245]: WSGI app 0 (mountpoint='') ready in 1 seconds on interpreter 0x3d432260 pid: 52248 (default app)

linux-bau1:~ # systemctl status sdkserver.service -l
● sdkserver.service - zVM SDK API server
   Loaded: loaded (/usr/lib/systemd/system/sdkserver.service; enabled; vendor preset: disabled)
   Active: active (running) since Fri 2018-03-02 13:22:50 -03; 3min 28s ago
 Main PID: 52234 (sdkserver)
    Tasks: 1 (limit: 512)
   CGroup: /system.slice/sdkserver.service
           └─52234 /usr/bin/python /usr/bin/sdkserver

Mar 02 13:22:50 linux-bau1 systemd[1]: Stopped zVM SDK API server.
Mar 02 13:22:50 linux-bau1 systemd[1]: Started zVM SDK API server.
Mar 02 13:22:50 linux-bau1 sdkserver[52234]: INFO: [MainThread] SDK server now listening

Question information

Language:
English Edit question
Status:
Open
For:
zVM Cloud Connector Edit question
Assignee:
cao biao Edit question
Last query:
Last reply:
Revision history for this message
cao biao (flytiger) said :
#1

35000 is not the port of HTTPD service

the message of curl should be processed by httpd first and then transfer to uwsgi.
so the port number you should refer to /etc/httpd/conf.d/zvmsdk.conf. zvmsdk.conf is created when you setup Cloud Connector.
The name maybe different from mine.

Content Like:

LoadModule proxy_uwsgi_module modules/mod_proxy_uwsgi.so

Listen 8080
Timeout 600

<VirtualHost *:8080>
   ProxyPass / uwsgi://127.0.0.1:35000/
</VirtualHost>

So in my environment, you should use: curl http://localhost:8080/

Revision history for this message
titog (titogarrido) said :
#2

root@ubuntu:~# curl http://localhost:8080/
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>500 Internal Server Error</title>
</head><body>
<h1>Internal Server Error</h1>
<p>The server encountered an internal error or
misconfiguration and was unable to complete
your request.</p>
<p>Please contact the server administrator at
 [no address given] to inform them of the time this error occurred,
 and the actions you performed just before this error.</p>
<p>More information about this error may be available
in the server error log.</p>
<hr>
<address>Apache/2.4.18 (Ubuntu) Server at localhost Port 8080</address>
</body></html>

root@ubuntu:~# cat /etc/apache2/sites-enabled/
default.conf sdkapi.conf
root@ubuntu:~# cat /etc/apache2/sites-enabled/sdkapi.conf
Listen 8080

<VirtualHost *:8080>
   ProxyPass / uwsgi://127.0.0.1:35000/
</VirtualHost>

Using UWSGI + Apache + Ubuntu I am getting a "500 Internal Server Error" would you know how to debug it? Is there any log file?

Revision history for this message
cao biao (flytiger) said :
#3

you can check the status of apache service, check if it is working:

# systemctl status apache2

As for the log file, now your operation is communicating with httpd, so you maybe refer the log file of apache.
And the path of log file for Cloud Connector is configured in configuration file.

There is an item called 'log_dir' which define the director of log file. configuration file named 'zvmsdk.conf' should be under it.

Revision history for this message
titog (titogarrido) said :
#4

root@ubuntu:/var/log/apache2# systemctl status apache2
* apache2.service - LSB: Apache2 web server
   Loaded: loaded (/etc/init.d/apache2; bad; vendor preset: enabled)
  Drop-In: /lib/systemd/system/apache2.service.d
           `-apache2-systemd.conf
   Active: active (running) since Fri 2018-03-09 08:55:54 EST; 4 days ago
     Docs: man:systemd-sysv-generator(8)
  Process: 40853 ExecStop=/etc/init.d/apache2 stop (code=exited, status=0/SUCCESS)
  Process: 48601 ExecReload=/etc/init.d/apache2 reload (code=exited, status=0/SUCCESS)
  Process: 40878 ExecStart=/etc/init.d/apache2 start (code=exited, status=0/SUCCESS)
   CGroup: /system.slice/apache2.service
           |-40896 /usr/sbin/apache2 -k start
           |-48643 /usr/sbin/apache2 -k start
           |-48648 /usr/sbin/apache2 -k start
           `-48649 /usr/sbin/apache2 -k start

Mar 11 06:25:01 ubuntu apache2[12285]: *
Mar 11 06:25:01 ubuntu systemd[1]: Reloaded LSB: Apache2 web server.
Mar 12 06:25:01 ubuntu systemd[1]: Reloading LSB: Apache2 web server.
Mar 12 06:25:01 ubuntu apache2[30369]: * Reloading Apache httpd web server apache2
Mar 12 06:25:01 ubuntu apache2[30369]: *
Mar 12 06:25:01 ubuntu systemd[1]: Reloaded LSB: Apache2 web server.
Mar 13 06:25:01 ubuntu systemd[1]: Reloading LSB: Apache2 web server.
Mar 13 06:25:01 ubuntu apache2[48601]: * Reloading Apache httpd web server apache2
Mar 13 06:25:01 ubuntu apache2[48601]: *
Mar 13 06:25:01 ubuntu systemd[1]: Reloaded LSB: Apache2 web server.

From apache error log I didn't see much:

root@ubuntu:/var/log/apache2# tail -f other_vhosts_access.log
9.60.87.83:8080 ::1 - - [13/Mar/2018:09:25:07 -0400] "GET / HTTP/1.1" 500 800 "-" "curl/7.47.0"
9.60.87.83:8080 ::1 - - [13/Mar/2018:09:27:38 -0400] "GET / HTTP/1.1" 500 800 "-" "curl/7.47.0"
9.60.87.83:8080 ::1 - - [13/Mar/2018:10:20:15 -0400] "GET / HTTP/1.1" 500 800 "-" "curl/7.47.0"

root@ubuntu:/var/log/apache2# tail -f error.log
[Tue Mar 13 06:25:01.469102 2018] [wsgi:warn] [pid 40896:tid 4396556453712] mod_wsgi: Compiled for Python/2.7.11.
[Tue Mar 13 06:25:01.469106 2018] [wsgi:warn] [pid 40896:tid 4396556453712] mod_wsgi: Runtime using Python/2.7.12.
[Tue Mar 13 06:25:01.469459 2018] [mpm_event:notice] [pid 40896:tid 4396556453712] AH00489: Apache/2.4.18 (Ubuntu) OpenSSL/1.0.2g mod_wsgi/4.3.0 Python/2.7.12 configured -- resuming normal operations
[Tue Mar 13 06:25:01.469475 2018] [core:notice] [pid 40896:tid 4396556453712] AH00094: Command line: '/usr/sbin/apache2'

my config files:

root@ubuntu:/var/log# cat /etc/uwsgi/apps-enabled/zcc.ini
[uwsgi]
chmod-socket = 666
uwsgi-socket = 127.0.0.1:35000
lazy-apps = true
add-header = Connection: close
buffer-size = 65535
thunder-lock = true
plugins = python
enable-threads = true
exit-on-reload = true
die-on-term = true
master = true
processes = 2
wsgi-file = /usr/local/bin/zvmsdk-wsgi
pidfile = /tmp/zvmsdk-wsgi.pid
socket = /tmp/zvmsdk-wsgi.socket
uid = zvmsdk
gid = zvmsdk
threads = 16

root@ubuntu:/var/log# cat /etc/apache2/sites-enabled/sdkapi.conf
Listen 8080

<VirtualHost *:8080>
   ProxyPass / uwsgi://127.0.0.1:35000/
</VirtualHost>

root@ubuntu:/var/log# ps -ef | grep uwsgi
zvmsdk 18604 1 0 Mar08 ? 00:00:04 /usr/bin/uwsgi --ini /usr/share/uwsgi/conf/default.ini --ini /etc/uwsgi/apps-enabled/zcc.ini --daemonize /var/log/uwsgi/app/zcc.log
zvmsdk 18605 18604 0 Mar08 ? 00:00:00 /usr/bin/uwsgi --ini /usr/share/uwsgi/conf/default.ini --ini /etc/uwsgi/apps-enabled/zcc.ini --daemonize /var/log/uwsgi/app/zcc.log
zvmsdk 18606 18604 0 Mar08 ? 00:00:00 /usr/bin/uwsgi --ini /usr/share/uwsgi/conf/default.ini --ini /etc/uwsgi/apps-enabled/zcc.ini --daemonize /var/log/uwsgi/app/zcc.log
root 51978 50969 0 10:30 pts/0 00:00:00 grep --color=auto uwsgi
root@ubuntu:/var/log# ps -ef | grep apache
root 40896 1 0 Mar09 ? 00:00:02 /usr/sbin/apache2 -k start
www-data 48643 40896 0 06:25 ? 00:00:00 /usr/sbin/apache2 -k start
www-data 48648 40896 0 06:25 ? 00:00:00 /usr/sbin/apache2 -k start
www-data 48649 40896 0 06:25 ? 00:00:00 /usr/sbin/apache2 -k start
root 51982 50969 0 10:30 pts/0 00:00:00 grep --color=auto apache

Probably I did something wrong but I didn't get it.

Revision history for this message
jichenjc (jichenjc) said :
#5

Hi Titog A few questions may need your additional info

1) you mentioned SLES12 and I saw root@ubuntu:~# curl http://localhost:8080/
    is some environment change already?
2) is there any log inside your /var/log/zvmsdk or its child folder?
3) I guess this is looks like a common configure apache issue which might google then compare their recommendataion to your test server ? or if we can log on your test server will be helpful as well

Revision history for this message
gsdn gvfdb (aleor85) said :
#6

yes I also faced this issue that you shared here but now I have its solution you can see here https://clashroyaleapk.net/ for more details

Can you help with this problem?

Provide an answer of your own, or ask titog for more information if necessary.

To post a message you must log in.