nginxinc / nginx-amplify-agent

NGINX Amplify Agent
BSD 2-Clause "Simplified" License
23 stars 9 forks source link

failure to detect nginx(serverpilot) on xenial #14

Open Raboo opened 7 years ago

Raboo commented 7 years ago

Hi,

I'm running two serverpilot.io installations(nginx,apache,php-fpm). One is running on Ubuntu Trusty, the other is running on Xenial. On Trusty everything worked after i added user = www-data to the amplify config. On Xenial it doesn't detect the nginx and doesn't get nginx metrics. Even if I try to add configfile = /etc/nginx-sp/nginx.conf + the user = www-data to the amplify config. Even tried to manually set NGINXCONF=/etc/nginx-sp/nginx.conf in the init script.

Still getting the same error message in the amplify log when it starts.

2017-09-02 08:12:46,165 [10031] MainThread configtest check
2017-09-02 08:12:46,980 [10031] MainThread [0993ae11d9ea6c7715c88980e4238f13] post https://receiver.amplify.nginx.com:443/1.3/xxx/agent/ 200 10 4 0.814
2017-09-02 08:12:47,690 [10051] supervisor [16bb01d1665ff9983c00e7e34911d912] post https://receiver.amplify.nginx.com:443/1.3/xxx/agent/ 200 92 4 0.677
2017-09-02 08:12:53,177 [10051] supervisor agent started, version=0.45-2 pid=10051 uuid=xxx hostname=nl-ams-ubnt02.zxy.se
2017-09-02 08:12:53,207 [10051] supervisor failed to read /usr/local/nginx/conf/nginx.conf due to: IOError
ghost commented 7 years ago

Are you sure the nginx.conf can be read by www-data? Can you possibly address it via the Intercom chat in the UI? Please provide the ps(1) output with the euid information, and possibly the agent debug log file. We'll investigate!

Raboo commented 7 years ago

hmm /etc/nginx-sp/nginx.conf has mode 0644.

