https://github.com/osquery/osquery logo
#general
Title
# general
p

plaintext

01/14/2021, 9:49 PM
Copy code
TASK [Install/Setup Nginx] **************************************************************************************************************************************************************************************
fatal: [192.168.6.130]: FAILED! => {"cache_update_time": 1610659830, "cache_updated": false, "changed": false, "msg": "'/usr/bin/apt-get -y -o \"Dpkg::Options::=--force-confdef\" -o \"Dpkg::Options::=--force-confold\"      install 'nginx'' failed: No apport report written because the error message indicates its a followup error from a previous failure.\nE: Sub-process /usr/bin/dpkg returned an error code (1)\n", "rc": 100, "stderr": "No apport report written because the error message indicates its a followup error from a previous failure.\nE: Sub-process /usr/bin/dpkg returned an error code (1)\n", "stderr_lines": ["No apport report written because the error message indicates its a followup error from a previous failure.", "E: Sub-process /usr/bin/dpkg returned an error code (1)"], "stdout": "Reading package lists...\nBuilding dependency tree...\nReading state information...\nThe following additional packages will be installed:\n  fontconfig-config fonts-dejavu-core libfontconfig1 libgd3 libjbig0\n  libjpeg-turbo8 libjpeg8 libnginx-mod-http-image-filter\n  libnginx-mod-http-xslt-filter libnginx-mod-mail libnginx-mod-stream libtiff5\n  libwebp6 libxpm4 nginx-common nginx-core\nSuggested packages:\n  libgd-tools fcgiwrap nginx-doc ssl-cert\nThe following NEW packages will be installed:\n  fontconfig-config fonts-dejavu-core libfontconfig1 libgd3 libjbig0\n  libjpeg-turbo8 libjpeg8 libnginx-mod-http-image-filter\n  libnginx-mod-http-xslt-filter libnginx-mod-mail libnginx-mod-stream libtiff5\n  libwebp6 libxpm4 nginx nginx-common nginx-core\n0 upgraded, 17 newly installed, 0 to remove and 0 not upgraded.\nNeed to get 2431 kB of archives.\nAfter this operation, 7891 kB of additional disk space will be used.\nGet:1 <http://archive.ubuntu.com/ubuntu> focal/main amd64 fonts-dejavu-core all 2.37-1 [1041 kB]\nGet:2 <http://archive.ubuntu.com/ubuntu> focal/main amd64 fontconfig-config all 2.13.1-2ubuntu3 [28.8 kB]\nGet:3 <http://archive.ubuntu.com/ubuntu> focal/main amd64 libfontconfig1 amd64 2.13.1-2ubuntu3 [114 kB]\nGet:4 <http://archive.ubuntu.com/ubuntu> focal-updates/main amd64 libjpeg-turbo8 amd64 2.0.3-0ubuntu1.20.04.1 [117 kB]\nGet:5 <http://archive.ubuntu.com/ubuntu> focal/main amd64 libjpeg8 amd64 8c-2ubuntu8 [2194 B]\nGet:6 <http://archive.ubuntu.com/ubuntu> focal/main amd64 libjbig0 amd64 2.1-3.1build1 [26.7 kB]\nGet:7 <http://archive.ubuntu.com/ubuntu> focal/main amd64 libwebp6 amd64 0.6.1-2 [185 kB]\nGet:8 <http://archive.ubuntu.com/ubuntu> focal/main amd64 libtiff5 amd64 4.1.0+git191117-2build1 [161 kB]\nGet:9 <http://archive.ubuntu.com/ubuntu> focal/main amd64 libxpm4 amd64 1:3.5.12-1 [34.0 kB]\nGet:10 <http://archive.ubuntu.com/ubuntu> focal/main amd64 libgd3 amd64 2.2.5-5.2ubuntu2 [118 kB]\nGet:11 <http://archive.ubuntu.com/ubuntu> focal-updates/main amd64 nginx-common all 1.18.0-0ubuntu1 [37.3 kB]\nGet:12 <http://archive.ubuntu.com/ubuntu> focal-updates/main amd64 libnginx-mod-http-image-filter amd64 1.18.0-0ubuntu1 [14.3 kB]\nGet:13 <http://archive.ubuntu.com/ubuntu> focal-updates/main amd64 libnginx-mod-http-xslt-filter amd64 1.18.0-0ubuntu1 [12.6 kB]\nGet:14 <http://archive.ubuntu.com/ubuntu> focal-updates/main amd64 libnginx-mod-mail amd64 1.18.0-0ubuntu1 [42.3 kB]\nGet:15 <http://archive.ubuntu.com/ubuntu> focal-updates/main amd64 libnginx-mod-stream amd64 1.18.0-0ubuntu1 [66.9 kB]\nGet:16 <http://archive.ubuntu.com/ubuntu> focal-updates/main amd64 nginx-core amd64 1.18.0-0ubuntu1 [425 kB]\nGet:17 <http://archive.ubuntu.com/ubuntu> focal-updates/main amd64 nginx all 1.18.0-0ubuntu1 [3624 B]\nPreconfiguring packages ...\nFetched 2431 kB in 2s (1445 kB/s)\nSelecting previously unselected package fonts-dejavu-core.\r\n(Reading database ... \r(Reading database ... 5%\r(Reading database ... 10%\r(Reading database ... 15%\r(Reading database ... 20%\r(Reading database ... 25%\r(Reading database ... 30%\r(Reading database ... 35%\r(Reading database ... 40%\r(Reading database ... 45%\r(Reading database ... 50%\r(Reading database ... 55%\r(Reading database ... 60%\r(Reading database ... 65%\r(Reading database ... 70%\r(Reading database ... 75%\r(Reading database ... 80%\r(Reading database ... 85%\r(Reading database ... 90%\r(Reading database ... 95%\r(Reading database ... 100%\r(Reading database ... 114487 files and directories currently installed.)\r\nPreparing to unpack .../00-fonts-dejavu-core_2.37-1_all.deb ...\r\nUnpacking fonts-dejavu-core (2.37-1) ...\r\nSelecting previously unselected package fontconfig-config.\r\nPreparing to unpack .../01-fontconfig-config_2.13.1-2ubuntu3_all.deb ...\r\nUnpacking fontconfig-config (2.13.1-2ubuntu3) ...\r\nSelecting previously unselected package libfontconfig1:amd64.\r\nPreparing to unpack .../02-libfontconfig1_2.13.1-2ubuntu3_amd64.deb ...\r\nUnpacking libfontconfig1:amd64 (2.13.1-2ubuntu3) ...\r\nSelecting previously unselected package libjpeg-turbo8:amd64.\r\nPreparing to unpack .../03-libjpeg-turbo8_2.0.3-0ubuntu1.20.04.1_amd64.deb ...\r\nUnpacking libjpeg-turbo8:amd64 (2.0.3-0ubuntu1.20.04.1) ...\r\nSelecting previously unselected package libjpeg8:amd64.\r\nPreparing to unpack .../04-libjpeg8_8c-2ubuntu8_amd64.deb ...\r\nUnpacking libjpeg8:amd64 (8c-2ubuntu8) ...\r\nSelecting previously unselected package libjbig0:amd64.\r\nPreparing to unpack .../05-libjbig0_2.1-3.1build1_amd64.deb ...\r\nUnpacking libjbig0:amd64 (2.1-3.1build1) ...\r\nSelecting previously unselected package libwebp6:amd64.\r\nPreparing to unpack .../06-libwebp6_0.6.1-2_amd64.deb ...\r\nUnpacking libwebp6:amd64 (0.6.1-2) ...\r\nSelecting previously unselected package libtiff5:amd64.\r\nPreparing to unpack .../07-libtiff5_4.1.0+git191117-2build1_amd64.deb ...\r\nUnpacking libtiff5:amd64 (4.1.0+git191117-2build1) ...\r\nSelecting previously unselected package libxpm4:amd64.\r\nPreparing to unpack .../08-libxpm4_1%3a3.5.12-1_amd64.deb ...\r\nUnpacking libxpm4:amd64 (1:3.5.12-1) ...\r\nSelecting previously unselected package libgd3:amd64.\r\nPreparing to unpack .../09-libgd3_2.2.5-5.2ubuntu2_amd64.deb ...\r\nUnpacking libgd3:amd64 (2.2.5-5.2ubuntu2) ...\r\nSelecting previously unselected package nginx-common.\r\nPreparing to unpack .../10-nginx-common_1.18.0-0ubuntu1_all.deb ...\r\nUnpacking nginx-common (1.18.0-0ubuntu1) ...\r\nSelecting previously unselected package libnginx-mod-http-image-filter.\r\nPreparing to unpack .../11-libnginx-mod-http-image-filter_1.18.0-0ubuntu1_amd64.deb ...\r\nUnpacking libnginx-mod-http-image-filter (1.18.0-0ubuntu1) ...\r\nSelecting previously unselected package libnginx-mod-http-xslt-filter.\r\nPreparing to unpack .../12-libnginx-mod-http-xslt-filter_1.18.0-0ubuntu1_amd64.deb ...\r\nUnpacking libnginx-mod-http-xslt-filter (1.18.0-0ubuntu1) ...\r\nSelecting previously unselected package libnginx-mod-mail.\r\nPreparing to unpack .../13-libnginx-mod-mail_1.18.0-0ubuntu1_amd64.deb ...\r\nUnpacking libnginx-mod-mail (1.18.0-0ubuntu1) ...\r\nSelecting previously unselected package libnginx-mod-stream.\r\nPreparing to unpack .../14-libnginx-mod-stream_1.18.0-0ubuntu1_amd64.deb ...\r\nUnpacking libnginx-mod-stream (1.18.0-0ubuntu1) ...\r\nSelecting previously unselected package nginx-core.\r\nPreparing to unpack .../15-nginx-core_1.18.0-0ubuntu1_amd64.deb ...\r\nUnpacking nginx-core (1.18.0-0ubuntu1) ...\r\nSelecting previously unselected package nginx.\r\nPreparing to unpack .../16-nginx_1.18.0-0ubuntu1_all.deb ...\r\nUnpacking nginx (1.18.0-0ubuntu1) ...\r\nSetting up libxpm4:amd64 (1:3.5.12-1) ...\r\nSetting up nginx-common (1.18.0-0ubuntu1) ...\r\nCreated symlink /etc/systemd/system/multi-user.target.wants/nginx.service -> .....<removed too long>
This error is generated because my server doesn't have IPv6 enabled. The nginx default installation conf has ipv6 enable and this make the service fail to start. You can comment ipv6 like this to make it works:
Copy code
/etc/nginx/sites-enabled/default

# listen [::]:80 default_server;
You may add an extra check for that @CptOfEvilMinions
c

CptOfEvilMinions

01/15/2021, 3:50 PM
@plaintext I think the better solution is to check
net.ipv6.conf.all.disable_ipv6
and n`et.ipv6.conf.default.disable_ipv6` to determine if these are enabled or not and act accordingly.
p

plaintext

01/15/2021, 7:38 PM
working 🙂
just remove the disabled ipv6 from my ubuntu VM base snapshot
c

CptOfEvilMinions

01/15/2021, 11:47 PM
Excellent, I will try and add a check to see if IPv4/IPv6 is enabled
@plaintext in latest push to my repo I added Ansible code to detect if IPv6 was disabled and NGINX has the proper config.
9 Views