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

Nginx error on start: io_setup() failed (38: Function not implemented) #3014

Closed
sanzc opened this issue Mar 11, 2018 · 8 comments
Closed

Nginx error on start: io_setup() failed (38: Function not implemented) #3014

sanzc opened this issue Mar 11, 2018 · 8 comments

Comments

@sanzc
Copy link

sanzc commented Mar 11, 2018

Operating System Information:

Windows Build Number: 10.0.16299.248

Issue:

Nginx log shows error on (re)start
[emerg] 1251#1251: io_setup() failed (38: Function not implemented)

Steps to reproduce:

Install WLS (tried with fresh Ubuntu and Debian installation)
Update/Upgrade (apt update && apt upgrade)
Install nginx from official nginx repo (http://nginx.org/en/linux_packages.html - tried with stable and mainline)
Run nginx (service nginx start)
Look at error.log (cat /var/log/nginx/error.log)

Behavior:

Despite the error I tried to set up nginx with php7.2-fpm. Static files work but it can't correctly serve php files, the browser just keep loading forever. But no other error is shown in nginx and php-fpm logs.

@therealkenc
Copy link
Collaborator

Ref #393 (message).

@therealkenc
Copy link
Collaborator

I can't actually repro this, on 17627.

$ sudo apt install nginx
$ sudo service nginx start

No errors in /var/log/nginx/error.log. Stock webpage serves up (but you already said that).

That might or might not mean the Function not implemented fail was fixed somewhere between 16299 and now, because you deleted the issue template and no strace was provided.

[Separately if there are problems with some php script or another, please file under a different cover; best by running the script from the commandline and grabbing an strace of the hang. Assuming the script hanging is the problem. If it runs from CLI but can't be spawned by nginx that would be different too.]

@christianparpart
Copy link

@sanzc can you run your nginx (not via service nginx start but via strace -ff -o strace.log nginx if you can still reproduce it yourself, then attach it here via a Gist cross-link?

@zippaaa
Copy link

zippaaa commented Apr 7, 2018

Despite the error I tried to set up nginx with php7.2-fpm. Static files work but it can't correctly serve php files, the browser just keep loading forever. But no other error is shown in nginx and php-fpm logs.

My configuration (Ubuntu 16):

sudo apt update
sudo apt upgrade
sudo apt dist-upgrade
sudo apt autoremove
sudo locale-gen "ru_RU.UTF-8"
sudo dpkg-reconfigure locales

#reboot

sudo apt install mc

wget http://nginx.org/keys/nginx_signing.key && sudo apt-key add nginx_signing.key
sudo nano /etc/apt/sources.list
     deb http://nginx.org/packages/mainline/ubuntu/ xenial nginx

sudo add-apt-repository ppa:ondrej/php

sudo apt update
sudo apt install nginx
sudo apt install php7.2 php7.2-gd php7.2-mysqli php7.2-pdo php7.2-xml php7.2-json php7.2-curl php7.2-fpm php7.2-xdebug
#sudo apt purge apache2

sudo nano /etc/nginx/nginx.conf

user www-data;
worker_processes 2;
master_process off;
#daemon off;
pid /var/run/nginx.pid;

events {
        worker_connections 768;
        # multi_accept on;
}

http {
        ##
        # Basic Settings
        ##
        sendfile on;
        tcp_nopush on;
        tcp_nodelay on;
        keepalive_timeout 65;
        types_hash_max_size 2048;
        # server_tokens off;

	fastcgi_buffering off;
#       fastcgi_buffers 8 16k;
#       fastcgi_buffer_size 32k;
#       fastcgi_connect_timeout 300;
#       fastcgi_send_timeout 300;
#       fastcgi_read_timeout 300;

        # server_names_hash_bucket_size 64;
        # server_name_in_redirect off;

        include /etc/nginx/mime.types;
        default_type application/octet-stream;

        ##
        # SSL Settings
        ##
        ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE
        ssl_prefer_server_ciphers on;

        ##
        # Logging Settings
        ##
        access_log /var/log/nginx/access.log;
        error_log /var/log/nginx/error.log;

        ##
        # Virtual Host Configs
        ##
        #include /etc/nginx/conf.d/*.conf;
        include /etc/nginx/sites-enabled/*;
}

sudo nano /etc/nginx/sites-enabled/site.loc

server {
	server_name site.loc;
	listen 80;
	charset UTF-8;
	index index.php;

	disable_symlinks if_not_owner from=$root_path;

#	error_log /var/log/site.loc.error.log;
#	access_log /var/log/site.loc.access.log;
#	access_log off;

#	include snippets/localhost.conf;

	ssi on;
	set $root_path /var/www/site.loc/public;
	root $root_path;

	client_body_buffer_size     32M;
	client_max_body_size        32M;
	client_header_timeout 3m;
	client_body_timeout 3m;
	send_timeout 3m;
	client_header_buffer_size 1k;
	large_client_header_buffers 4 16k;
	client_body_temp_path /var/tmp;

	location / {
		# This is cool because no php is touched for static content
		try_files $uri $uri/ @rewrite;
	}

	location ~ \.php$ {
		fastcgi_index index.php;
		fastcgi_param PHP_ADMIN_VALUE "sendmail_path = /usr/sbin/sendmail -t -i -f info@site.loc";
		fastcgi_pass unix:/var/run/php/site.loc.sock;
		try_files $uri =404;
		#include fastcgi_params;
		include fastcgi.conf;
	}

	location @rewrite {
		proxy_redirect off;
		proxy_set_header Host $host;
		proxy_set_header X-Real-IP $remote_addr;
		proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
		rewrite ^ /index.php;
	}
}

sudo nano /etc/php/7.2/fpm/pool.d/site.loc.conf

[site.loc]
pm = dynamic
pm.start_servers = 1
pm.min_spare_servers = 1
pm.max_children = 5
pm.max_spare_servers = 5
listen = /var/run/php/site.loc.sock
listen.mode = 0660
listen.owner = www-data
listen.group = www-data
user = www-data
group = www-data
chdir = /var/www/site.loc

catch_workers_output = yes

;php_flag[display_errors] = On
php_admin_value[post_max_size] = 30M
php_admin_value[upload_max_filesize] = 32M
php_admin_value[short_open_tag] = On

php_admin_value[error_log] = /var/log/site.loc.error.log
php_admin_value[access_log] = off
php_admin_value[display_errors] = On ;stderr
php_admin_value[log_errors] = On
php_admin_value[upload_tmp_dir] = /var/tmp
php_admin_value[session.save_path] = /var/tmp
sudo adduser www-data
cd /var/run
sudo mkdir php
sudo chown -R www-data:www-data php
cd ..
sudo mkdir www
sudo chown -R www-data:www-data www
cd www

Add symlink "/mnt/c/project" -> /var/www/site.loc

sudo service nginx start
sudo service php7.2-fpm start

Windows hosts

127.0.0.1 site.loc

@laoshancun
Copy link

same issue
2018/04/10 11:32:56 [emerg] 23219#0: io_setup() failed (38: Function not implemented)

@SLKun
Copy link

SLKun commented Aug 17, 2018

same issue here. It seems that some kernel function haven't implemented.
Nginx version is here.

$ nginx -v
nginx version: nginx/1.14.0

@kaiwoods
Copy link

kaiwoods commented Sep 5, 2018

I very recently joined the Insider Programme just to see if I could get this working. Previously I was on OS Build 17134.254 (1803) and the upgrade has taken me to 17751.1 (1809) and I'm happy to say that, for my use case, this is no longer an issue.

So, for those who aren't on the Insider Programme or don't want to be, it looks like this issue is addressed in time for 1809's release.

@therealkenc
Copy link
Collaborator

Closing for lack of strace. If the issue persists in 1809, please feel encouraged to spawn a new issue following CONTRIBUTING.md.

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

No branches or pull requests

7 participants