$ ps axo stat,euid,ruid,tty,tpgid,sess,pgrp,ppid,pid,pcpu,comm
STAT  EUID  RUID TT       TPGID  SESS  PGRP  PPID   PID %CPU COMMAND
Ss       0     0 ?           -1     1     1     0     1  0.0 systemd
S        0     0 ?           -1     0     0     0     2  0.0 kthreadd
S        0     0 ?           -1     0     0     2     3  0.0 ksoftirqd/0
S<       0     0 ?           -1     0     0     2     5  0.0 kworker/0:0H
S        0     0 ?           -1     0     0     2     7  0.0 rcu_sched
S        0     0 ?           -1     0     0     2     8  0.0 rcu_bh
S        0     0 ?           -1     0     0     2     9  0.0 migration/0
S        0     0 ?           -1     0     0     2    10  0.0 watchdog/0
S        0     0 ?           -1     0     0     2    11  0.0 kdevtmpfs
S<       0     0 ?           -1     0     0     2    12  0.0 netns
S<       0     0 ?           -1     0     0     2    13  0.0 perf
S        0     0 ?           -1     0     0     2    14  0.0 khungtaskd
S<       0     0 ?           -1     0     0     2    15  0.0 writeback
SN       0     0 ?           -1     0     0     2    16  0.0 ksmd
SN       0     0 ?           -1     0     0     2    17  0.0 khugepaged
S<       0     0 ?           -1     0     0     2    18  0.0 crypto
S<       0     0 ?           -1     0     0     2    19  0.0 kintegrityd
S<       0     0 ?           -1     0     0     2    20  0.0 bioset
S<       0     0 ?           -1     0     0     2    21  0.0 kblockd
S<       0     0 ?           -1     0     0     2    22  0.0 ata_sff
S<       0     0 ?           -1     0     0     2    23  0.0 md
S<       0     0 ?           -1     0     0     2    24  0.0 devfreq_wq
S        0     0 ?           -1     0     0     2    28  0.0 kswapd0
S<       0     0 ?           -1     0     0     2    29  0.0 vmstat
S        0     0 ?           -1     0     0     2    30  0.0 fsnotify_mark
S        0     0 ?           -1     0     0     2    31  0.0 ecryptfs-kthrea
S<       0     0 ?           -1     0     0     2    47  0.0 kthrotld
S<       0     0 ?           -1     0     0     2    48  0.0 acpi_thermal_pm
S        0     0 ?           -1     0     0     2    49  0.0 vballoon
S<       0     0 ?           -1     0     0     2    50  0.0 bioset
S<       0     0 ?           -1     0     0     2    51  0.0 bioset
S<       0     0 ?           -1     0     0     2    52  0.0 bioset
S<       0     0 ?           -1     0     0     2    53  0.0 bioset
S<       0     0 ?           -1     0     0     2    54  0.0 bioset
S<       0     0 ?           -1     0     0     2    55  0.0 bioset
S<       0     0 ?           -1     0     0     2    56  0.0 bioset
S<       0     0 ?           -1     0     0     2    57  0.0 bioset
S<       0     0 ?           -1     0     0     2    58  0.0 bioset
S        0     0 ?           -1     0     0     2    59  0.0 scsi_eh_0
S<       0     0 ?           -1     0     0     2    60  0.0 scsi_tmf_0
S        0     0 ?           -1     0     0     2    61  0.0 scsi_eh_1
S<       0     0 ?           -1     0     0     2    62  0.0 scsi_tmf_1
S<       0     0 ?           -1     0     0     2    68  0.0 ipv6_addrconf
S<       0     0 ?           -1     0     0     2    81  0.0 deferwq
S<       0     0 ?           -1     0     0     2    82  0.0 charger_manager
S<       0     0 ?           -1     0     0     2    83  0.0 bioset
S<       0     0 ?           -1     0     0     2   123  0.0 bioset
S<       0     0 ?           -1     0     0     2   124  0.0 bioset
S<       0     0 ?           -1     0     0     2   125  0.0 bioset
S<       0     0 ?           -1     0     0     2   126  0.0 bioset
S<       0     0 ?           -1     0     0     2   127  0.0 kpsmoused
S<       0     0 ?           -1     0     0     2   129  0.0 bioset
S<       0     0 ?           -1     0     0     2   130  0.0 bioset
S<       0     0 ?           -1     0     0     2   132  0.0 bioset
S<       0     0 ?           -1     0     0     2   133  0.0 bioset
S<       0     0 ?           -1     0     0     2   148  0.0 kworker/0:1H
S<       0     0 ?           -1     0     0     2   151  0.0 ttm_swap
S<       0     0 ?           -1     0     0     2   237  0.0 raid5wq
S<       0     0 ?           -1     0     0     2   269  0.0 bioset
S        0     0 ?           -1     0     0     2   299  0.0 jbd2/vda1-8
S<       0     0 ?           -1     0     0     2   300  0.0 ext4-rsv-conver
Ss       0     0 ?           -1   349   349     1   349  0.0 systemd-journal
S        0     0 ?           -1     0     0     2   373  0.0 kauditd
S<       0     0 ?           -1     0     0     2   376  0.0 iscsi_eh
S<       0     0 ?           -1     0     0     2   391  0.0 ib_addr
Ss       0     0 ?           -1   393   393     1   393  0.0 lvmetad
S<       0     0 ?           -1     0     0     2   404  0.0 ib_mcast
S<       0     0 ?           -1     0     0     2   407  0.0 ib_nl_sa_wq
S<       0     0 ?           -1     0     0     2   408  0.0 ib_cm
S<       0     0 ?           -1     0     0     2   409  0.0 iw_cm_wq
S<       0     0 ?           -1     0     0     2   411  0.0 rdma_cm
R        0     0 ?           -1     0     0     2   625  0.0 hwrng
Ssl      0     0 ?           -1   718   718     1   718  0.0 lxcfs
Ss       1     0 ?           -1   722   722     1   722  0.0 atd
Ssl      0     0 ?           -1   725   725     1   725  0.0 accounts-daemon
Ss       0     0 ?           -1   731   731     1   731  0.0 cron
Ssl    104   104 ?           -1   734   734     1   734  0.0 rsyslogd
Ss       0     0 ?           -1   737   737     1   737  0.0 acpid
Ss       0     0 ?           -1   743   743     1   743  0.0 systemd-logind
Ss     107   107 ?           -1   749   749     1   749  0.0 dbus-daemon
Ssl      0     0 ?           -1   806   806     1   806  0.0 polkitd
Ss       0     0 ?           -1   817   817     1   817  0.0 mdadm
Ss       0     0 ?           -1   929   929     1   929  0.0 dhclient
Ssl      0     0 ?           -1  1193  1193     1  1193  0.0 sp-agent
Ssl      0     0 ?           -1  1197  1197     1  1197  0.0 sp-stats
Ss+      0     0 tty1      1363  1363  1363     1  1363  0.0 agetty
Ss       0     0 ?           -1  1674  1674     1  1674  0.0 master
S      112   112 ?           -1  1674  1674  1674  1676  0.0 qmgr
Ss       0     0 ?           -1  2216  2216     1  2216  0.0 php-fpm
Ss       0     0 ?           -1  2330  2330     1  2330  0.0 httpd
S<sl     0     0 ?           -1  2410  2410     1  2410  0.0 snapd
S        0     0 ?           -1     0     0     2  3395  0.0 kworker/0:0
S     1000  1000 ?           -1 12447 12447 12447  4516  1.8 php-fpm
S     1000  1000 ?           -1 12447 12447 12447  4517  1.7 php-fpm
Ss       0     0 ?           -1  4556  4556     1  4556  0.0 php-fpm
Ss       0     0 ?           -1  5961  5961  5998  5961  0.0 sshd
Ss    1001  1001 ?           -1  5963  5963     1  5963  0.0 systemd
S        0     0 ?           -1     0     0     2  5965  0.0 kworker/0:2
S     1001  1001 ?           -1  5963  5963  5963  5966  0.0 (sd-pam)
S        0     0 ?           -1     0     0     2  5968  0.0 kworker/0:3
Ss       0     0 ?           -1  5998  5998     1  5998  0.0 sshd
S     1001  1001 ?           -1  5961  5961  5961  6014  0.0 sshd
Ss    1001  1001 pts/0     6785  6015  6015  6014  6015  0.0 bash
Ss       0     0 ?           -1  6452  6452     1  6452  0.0 iscsid
S<Ls     0     0 ?           -1  6453  6453     1  6453  0.0 iscsid
S     1000  1000 ?           -1 12447 12447 12447  6632  0.5 php-fpm
R+    1001  1001 pts/0     6785  6015  6785  6015  6785  0.0 ps
S        0     0 ?           -1     0     0     2  9240  0.0 kworker/0:1
S       33    33 ?           -1 10050 10050     1 10051  0.1 amplify-agent
Ss     111   111 ?           -1 10910 10910     1 10910  0.0 ntpd
S     1000  1000 ?           -1 12447 12447 12447 11222  1.6 php-fpm
S        0     0 ?           -1     0     0     2 11291  0.0 kworker/u2:2
Ss       0     0 ?           -1 12414 12414     1 12414  0.0 systemd-udevd
Ss       0     0 ?           -1 12447 12447     1 12447  0.0 php-fpm
Ss       0     0 ?           -1 12553 12553     1 12553  0.0 php-fpm
Ssl    113   113 ?           -1 12680 12680     1 12680 10.1 mysqld
S        0     0 ?           -1     0     0     2 18007  0.0 kworker/u2:1
Ss       0     0 ?           -1 18688 18688     1 18688  0.0 nginx
Sl      33    33 ?           -1 18688 18688 18688 18691  0.4 nginx
S       33    33 ?           -1  2330  2330  2330 21693  0.0 httpd
Sl      33    33 ?           -1  2330  2330  2330 21694  0.0 httpd
Sl      33    33 ?           -1  2330  2330  2330 21695  0.0 httpd
Sl      33    33 ?           -1  2330  2330  2330 21696  0.0 httpd
Sl      33    33 ?           -1  2330  2330  2330 21780  0.0 httpd
Ss     108   108 ?           -1 22385 22385     1 22385  0.0 uuidd
Ssl      0     0 ?           -1 22851 22851     1 22851  0.0 monitor
Ss       0     0 ?           -1 24609 24609     1 24609  0.0 php-fpm
Ss       0     0 ?           -1 24774 24774     1 24774  0.0 php-fpm
S      112   112 ?           -1  1674  1674  1674 26851  0.0 pickup
S     1000  1000 ?           -1 12447 12447 12447 31095  1.6 php-fpm
Raboo commented 7 years ago

