Deleted /tmp/ files and getting 502

June 23, 2017 433 views
Nginx

I accidentally the files in my tmp folder and now I am getting a 502 error on all of the sites running on my server.

Getting the following error in my error.log

2017/06/23 12:21:00 [crit] 17256#0: *1 connect() to unix:/var/run/php/php7.0-fpm.sock failed (2: No such file or directory) while connecting to upstream, client: 81.132.245.224, server: boss-14-001.bareface.work, request: "GET /favicon.ico HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php7.0-fpm.sock:", host: "boss-14-001.bareface.work", referrer: "http://boss-14-001.bareface.work/"

I also get the following in my syslog

I am very new at this so if you can help, please be as clear as possible. As far as I can see I may have deleted php7.0-fpm.sock but not sure how to restore that.

1 comment
  • realise I didn't add full syslog error

    Jun 25 08:39:03 bareface kernel: [16685890.222423] init: php7.0-fpm main process (23157) terminated with status 254
    Jun 25 08:39:03 bareface kernel: [16685890.222452] init: php7.0-fpm main process ended, respawning
    Jun 25 08:39:03 bareface kernel: [16685890.331681] init: php7.0-fpm main process (23166) terminated with status 254
    Jun 25 08:39:03 bareface kernel: [16685890.331699] init: php7.0-fpm main process ended, respawning
    Jun 25 08:39:03 bareface kernel: [16685890.423764] init: php7.0-fpm main process (23175) terminated with status 254
    Jun 25 08:39:03 bareface kernel: [16685890.423786] init: php7.0-fpm main process ended, respawning
    Jun 25 08:39:03 bareface kernel: [16685890.526173] init: php7.0-fpm main process (23184) terminated with status 254
    Jun 25 08:39:03 bareface kernel: [16685890.526202] init: php7.0-fpm respawning too fast, stopped
    Jun 25 08:41:11 bareface kernel: [16686018.402569] [UFW BLOCK] IN=eth0 OUT= MAC=04:01:bb:f8:b8:01:f4:a7:39:d7:8a:7d:08:00 SRC=107.170.240.143 DST=178.62.241.8 LEN=40 TOS=0x00 PREC=0x00 TTL=245 ID=54321 PROTO=TCP SPT=50858 DPT=53 WINDOW=65535 RES=0x00 SYN URGP=0 
    Jun 25 08:41:28 bareface kernel: [16686035.880559] [UFW BLOCK] IN=eth0 OUT= MAC=04:01:bb:f8:b8:01:f4:a7:39:d7:82:7d:08:00 SRC=163.172.168.251 DST=178.62.241.8 LEN=40 TOS=0x00 PREC=0x00 TTL=245 ID=15494 PROTO=TCP SPT=54163 DPT=8080 WINDOW=1024 RES=0x00 SYN URGP=0
    
3 Answers

@dev3a892af9f2c224325df0b94 Restart PHP service:

sudo service php7.0-fpm restart

You might have issues with lingering services, so it might be easier to restart the server, since that will create the socket files again for all your services.

fixed now. Had to re-add /tmp with correct permissions and ownership

Have another answer? Share your knowledge.