debug log

2017-09-03 00:09:04,362 [7503] MainThread configtest check
2017-09-03 00:09:05,132 [7503] MainThread {u'config': {u'cloud': {u'push_interval': 60.0, u'talk_interval': 120.0, u'api_url': u'https://receiver.amplify.nginx.com:443/1.3', u'api_timeout': 10.0}, u'containers': {u'nginx': {u'max_test_duration': 30.0, u'parse_delay': 60.0, u'upload_config': True, u'upload_ssl': True, u'run_test': False, u'poll_intervals': {u'metrics': 20.0, u'configs': 20.0, u'meta': 60.0, u'logs': 10.0, u'discover': 10.0}}, u'phpfpm_pool': {u'poll_intervals': {u'metrics': 20.0, u'meta': 60.0, u'discover': 10.0}}, u'plus': {u'poll_intervals': {u'metrics': 20.0, u'meta': 60.0, u'discover': 10.0}}, u'phpfpm': {u'poll_intervals': {u'metrics': 20.0, u'meta': 60.0, u'discover': 10.0}}, u'system': {u'poll_intervals': {u'metrics': 20.0, u'meta': 60.0, u'discover': 10.0}}}}, u'objects': [], u'messages': [], u'versions': {u'current': 0.45, u'old': 0.42, u'obsolete': 0.34}}
2017-09-03 00:09:05,132 [7503] MainThread [d020a28d7c73dfa91dea770d412330e1] post https://receiver.amplify.nginx.com:443/1.3/xxx/agent/ 200 10 4 0.769
2017-09-03 00:09:05,836 [7523] supervisor {u'config': {u'cloud': {u'push_interval': 60.0, u'talk_interval': 120.0, u'api_url': u'https://receiver.amplify.nginx.com:443/1.3', u'api_timeout': 10.0}, u'containers': {u'nginx': {u'max_test_duration': 30.0, u'parse_delay': 60.0, u'upload_config': True, u'upload_ssl': True, u'run_test': False, u'poll_intervals': {u'metrics': 20.0, u'configs': 20.0, u'meta': 60.0, u'logs': 10.0, u'discover': 10.0}}, u'phpfpm_pool': {u'poll_intervals': {u'metrics': 20.0, u'meta': 60.0, u'discover': 10.0}}, u'plus': {u'poll_intervals': {u'metrics': 20.0, u'meta': 60.0, u'discover': 10.0}}, u'phpfpm': {u'poll_intervals': {u'metrics': 20.0, u'meta': 60.0, u'discover': 10.0}}, u'system': {u'poll_intervals': {u'metrics': 20.0, u'meta': 60.0, u'discover': 10.0}}}}, u'objects': [], u'messages': [], u'versions': {u'current': 0.45, u'old': 0.42, u'obsolete': 0.34}}
2017-09-03 00:09:05,836 [7523] supervisor [5ffec85b059e0fa009d62fe9ae7ebab9] post https://receiver.amplify.nginx.com:443/1.3/xxx/agent/ 200 92 4 0.677
2017-09-03 00:09:05,839 [7523] supervisor app config has changed. now running with: {'cloud': {'api_timeout': 10.0,
           'api_url': 'https://receiver.amplify.nginx.com:443/1.3',
           'gzip': 6,
           'push_interval': 60.0,
           'talk_interval': 120.0,
           'verify_ssl_cert': False},
 'containers': {u'nginx': {u'max_test_duration': 30.0,
                           u'parse_delay': 60.0,
                           u'poll_intervals': {u'configs': 20.0,
                                               u'discover': 10.0,
                                               u'logs': 10.0,
                                               u'meta': 60.0,
                                               u'metrics': 20.0},
                           u'run_test': False,
                           u'upload_config': True,
                           u'upload_ssl': True},
                u'phpfpm': {u'poll_intervals': {u'discover': 10.0,
                                                u'meta': 60.0,
                                                u'metrics': 20.0}},
                u'phpfpm_pool': {u'poll_intervals': {u'discover': 10.0,
                                                     u'meta': 60.0,
                                                     u'metrics': 20.0}},
                u'plus': {u'poll_intervals': {u'discover': 10.0,
                                              u'meta': 60.0,
                                              u'metrics': 20.0}},
                u'system': {u'poll_intervals': {u'discover': 10.0,
                                                u'meta': 60.0,
                                                u'metrics': 20.0}}},
 'credentials': {'api_key': 'xxx',
                 'hostname': None,
                 'imagename': None,
                 'uuid': 'xxx'},
 'daemon': {'cpu_limit': 10.0,
            'cpu_sleep': 0.2,
            'pid': '/var/run/amplify-agent/amplify-agent.pid'},
 'extensions': {'phpfpm': 'True'},
 'formatter_simpleFormatter': {'datefmt': '',
                               'format': '%(asctime)s [%(process)d] %(threadName)s %(message)s'},
 'formatters': {'keys': 'simpleFormatter'},
 'handler_agent-default': {'args': "('/var/log/amplify-agent/agent.log', 'a', None, 1)",
                           'class': 'logging.handlers.WatchedFileHandler',
                           'formatter': 'simpleFormatter',
                           'level': 'DEBUG'},
 'handler_devnull': {'args': "('/dev/null',)",
                     'class': 'logging.handlers.WatchedFileHandler',
                     'formatter': 'simpleFormatter',
                     'level': 'DEBUG'},
 'handler_root': {'args': "('/dev/null',)",
                  'class': 'logging.handlers.WatchedFileHandler',
                  'formatter': 'simpleFormatter',
                  'level': 'DEBUG'},
 'handlers': {'keys': 'root,devnull,agent-default'},
 'listener_syslog-default': {'address': ''},
 'listeners': {'keys': 'syslog-default'},
 'logger_agent-default': {'formatter': 'simpleFormatter',
                          'handlers': 'agent-default',
                          'level': 'DEBUG',
                          'propagate': '0',
                          'qualname': 'agent-default'},
 'logger_devnull': {'formatter': 'simpleFormatter',
                    'handlers': 'devnull',
                    'level': 'DEBUG',
                    'propagate': '0',
                    'qualname': 'devnull'},
 'logger_root': {'formatter': 'simpleFormatter',
                 'handlers': 'root',
                 'level': 'DEBUG',
                 'propagate': '0',
                 'qualname': 'root'},
 'loggers': {'keys': 'root,devnull,agent-default'},
 'nginx': {'configfile': '/etc/nginx-sp/nginx.conf', 'user': 'www-data'},
 'proxies': {'https': ''}}
2017-09-03 00:09:05,844 [7523] supervisor loaded "system" object manager from <class 'amplify.agent.managers.system.SystemManager'>
2017-09-03 00:09:05,861 [7523] supervisor loaded "nginx" object manager from <class 'amplify.agent.managers.nginx.NginxManager'>
2017-09-03 00:09:05,865 [7523] supervisor loaded "plus" object manager from <class 'amplify.agent.managers.plus.PlusManager'>
2017-09-03 00:09:05,891 [7523] supervisor loaded "phpfpm" object manager from <class 'amplify.ext.phpfpm.managers.master.PHPFPMManager'>
2017-09-03 00:09:05,892 [7523] supervisor loaded "phpfpm_pool" object manager from <class 'amplify.ext.phpfpm.managers.pool.PHPFPMPoolManager'>
2017-09-03 00:09:05,895 [7523] supervisor started "<bound method Bridge.start of <amplify.agent.managers.bridge.Bridge object at 0x7ff7a865f050>>"
2017-09-03 00:09:10,958 [7523] supervisor d550a1205fb15373a3822cb9e1a1048d
2017-09-03 00:09:10,958 [7523] supervisor [None] get http://169.254.169.254/latest/meta-data/instance-id 200 10 32 0.045
2017-09-03 00:09:11,005 [7523] supervisor nl-ams-ubnt02
2017-09-03 00:09:11,006 [7523] supervisor [None] get http://169.254.169.254/latest/meta-data/hostname 200 10 13 0.047
2017-09-03 00:09:11,052 [7523] supervisor
2017-09-03 00:09:11,052 [7523] supervisor [None] get http://169.254.169.254/latest/meta-data/local-hostname 200 10 0 0.046
2017-09-03 00:09:11,101 [7523] supervisor
2017-09-03 00:09:11,101 [7523] supervisor [None] get http://169.254.169.254/latest/meta-data/public-hostname 200 10 0 0.049
2017-09-03 00:09:11,148 [7523] supervisor
2017-09-03 00:09:11,149 [7523] supervisor [None] get http://169.254.169.254/latest/meta-data/ami-id 200 10 0 0.047
2017-09-03 00:09:11,194 [7523] supervisor
2017-09-03 00:09:11,194 [7523] supervisor [None] get http://169.254.169.254/latest/meta-data/local-ipv4 200 10 0 0.045
2017-09-03 00:09:11,241 [7523] supervisor
2017-09-03 00:09:11,242 [7523] supervisor [None] get http://169.254.169.254/latest/meta-data/public-keys 200 10 0 0.047
2017-09-03 00:09:11,288 [7523] supervisor 45.32.238.155
2017-09-03 00:09:11,288 [7523] supervisor [None] get http://169.254.169.254/latest/meta-data/public-ipv4 200 10 13 0.046
2017-09-03 00:09:11,331 [7523] supervisor
2017-09-03 00:09:11,331 [7523] supervisor [None] get http://169.254.169.254/latest/meta-data/reservation-id 200 10 0 0.043
2017-09-03 00:09:11,335 [7523] supervisor "system" object registered with ObjectsTank (id: 1, name: system @ nl-ams-ubnt02.xyz.se)
2017-09-03 00:09:11,335 [7523] supervisor system objects: ['a3fcaaaf1faaa6bcbe39dd400721cf34184645407b765fc55e8777592ece733a']
2017-09-03 00:09:11,336 [7523] supervisor agent started, version=0.45-2 pid=7523 uuid=xxx hostname=nl-ams-ubnt02.xyz.se
2017-09-03 00:09:11,336 [7523] supervisor starting object "system" a3fcaaaf1faaa6bcbe39dd400721cf34184645407b765fc55e8777592ece733a
2017-09-03 00:09:11,336 [7523] supervisor started "<bound method SystemMetaCollector.run of <amplify.agent.collectors.system.meta.SystemMetaCollector object at 0x7ff7a85fbdd0>>"
2017-09-03 00:09:11,336 [7523] supervisor started "<bound method SystemMetricsCollector.run of <amplify.agent.collectors.system.metrics.SystemMetricsCollector object at 0x7ff7a838ff50>>"
2017-09-03 00:09:11,343 [7523] supervisor ps nginx output: ['18688     1 nginx: master process /opt/sp/nginx/sbin/nginx', '18691 18688 nginx: worker process', '']
2017-09-03 00:09:11,363 [7523] supervisor failed to stat /usr/local/nginx/conf/ due to: OSError
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/amplify/agent/objects/nginx/config/parser.py", line 264, in get_filesystem_info
    size = os.path.getsize(path)
  File "/usr/lib/python2.7/genericpath.py", line 57, in getsize
    return os.stat(filename).st_size
OSError: [Errno 2] No such file or directory: '/usr/local/nginx/conf/'
2017-09-03 00:09:11,365 [7523] supervisor failed to read /usr/local/nginx/conf/ due to: OSError
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/amplify/agent/objects/nginx/config/parser.py", line 309, in populate_directory
    os.listdir(dir_path)
OSError: [Errno 2] No such file or directory: '/usr/local/nginx/conf/'
2017-09-03 00:09:11,365 [7523] supervisor failed to read /usr/local/nginx/conf/nginx.conf due to: IOError
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/amplify/agent/objects/nginx/config/parser.py", line 371, in lightweight_include_search
    for line in open(file_path):
IOError: [Errno 2] No such file or directory: '/usr/local/nginx/conf/nginx.conf'
2017-09-03 00:09:11,365 [7523] supervisor failed to stat /usr/local/nginx/conf/nginx.conf due to: OSError
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/amplify/agent/objects/nginx/config/parser.py", line 264, in get_filesystem_info
    size = os.path.getsize(path)
  File "/usr/lib/python2.7/genericpath.py", line 57, in getsize
    return os.stat(filename).st_size
OSError: [Errno 2] No such file or directory: '/usr/local/nginx/conf/nginx.conf'
2017-09-03 00:09:11,365 [7523] supervisor found 1 files for /usr/local/nginx/conf/nginx.conf
2017-09-03 00:09:11,365 [7523] supervisor found 1 directories for /usr/local/nginx/conf/nginx.conf
2017-09-03 00:09:11,366 [7523] supervisor parsing full tree of /usr/local/nginx/conf/nginx.conf
2017-09-03 00:09:11,366 [7523] supervisor failed to stat /usr/local/nginx/conf/ due to: OSError
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/amplify/agent/objects/nginx/config/parser.py", line 264, in get_filesystem_info
    size = os.path.getsize(path)
  File "/usr/lib/python2.7/genericpath.py", line 57, in getsize
    return os.stat(filename).st_size
OSError: [Errno 2] No such file or directory: '/usr/local/nginx/conf/'
2017-09-03 00:09:11,366 [7523] supervisor failed to read /usr/local/nginx/conf/ due to: OSError
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/amplify/agent/objects/nginx/config/parser.py", line 309, in populate_directory
    os.listdir(dir_path)
OSError: [Errno 2] No such file or directory: '/usr/local/nginx/conf/'
2017-09-03 00:09:11,366 [7523] supervisor failed to stat /usr/local/nginx/conf/nginx.conf due to: OSError
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/amplify/agent/objects/nginx/config/parser.py", line 264, in get_filesystem_info
    size = os.path.getsize(path)
  File "/usr/lib/python2.7/genericpath.py", line 57, in getsize
    return os.stat(filename).st_size
OSError: [Errno 2] No such file or directory: '/usr/local/nginx/conf/nginx.conf'
2017-09-03 00:09:11,366 [7523] supervisor failed to read /usr/local/nginx/conf/nginx.conf due to: IOError
2017-09-03 00:09:11,366 [7523] supervisor additional info:
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/amplify/agent/objects/nginx/config/parser.py", line 424, in __pyparse
    source = open(file_path).read()
IOError: [Errno 2] No such file or directory: '/usr/local/nginx/conf/nginx.conf'
2017-09-03 00:09:11,367 [7523] supervisor bc79e796204b56abe1c9a0848550cc1fb805c83ea1ffeb60fa83794d064977da config parse on startup in 0.004
2017-09-03 00:09:11,374 [7523] supervisor "nginx" object registered with ObjectsTank (id: 2, name: nginx 1.13.3 @ nl-ams-ubnt02.xyz.se)
2017-09-03 00:09:11,374 [7523] supervisor nginx objects: ['bc79e796204b56abe1c9a0848550cc1fb805c83ea1ffeb60fa83794d064977da']
2017-09-03 00:09:11,374 [7523] supervisor starting object "nginx" bc79e796204b56abe1c9a0848550cc1fb805c83ea1ffeb60fa83794d064977da
2017-09-03 00:09:11,374 [7523] supervisor started "<bound method NginxConfigCollector.run of <amplify.agent.collectors.nginx.config.NginxConfigCollector object at 0x7ff7a8321dd0>>"
2017-09-03 00:09:11,374 [7523] supervisor started "<bound method NginxMetaCollector.run of <amplify.agent.collectors.nginx.meta.NginxMetaCollector object at 0x7ff7a8343b90>>"
2017-09-03 00:09:11,374 [7523] supervisor started "<bound method NginxMetricsCollector.run of <amplify.agent.collectors.nginx.metrics.NginxMetricsCollector object at 0x7ff7a8343c10>>"
2017-09-03 00:09:11,375 [7523] supervisor plus objects: []
2017-09-03 00:09:11,375 [7523] supervisor phpfpm_pool objects: []
2017-09-03 00:09:11,381 [7523] supervisor ps php-fpm output: [' 2216     1 php-fpm: master process (/etc/php5.6-sp/fpm.conf)', ' 4516 12447 php-fpm: pool smb', ' 4517 12447 php-fpm: pool smb', ' 4556     1 php-fpm: master process (/etc/php7.2-sp/fpm.conf)', ' 6632 12447 php-fpm: pool smb', '11222 12447 php-fpm: pool smb', '12447     1 php-fpm: master process (/etc/php7.0-sp/fpm.conf)', '12553     1 php-fpm: master process (/etc/php7.1-sp/fpm.conf)', '24609     1 php-fpm: master process (/etc/php5.4-sp/fpm.conf)', '24774     1 php-fpm: master process (/etc/php5.5-sp/fpm.conf)', '31095 12447 php-fpm: pool smb', '']
2017-09-03 00:09:11,382 [7523] supervisor "phpfpm" object registered with ObjectsTank (id: 3, name: phpfpm master @ nl-ams-ubnt02.xyz.se)
2017-09-03 00:09:11,382 [7523] supervisor "phpfpm" object registered with ObjectsTank (id: 4, name: phpfpm master @ nl-ams-ubnt02.xyz.se)
2017-09-03 00:09:11,382 [7523] supervisor "phpfpm" object registered with ObjectsTank (id: 5, name: phpfpm master @ nl-ams-ubnt02.xyz.se)
2017-09-03 00:09:11,383 [7523] supervisor "phpfpm" object registered with ObjectsTank (id: 6, name: phpfpm master @ nl-ams-ubnt02.xyz.se)
2017-09-03 00:09:11,383 [7523] supervisor "phpfpm" object registered with ObjectsTank (id: 7, name: phpfpm master @ nl-ams-ubnt02.xyz.se)
2017-09-03 00:09:11,383 [7523] supervisor "phpfpm" object registered with ObjectsTank (id: 8, name: phpfpm master @ nl-ams-ubnt02.xyz.se)
2017-09-03 00:09:11,383 [7523] supervisor phpfpm objects: ['4f1e1d8d5d60f4c323e90dfdf5a6c154868a56829698e1a62845ceb576018dab', 'b82b4a21c1d8c15d114b0846429fecb583f53924a68b503dd1c3b389bf7e3a32', '5e9fdc0713c505d12b9738c5b0a40b24902f5fef191418b591934581c4274a43', '1f14cbf7fc7406516950d6ca5de2113ae05154ece916ba89461c1bec45086605', 'cf34d141633d2753fd46de568b7ae96762a33585851669ac695e038799df939b', 'e4042a9a1461ad8f57c711e7c606bbc3d5205ca720864f426fe1208a2b51345e']
2017-09-03 00:09:11,383 [7523] supervisor starting object "phpfpm" 4f1e1d8d5d60f4c323e90dfdf5a6c154868a56829698e1a62845ceb576018dab
2017-09-03 00:09:11,384 [7523] supervisor started "<bound method PHPFPMMetaCollector.run of <amplify.ext.phpfpm.collectors.master.meta.PHPFPMMetaCollector object at 0x7ff7a834ecd0>>"
2017-09-03 00:09:11,384 [7523] supervisor started "<bound method PHPFPMMetricsCollector.run of <amplify.ext.phpfpm.collectors.master.metrics.PHPFPMMetricsCollector object at 0x7ff7a834ed10>>"
2017-09-03 00:09:11,384 [7523] supervisor starting object "phpfpm" b82b4a21c1d8c15d114b0846429fecb583f53924a68b503dd1c3b389bf7e3a32
2017-09-03 00:09:11,384 [7523] supervisor started "<bound method PHPFPMMetaCollector.run of <amplify.ext.phpfpm.collectors.master.meta.PHPFPMMetaCollector object at 0x7ff7a834ef10>>"
2017-09-03 00:09:11,384 [7523] supervisor started "<bound method PHPFPMMetricsCollector.run of <amplify.ext.phpfpm.collectors.master.metrics.PHPFPMMetricsCollector object at 0x7ff7a834ef50>>"
2017-09-03 00:09:11,384 [7523] supervisor starting object "phpfpm" 5e9fdc0713c505d12b9738c5b0a40b24902f5fef191418b591934581c4274a43
2017-09-03 00:09:11,384 [7523] supervisor started "<bound method PHPFPMMetaCollector.run of <amplify.ext.phpfpm.collectors.master.meta.PHPFPMMetaCollector object at 0x7ff7a8321d90>>"
2017-09-03 00:09:11,384 [7523] supervisor started "<bound method PHPFPMMetricsCollector.run of <amplify.ext.phpfpm.collectors.master.metrics.PHPFPMMetricsCollector object at 0x7ff7a83218d0>>"
2017-09-03 00:09:11,385 [7523] supervisor starting object "phpfpm" 1f14cbf7fc7406516950d6ca5de2113ae05154ece916ba89461c1bec45086605
2017-09-03 00:09:11,385 [7523] supervisor started "<bound method PHPFPMMetaCollector.run of <amplify.ext.phpfpm.collectors.master.meta.PHPFPMMetaCollector object at 0x7ff7a82da210>>"
2017-09-03 00:09:11,385 [7523] supervisor started "<bound method PHPFPMMetricsCollector.run of <amplify.ext.phpfpm.collectors.master.metrics.PHPFPMMetricsCollector object at 0x7ff7a82da250>>"
2017-09-03 00:09:11,385 [7523] supervisor starting object "phpfpm" cf34d141633d2753fd46de568b7ae96762a33585851669ac695e038799df939b
2017-09-03 00:09:11,385 [7523] supervisor started "<bound method PHPFPMMetaCollector.run of <amplify.ext.phpfpm.collectors.master.meta.PHPFPMMetaCollector object at 0x7ff7a82da450>>"
2017-09-03 00:09:11,385 [7523] supervisor started "<bound method PHPFPMMetricsCollector.run of <amplify.ext.phpfpm.collectors.master.metrics.PHPFPMMetricsCollector object at 0x7ff7a82da490>>"
2017-09-03 00:09:11,385 [7523] supervisor starting object "phpfpm" e4042a9a1461ad8f57c711e7c606bbc3d5205ca720864f426fe1208a2b51345e
2017-09-03 00:09:11,385 [7523] supervisor started "<bound method PHPFPMMetaCollector.run of <amplify.ext.phpfpm.collectors.master.meta.PHPFPMMetaCollector object at 0x7ff7a82da690>>"
2017-09-03 00:09:11,386 [7523] supervisor started "<bound method PHPFPMMetricsCollector.run of <amplify.ext.phpfpm.collectors.master.metrics.PHPFPMMetricsCollector object at 0x7ff7a82da6d0>>"
2017-09-03 00:09:11,401 [7523] sys_meta a3fcaaaf1faaa6bcbe39dd400721cf34184645407b765fc55e8777592ece733a collect in 0.015
2017-09-03 00:09:11,405 [7523] sys_metrics a3fcaaaf1faaa6bcbe39dd400721cf34184645407b765fc55e8777592ece733a collect in 0.004
2017-09-03 00:09:11,406 [7523] nginx_config bc79e796204b56abe1c9a0848550cc1fb805c83ea1ffeb60fa83794d064977da collect in 0.000
2017-09-03 00:09:11,476 [7523] nginx_meta bc79e796204b56abe1c9a0848550cc1fb805c83ea1ffeb60fa83794d064977da collect in 0.070
2017-09-03 00:09:11,477 [7523] nginx_metrics bc79e796204b56abe1c9a0848550cc1fb805c83ea1ffeb60fa83794d064977da collect in 0.000
2017-09-03 00:09:11,493 [7523] phpfpm_meta failed to find php-fpm bin path, last attempt: "ls -la /proc/31095/exe" failed due to AmplifySubprocessError
2017-09-03 00:09:11,494 [7523] phpfpm_meta additional info:
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/amplify/ext/phpfpm/collectors/master/meta.py", line 80, in bin_path
    ls, _ = subp.call(ls_cmd)
  File "/usr/lib/python2.7/dist-packages/amplify/agent/common/util/subp.py", line 33, in call
    raise AmplifySubprocessError(message=command, payload=dict(returncode=process.returncode))
AmplifySubprocessError: (message=ls -la /proc/31095/exe, payload={'returncode': 2})
2017-09-03 00:09:11,495 [7523] phpfpm_meta 4f1e1d8d5d60f4c323e90dfdf5a6c154868a56829698e1a62845ceb576018dab collect in 0.017
2017-09-03 00:09:11,495 [7523] phpfpm_metrics 4f1e1d8d5d60f4c323e90dfdf5a6c154868a56829698e1a62845ceb576018dab collect in 0.000
2017-09-03 00:09:11,498 [7523] phpfpm_meta failed to find php-fpm bin path, last attempt: "ls -la /proc/4556/exe" failed due to AmplifySubprocessError
2017-09-03 00:09:11,499 [7523] phpfpm_meta additional info:
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/amplify/ext/phpfpm/collectors/master/meta.py", line 80, in bin_path
    ls, _ = subp.call(ls_cmd)
  File "/usr/lib/python2.7/dist-packages/amplify/agent/common/util/subp.py", line 33, in call
    raise AmplifySubprocessError(message=command, payload=dict(returncode=process.returncode))
AmplifySubprocessError: (message=ls -la /proc/4556/exe, payload={'returncode': 2})
2017-09-03 00:09:11,499 [7523] phpfpm_meta b82b4a21c1d8c15d114b0846429fecb583f53924a68b503dd1c3b389bf7e3a32 collect in 0.004
2017-09-03 00:09:11,499 [7523] phpfpm_metrics b82b4a21c1d8c15d114b0846429fecb583f53924a68b503dd1c3b389bf7e3a32 collect in 0.000
2017-09-03 00:09:11,502 [7523] phpfpm_meta failed to find php-fpm bin path, last attempt: "ls -la /proc/12553/exe" failed due to AmplifySubprocessError
2017-09-03 00:09:11,503 [7523] phpfpm_meta additional info:
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/amplify/ext/phpfpm/collectors/master/meta.py", line 80, in bin_path
    ls, _ = subp.call(ls_cmd)
  File "/usr/lib/python2.7/dist-packages/amplify/agent/common/util/subp.py", line 33, in call
    raise AmplifySubprocessError(message=command, payload=dict(returncode=process.returncode))
AmplifySubprocessError: (message=ls -la /proc/12553/exe, payload={'returncode': 2})
2017-09-03 00:09:11,503 [7523] phpfpm_meta 5e9fdc0713c505d12b9738c5b0a40b24902f5fef191418b591934581c4274a43 collect in 0.003
2017-09-03 00:09:11,503 [7523] phpfpm_metrics 5e9fdc0713c505d12b9738c5b0a40b24902f5fef191418b591934581c4274a43 collect in 0.000
2017-09-03 00:09:11,506 [7523] phpfpm_meta failed to find php-fpm bin path, last attempt: "ls -la /proc/2216/exe" failed due to AmplifySubprocessError
2017-09-03 00:09:11,506 [7523] phpfpm_meta additional info:
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/amplify/ext/phpfpm/collectors/master/meta.py", line 80, in bin_path
    ls, _ = subp.call(ls_cmd)
  File "/usr/lib/python2.7/dist-packages/amplify/agent/common/util/subp.py", line 33, in call
    raise AmplifySubprocessError(message=command, payload=dict(returncode=process.returncode))
AmplifySubprocessError: (message=ls -la /proc/2216/exe, payload={'returncode': 2})
2017-09-03 00:09:11,507 [7523] phpfpm_meta 1f14cbf7fc7406516950d6ca5de2113ae05154ece916ba89461c1bec45086605 collect in 0.003
2017-09-03 00:09:11,507 [7523] phpfpm_metrics 1f14cbf7fc7406516950d6ca5de2113ae05154ece916ba89461c1bec45086605 collect in 0.000
2017-09-03 00:09:11,510 [7523] phpfpm_meta failed to find php-fpm bin path, last attempt: "ls -la /proc/24774/exe" failed due to AmplifySubprocessError
2017-09-03 00:09:11,510 [7523] phpfpm_meta additional info:
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/amplify/ext/phpfpm/collectors/master/meta.py", line 80, in bin_path
    ls, _ = subp.call(ls_cmd)
  File "/usr/lib/python2.7/dist-packages/amplify/agent/common/util/subp.py", line 33, in call
    raise AmplifySubprocessError(message=command, payload=dict(returncode=process.returncode))
AmplifySubprocessError: (message=ls -la /proc/24774/exe, payload={'returncode': 2})
2017-09-03 00:09:11,510 [7523] phpfpm_meta cf34d141633d2753fd46de568b7ae96762a33585851669ac695e038799df939b collect in 0.003
2017-09-03 00:09:11,511 [7523] phpfpm_metrics cf34d141633d2753fd46de568b7ae96762a33585851669ac695e038799df939b collect in 0.000
2017-09-03 00:09:11,514 [7523] phpfpm_meta failed to find php-fpm bin path, last attempt: "ls -la /proc/24609/exe" failed due to AmplifySubprocessError
2017-09-03 00:09:11,514 [7523] phpfpm_meta additional info:
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/amplify/ext/phpfpm/collectors/master/meta.py", line 80, in bin_path
    ls, _ = subp.call(ls_cmd)
  File "/usr/lib/python2.7/dist-packages/amplify/agent/common/util/subp.py", line 33, in call
    raise AmplifySubprocessError(message=command, payload=dict(returncode=process.returncode))
AmplifySubprocessError: (message=ls -la /proc/24609/exe, payload={'returncode': 2})
2017-09-03 00:09:11,514 [7523] phpfpm_meta e4042a9a1461ad8f57c711e7c606bbc3d5205ca720864f426fe1208a2b51345e collect in 0.003
2017-09-03 00:09:11,514 [7523] phpfpm_metrics e4042a9a1461ad8f57c711e7c606bbc3d5205ca720864f426fe1208a2b51345e collect in 0.000
2017-09-03 00:09:16,388 [7523] supervisor system objects: ['a3fcaaaf1faaa6bcbe39dd400721cf34184645407b765fc55e8777592ece733a']
2017-09-03 00:09:16,400 [7523] supervisor ps nginx output: ['18688     1 nginx: master process /opt/sp/nginx/sbin/nginx', '18691 18688 nginx: worker process', '']
2017-09-03 00:09:16,421 [7523] supervisor nginx objects: ['bc79e796204b56abe1c9a0848550cc1fb805c83ea1ffeb60fa83794d064977da']
2017-09-03 00:09:16,424 [7523] supervisor plus objects: []
2017-09-03 00:09:16,425 [7523] supervisor found a pool "fakepool" with missing or commented directives "status_path" {'status_path': None, 'name': 'fakepool', 'file': '/etc/php7.0-sp/fpm.conf', 'listen': '/tmp/php7.0-fpm-sp.fakepool.sock'}
2017-09-03 00:09:16,426 [7523] supervisor found a pool "fakepool" with missing or commented directives "status_path" {'status_path': None, 'name': 'fakepool', 'file': '/etc/php7.2-sp/fpm.conf', 'listen': '/tmp/php7.2-fpm-sp.fakepool.sock'}
2017-09-03 00:09:16,428 [7523] supervisor found a pool "fakepool" with missing or commented directives "status_path" {'status_path': None, 'name': 'fakepool', 'file': '/etc/php7.1-sp/fpm.conf', 'listen': '/tmp/php7.1-fpm-sp.fakepool.sock'}
2017-09-03 00:09:16,429 [7523] supervisor found a pool "fakepool" with missing or commented directives "status_path" {'status_path': None, 'name': 'fakepool', 'file': '/etc/php5.6-sp/fpm.conf', 'listen': '/tmp/php5.6-fpm-sp.fakepool.sock'}
2017-09-03 00:09:16,430 [7523] supervisor found a pool "fakepool" with missing or commented directives "status_path" {'status_path': None, 'name': 'fakepool', 'file': '/etc/php5.5-sp/fpm.conf', 'listen': '/tmp/php5.5-fpm-sp.fakepool.sock'}
2017-09-03 00:09:16,431 [7523] supervisor found a pool "fakepool" with missing or commented directives "status_path" {'status_path': None, 'name': 'fakepool', 'file': '/etc/php5.4-sp/fpm.conf', 'listen': '/tmp/php5.4-fpm-sp.fakepool.sock'}
2017-09-03 00:09:16,434 [7523] supervisor "phpfpm_pool" object registered with ObjectsTank (id: 9, name: phpfpm smb @ nl-ams-ubnt02.xyz.se)
2017-09-03 00:09:16,436 [7523] supervisor phpfpm_pool objects: ['b2aa64a78642861694c905a64fe9d241374be159f92cf9eac5a2e19c714bc822']
2017-09-03 00:09:16,436 [7523] supervisor starting object "phpfpm_pool" b2aa64a78642861694c905a64fe9d241374be159f92cf9eac5a2e19c714bc822
2017-09-03 00:09:16,436 [7523] supervisor started "<bound method PHPFPMPoolMetaCollector.run of <amplify.ext.phpfpm.collectors.pool.meta.PHPFPMPoolMetaCollector object at 0x7ff7a830aad0>>"
2017-09-03 00:09:16,436 [7523] supervisor started "<bound method PHPFPMPoolMetricsCollector.run of <amplify.ext.phpfpm.collectors.pool.metrics.PHPFPMPoolMetricsCollector object at 0x7ff7a830ab90>>"
2017-09-03 00:09:16,448 [7523] supervisor ps php-fpm output: [' 2216     1 php-fpm: master process (/etc/php5.6-sp/fpm.conf)', ' 4516 12447 php-fpm: pool smb', ' 4517 12447 php-fpm: pool smb', ' 4556     1 php-fpm: master process (/etc/php7.2-sp/fpm.conf)', ' 6632 12447 php-fpm: pool smb', '11222 12447 php-fpm: pool smb', '12447     1 php-fpm: master process (/etc/php7.0-sp/fpm.conf)', '12553     1 php-fpm: master process (/etc/php7.1-sp/fpm.conf)', '24609     1 php-fpm: master process (/etc/php5.4-sp/fpm.conf)', '24774     1 php-fpm: master process (/etc/php5.5-sp/fpm.conf)', '31095 12447 php-fpm: pool smb', '']
2017-09-03 00:09:16,452 [7523] supervisor phpfpm objects: ['4f1e1d8d5d60f4c323e90dfdf5a6c154868a56829698e1a62845ceb576018dab', 'b82b4a21c1d8c15d114b0846429fecb583f53924a68b503dd1c3b389bf7e3a32', '5e9fdc0713c505d12b9738c5b0a40b24902f5fef191418b591934581c4274a43', '1f14cbf7fc7406516950d6ca5de2113ae05154ece916ba89461c1bec45086605', 'cf34d141633d2753fd46de568b7ae96762a33585851669ac695e038799df939b', 'e4042a9a1461ad8f57c711e7c606bbc3d5205ca720864f426fe1208a2b51345e']
Raboo commented 7 years ago

For anyone else having the same problem. nginx amplify team is working on a fix. But as a workaround you can make a symlink of the /etc/nginx folder to /usr/local/nginx/conf.

oviliz commented 7 years ago

@Raboo , do you mean /etc/nginx-sp/conf.d to /usr/local/nginx/conf.d ?

Raboo commented 7 years ago

no.

$ ls -l /usr/local/nginx/conf
lrwxrwxrwx 1 root root 13 Sep  6 09:13 /usr/local/nginx/conf -> /etc/nginx-sp
oviliz commented 7 years ago

Thanks. Figured it out from by reading the logs. ln -s /etc/nginx-sp /usr/local/nginx/conf