issue while importing metrics with datadog - linux

i am struggling with importing metrics with datadog...I am getting below error in spite of installing all required packages...
( - instance #0 [ERROR]: Exception('You need the "psutil" package to run this check',)
request you to please help me out here as this is prove to be a major showstopper.
[root#mudcsftpup01 init.d]# ./datadog-agent info
2017-08-31 11:31:20,416 | INFO | dd.collector | util(util.py:481) | Pid file is: /var/run/dd-agent/dd-agent.pid
Collector (v 4.4.0)
Status date: 2017-08-31 11:31:19 (1s ago)
Pid: 32028
Platform: Linux-3.10.0-514.el7.x86_64-x86_64-with-redhat-7.3-Maipo
Python Version: 2.7.5
Logs: , /var/log/datadog/collector.log, syslog:/dev/log
Clocks
======
NTP offset: Unknown (timed out)
System UTC time: 2017-08-31 06:01:25.512491
Paths
=====
conf.d: /etc/dd-agent/conf.d
checks.d: /usr/share/datadog/agent/checks.d
Hostnames
=========
socket-hostname: mudcsftpup01
hostname: mudcsftpup01
socket-fqdn: mudcsftpup01.paytm-pb.net
Checks
======
process
-------
- instance #0 [ERROR]: Exception('You need the "psutil" package to run this check',)
- instance #1 [ERROR]: Exception('You need the "psutil" package to run this check',)
- instance #2 [ERROR]: Exception('You need the "psutil" package to run this check',)
- instance #3 [ERROR]: Exception('You need the "psutil" package to run this check',)
- Collected 0 metrics, 0 events & 0 service checks
tcp_check
---------
- instance #0 [OK]
- instance #1 [OK]
- Collected 0 metrics, 0 events & 0 service checks
network
-------
- instance #0 [OK]
- Collected 0 metrics, 0 events & 0 service checks
Emitters
========
- http_emitter [OK]
2017-08-31 11:31:25,827 | INFO | dd.dogstatsd | util(util.py:481) | Pid file is: /var/run/dd-agent/dogstatsd.pid
Dogstatsd (v 4.4.0)
Status date: 2017-08-31 11:31:23 (2s ago)
Pid: 32053
Platform: Linux-3.10.0-514.el7.x86_64-x86_64-with-redhat-7.3-Maipo
Python Version: 2.7.5
Logs: , /var/log/datadog/dogstatsd.log, syslog:/dev/log
Flush count: 1
Packet Count: 0
Packets per second: 0.0
Metric count: 0
Event count: 0

Your answer appears to be there in the text -- you're missing a Python package. Try running sudo pip install psutil, then restarting the agent. Can you add your agent version, OS and version, and how you installed the agent to your text as well? It looks like you're also using a very old version of the agent (it's up to 5.17.* for a number of OS's) so there may be better package bundling or critical updates since v. 4.4.0. Try installing a newer version as well.

Please find the required
[root#mudcsftpup01 ~]# sudo pip install psutil
Requirement already satisfied: psutil in /usr/lib64/python2.7/site-packages

Related

How is ssh2 installed for PHP 7.4 on Rocky Linux?

I recently upgraded to Rocky. I am getting an error on a PHP SSH command that has worked for years. Everything I try fails for various reasons. I need to ssh from PHP. At this point I am not particular about the method used. This is the code used for ssh connections:
$ssh = ssh2_connect($ssh_domain);
if( ssh2_auth_password($ssh_user, $ssh_password) )
{
// send the command
}
but I get this error on the connect line:
Call to undefined function ssh2_connect()
I installed with
yum install libssh2-devel
Last metadata expiration check: 0:02:00 ago on Wed 03 Aug 2022 12:50:28 PM EDT.
Dependencies resolved.
====================================================================================================================================================
Package Architecture Version Repository Size
====================================================================================================================================================
Installing:
libssh2-devel x86_64 1.9.0-5.el8 epel 68 k
Transaction Summary
====================================================================================================================================================
Install 1 Package
Total download size: 68 k
Installed size: 288 k
Is this ok [y/N]: y
Downloading Packages:
libssh2-devel-1.9.0-5.el8.x86_64.rpm 309 kB/s | 68 kB 00:00
----------------------------------------------------------------------------------------------------------------------------------------------------
Total 141 kB/s | 68 kB 00:00
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Installing : libssh2-devel-1.9.0-5.el8.x86_64 1/1
Running scriptlet: libssh2-devel-1.9.0-5.el8.x86_64 1/1
Verifying : libssh2-devel-1.9.0-5.el8.x86_64 1/1
Installed:
libssh2-devel-1.9.0-5.el8.x86_64
Complete!
and then I restarted apache.
What am I doing wrong? Did I install the wrong package? Maybe I need to install something else?
Thanks for the help.

PlutoSDR AttributeError: module 'iio' on Ubuntu 20.04

When attempting to run flow graph in GNU Radio Companion, I get the following error:
AttributeError: module 'iio' has no attribute 'pluto_source'
I am running a new VMWare environment, on Windows, for Ubuntu 20.04.
I first installed the drivers and the libiio library for the Pluto and was able to SSH via: ssh root#192.168.21
However, in terminal when I run iio_info -s I get the following output which concerns me.
Library version: 0.21 (git tag: 9d79757)
Compiled with backends: local xml ip usb
Unable to create Local IIO context : No such file or directory (2)
Available contexts:
0: 0456:b673 (Analog Devices Inc. PlutoSDR (ADALM-PLUTO)), serial=1044739659930006f4ff24003edc27135f [usb:1.10.5]
1: 192.168.2.1 (Analog Devices PlutoSDR Rev.B (Z7010-AD9364)), serial=1044739659930006f4ff24003edc27135f [ip:pluto.local]
Running iio_info -u ip:192.168.2.1 I get a few errors which might be related to the above.
Library version: 0.21 (git tag: 9d79757)
Compiled with backends: local xml ip usb
IIO context created with network backend.
Backend version: 0.21 (git tag: v0.21 )
Backend description string: 192.168.2.1 Linux (none) 4.19.0-119999-g6edc6cd #319 SMP PREEMPT Mon Jul 6 15:45:01 CEST 2020 armv7l
IIO context has 9 attributes:
hw_model: Analog Devices PlutoSDR Rev.B (Z7010-AD9364)
hw_model_variant: 0
hw_serial: 1044739659930006f4ff24003edc27135f
fw_version: v0.32
ad9361-phy,xo_correction: 39999954
ad9361-phy,model: ad9364
local,kernel: 4.19.0-119999-g6edc6cd
uri: ip:192.168.2.1
ip,ip-addr: 192.168.2.1
...
...
attr 10: multichip_sync ERROR: Permission denied (13)
attr 11: rssi_gain_step_error value: lna_error: 0 0 0 0
mixer_error: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
...
...
debug attr 180: adi,frequency-division-duplex-mode-enable value: 1
debug attr 181: direct_reg_access value: 0x0
No trigger on this device
iio:device2: xadc
10 channels found:
voltage5: vccoddr (input)
...
...
2 debug attributes found:
debug attr 0: pseudorandom_err_check value: CH0 : PN9 : Out of Sync : PN Error
CH1 : PN9 : Out of Sync : PN Error
debug attr 1: direct_reg_access value: 0x0
No trigger on this device
I was unsure what the errors were, so I re-flashed the PlutoSDR with the latest Firmware and tried again. Still same errors.
Any ideas what this would be from?
I had a similar issue with GNU Radio Companion 3.8 (GRC) and Adalm Pluto. The root cause is that GRC requires a "tailored" iio package, which is different from the one you install via "pip install pylibiio." I can suggest the following:
Uninstall the Python iio (if you did, so as to avoid masking)
Make sure you install the gr-iio according to the official guide.
In the guide there are directions about making a copy of gr-iio installation and exporting its location to PYTHONPATH. Alternately, you can see some details from my experience.
If you need to use Adalm Pluto with Python, without GRC, I can recommend creating a virtual environment (venv) and installing Python iio there.

Docker - Cannot build multi-platform images with docker buildx

I'm trying to build a multi-platform (amd64, arm64 and armv7) image using docker buildx. Since I'm using an amd64 machine running Ubuntu 18.04, I followed the instructions on the Docker website and installed qemu via:
sudo apt install qemu-user
However, a weird error appears when I execute the previous command. More specifically, there seems to be an issue with the binfmt-support service. Here's the full log:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Starting pkgProblemResolver with broken count: 0
Starting 2 pkgProblemResolver with broken count: 0
Done
The following additional packages will be installed:
binfmt-support qemu-user-binfmt
The following NEW packages will be installed:
binfmt-support qemu-user qemu-user-binfmt
0 upgraded, 3 newly installed, 0 to remove and 1 not upgraded.
Need to get 0 B/7.409 kB of archives.
After this operation, 63,4 MB of additional disk space will be used.
Do you want to continue? [Y/n]
Selecting previously unselected package binfmt-support.
(Reading database ... 245278 files and directories currently installed.)
Preparing to unpack .../binfmt-support_2.1.8-2_amd64.deb ...
Unpacking binfmt-support (2.1.8-2) ...
Selecting previously unselected package qemu-user.
Preparing to unpack .../qemu-user_1%3a2.11+dfsg-1ubuntu7.21_amd64.deb ...
Unpacking qemu-user (1:2.11+dfsg-1ubuntu7.21) ...
Selecting previously unselected package qemu-user-binfmt.
Preparing to unpack .../qemu-user-binfmt_1%3a2.11+dfsg-1ubuntu7.21_amd64.deb ...
Unpacking qemu-user-binfmt (1:2.11+dfsg-1ubuntu7.21) ...
Setting up binfmt-support (2.1.8-2) ...
Job for binfmt-support.service failed because the control process exited with error code.
See "systemctl status binfmt-support.service" and "journalctl -xe" for details.
invoke-rc.d: initscript binfmt-support, action "start" failed.
● binfmt-support.service - Enable support for additional executable binary formats
Loaded: loaded (/lib/systemd/system/binfmt-support.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Wed 2020-02-05 17:20:29 CET; 4ms ago
Docs: man:update-binfmts(8)
Process: 7766 ExecStart=/usr/sbin/update-binfmts --enable (code=exited, status=2)
Main PID: 7766 (code=exited, status=2)
feb 05 17:20:29 XPS-15-9570 systemd[1]: Starting Enable support for additional executable binary formats...
feb 05 17:20:29 XPS-15-9570 update-binfmts[7766]: update-binfmts: warning: unable to close /proc/sys/fs/binfmt_misc/register: No such file or directory
feb 05 17:20:29 XPS-15-9570 update-binfmts[7766]: update-binfmts: exiting due to previous errors
feb 05 17:20:29 XPS-15-9570 systemd[1]: binfmt-support.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
feb 05 17:20:29 XPS-15-9570 systemd[1]: binfmt-support.service: Failed with result 'exit-code'.
feb 05 17:20:29 XPS-15-9570 systemd[1]: Failed to start Enable support for additional executable binary formats.
Setting up qemu-user (1:2.11+dfsg-1ubuntu7.21) ...
Setting up qemu-user-binfmt (1:2.11+dfsg-1ubuntu7.21) ...
update-binfmts: warning: current package is qemu-user-binfmt, but binary format already installed by qemu-user-static
update-binfmts: exiting due to previous errors
dpkg: error processing package qemu-user-binfmt (--configure):
installed qemu-user-binfmt package post-installation script subprocess returned error exit status 2
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
Processing triggers for ureadahead (0.100.0-21) ...
Processing triggers for neon-settings (0.0+p18.04+git20191212.1343) ...
Processing triggers for systemd (237-3ubuntu10.33) ...
Errors were encountered while processing:
qemu-user-binfmt
E: Sub-process /usr/bin/dpkg returned an error code (1)
Despite that, I tried to go on with the usual procedure, namely:
docker buildx create --name mybuilder
docker buildx use mybuilder
docker buildx inspect --bootstrap
Where the output of the last command is:
[+] Building 5.0s (1/1) FINISHED
=> [internal] booting buildkit 5.0s
=> => pulling image moby/buildkit:buildx-stable-1 4.3s
=> => creating container buildx_buildkit_mybuilder0 0.7s
Name: mybuilder
Driver: docker-container
Nodes:
Name: mybuilder0
Endpoint: unix:///var/run/docker.sock
Status: running
Platforms: linux/amd64, linux/386
As you can see, "linux/amd64" and "linux/386" are listed as the only available platforms, however I would need to build the image for "linux/arm64" and "linux/arm/v7" platforms as well.
I've been looking for a solution to this problem for hours, though I didn't find anything that worked
------------------------------------ EDIT ------------------------------------
Looks like I was able to solve part of the issue by running:
sudo apt purge --auto-remove qemu-user qemu-user-binfmt binfmt-support
And then reinstalling them. In fact, running again this command:
sudo apt install qemu-user
gives no error at all:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Starting pkgProblemResolver with broken count: 0
Starting 2 pkgProblemResolver with broken count: 0
Done
The following additional packages will be installed:
binfmt-support qemu-user-binfmt
The following NEW packages will be installed:
binfmt-support qemu-user qemu-user-binfmt
0 upgraded, 3 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/7.409 kB of archives.
After this operation, 63,4 MB of additional disk space will be used.
Do you want to continue? [Y/n]
Selecting previously unselected package binfmt-support.
(Reading database ... 245437 files and directories currently installed.)
Preparing to unpack .../binfmt-support_2.1.8-2_amd64.deb ...
Unpacking binfmt-support (2.1.8-2) ...
Selecting previously unselected package qemu-user.
Preparing to unpack .../qemu-user_1%3a2.11+dfsg-1ubuntu7.21_amd64.deb ...
Unpacking qemu-user (1:2.11+dfsg-1ubuntu7.21) ...
Selecting previously unselected package qemu-user-binfmt.
Preparing to unpack .../qemu-user-binfmt_1%3a2.11+dfsg-1ubuntu7.21_amd64.deb ...
Unpacking qemu-user-binfmt (1:2.11+dfsg-1ubuntu7.21) ...
Setting up binfmt-support (2.1.8-2) ...
Created symlink /etc/systemd/system/multi-user.target.wants/binfmt-support.service → /lib/systemd/system/binfmt-support.service.
Setting up qemu-user (1:2.11+dfsg-1ubuntu7.21) ...
Setting up qemu-user-binfmt (1:2.11+dfsg-1ubuntu7.21) ...
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
Processing triggers for ureadahead (0.100.0-21) ...
Processing triggers for neon-settings (0.0+p18.04+git20191212.1343) ...
Processing triggers for systemd (237-3ubuntu10.38) ...
Similarly, the output of systemctl status binfmt-support.service is as expected:
● binfmt-support.service - Enable support for additional executable binary formats
Loaded: loaded (/lib/systemd/system/binfmt-support.service; enabled; vendor preset: enabled)
Active: active (exited) since Mon 2020-02-10 11:42:23 CET; 1min 11s ago
Docs: man:update-binfmts(8)
Main PID: 7161 (code=exited, status=0/SUCCESS)
Tasks: 0 (limit: 4915)
CGroup: /system.slice/binfmt-support.service
feb 10 11:42:23 XPS-15-9570 systemd[1]: Starting Enable support for additional executable binary formats...
feb 10 11:42:23 XPS-15-9570 systemd[1]: Started Enable support for additional executable binary formats.
However, part of the issue is still there, as the output after running these three commands:
docker buildx create --name mybuilder
docker buildx use mybuilder
docker buildx inspect --bootstrap
is the same as before, namely:
[+] Building 2.6s (1/1) FINISHED
=> [internal] booting buildkit 2.6s
=> => pulling image moby/buildkit:buildx-stable-1 2.0s
=> => creating container buildx_buildkit_mybuilder0 0.6s
Name: mybuilder
Driver: docker-container
Nodes:
Name: mybuilder0
Endpoint: unix:///var/run/docker.sock
Status: running
Platforms: linux/amd64, linux/386
Why is that? Why is it showing me linux/amd64 and linux/386 as the only available platforms?
EDIT #2 (concerning #LinPy's comment)
The output of docker context ls is:
NAME DESCRIPTION DOCKER ENDPOINT KUBERNETES ENDPOINT ORCHESTRATOR
default * Current DOCKER_HOST based configuration unix:///var/run/docker.sock swarm
I've also tried to restart docker after qemu's installation, but to no success. Also, specifying the target platforms in the docker buildx command:
docker buildx build -t <mytag> --platform linux/amd64,linux/arm64,linux/arm/v7 --load .
results in this error:
[+] Building 0.6s (5/20)
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 32B 0.0s
=> [linux/arm/v7 internal] load metadata for docker.io/alegeno92/opencv_python3:3.4.2 0.6s
=> CANCELED [linux/arm64 internal] load metadata for docker.io/alegeno92/opencv_python3:3.4.2 0.6s
=> CANCELED [linux/amd64 internal] load metadata for docker.io/alegeno92/opencv_python3:3.4.2 0.6s
failed to solve: rpc error: code = Unknown desc = failed to solve with frontend dockerfile.v0: failed to load LLB: runtime execution on platform linux/arm/v7 not supported
By the way, my version of the kernel is 4.15.0-76-generic
Run the multiarch container first
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
docker buildx rm builder
docker buildx create --name builder --driver docker-container --use
docker buildx inspect --bootstrap
And you should have your alternate architectures.
Tagging on this answer in response to the first error. The commands have been updated per https://docs.docker.com/buildx/working-with-buildx/.
QEMU is a cross-platform emulator responsible for sourcing the binaries for different architectures (through the binfmt_misc handler).
Will save some people some time to start with this command first:
docker run --privileged --rm tonistiigi/binfmt --install all
There are multiple binfmt packages, and there's a configuration that I think was missed when this question was asked.
For the various packages, I would opt for qemu-user-static over qemu-user-binfmt to avoid any dynamic linking issues. The two packages are doing the same thing, so you'll need to pick one or the other.
The next part should be fixed in current releases, but I think you were stumbling on this before. That's the fix binary or F flag you'll see when catting the files in /proc/sys/fs/binfmt_misc, e.g. see the F flag here:
$ cat /proc/sys/fs/binfmt_misc/qemu-arm
enabled
interpreter /usr/libexec/qemu-binfmt/arm-binfmt-P
flags: POCF
offset 0
magic 7f454c4601010100000000000000000002002800
mask ffffffffffffff00fffffffffffffffffeffffff
Details on what the F flag means can be found on this kernel.org post but the short of it is container namespaces include a different filesystem namespace, and trying to access the interpreter from that namespace will fail (unless you do something like bind mount /usr/libexec/qemu-binfmt into your container). Newer versions of the qemu packages automatically set this flag, so if your flags section doesn't have the F defined, see these bug reports for the version you'll need to upgrade to:
Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=868030
Ubuntu: https://bugs.launchpad.net/ubuntu/+source/qemu/+bug/1815100
The easy button is to use the binaries from the multiarch image. This is good in CI if you have a dedicated VM (less ideal if you are modifying the host used by other builds). However if you reboot, it breaks until you run the container again. And it requires you to remember to update it for any upstream patches. So I wouldn't recommend it for a long running build host.
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
For github CI, add following plugin solve this for me
- name: Set up QEMU
id: qemu
uses: docker/setup-qemu-action#v1
with:
image: tonistiigi/binfmt:latest
platforms: all

user data is not running at launch aws ec2

I am trying to launch an ec2 linux instance (linux 2 ami) and while doing that in the user data, I am trying to
get node js installed, and at the same time install git.
Then I am trying to get clone my github repo and then start the node js server, all this done in the userdata.
I am trying to check everywhere, in the cloudlog init file to find some error why my user data is not working.
Here are the codes.
#!/bin/bash
sudo yum update -y
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.32.0/install.sh | bash
. ~/.nvm/nvm.sh
nvm install 4.4.5
sudo yum upgrade
sudo yum install git -y
git clone https://github.com/myname/one_user.git
cd one_user
dnsaddress=$(curl -s http://169.254.169.254/latest/meta-data/public-hostname)
export dns_name=${dnsaddress}
npm install -y
node server.js
The code below is from the cloud init log file.
Cloud-init v. 18.2-72.amzn2.0.6 running 'init-local' at Sun, 10 Feb 2019 15:49:35 +0000. Up 4.93 seconds.
Cloud-init v. 18.2-72.amzn2.0.6 running 'init' at Sun, 10 Feb 2019 15:49:38 +0000. Up 7.42 seconds.
ci-info: ++++++++++++++++++++++++++++++++++++++Net device info+++++++++++++++++++++++++++++++++++++++
ci-info: +--------+------+-----------------------------+---------------+--------+-------------------+
ci-info: | Device | Up | Address | Mask | Scope | Hw-Address |
ci-info: +--------+------+-----------------------------+---------------+--------+-------------------+
ci-info: | eth0 | True | 10.0.1.72 | 255.255.255.0 | global | 0e:1f:76:6a:3c:6c |
ci-info: | eth0 | True | fe80::c1f:76ff:fe6a:3c6c/64 | . | link | 0e:1f:76:6a:3c:6c |
ci-info: | lo | True | 127.0.0.1 | 255.0.0.0 | host | . |
ci-info: | lo | True | ::1/128 | . | host | . |
ci-info: +--------+------+-----------------------------+---------------+--------+-------------------+
ci-info: ++++++++++++++++++++++++++++++Route IPv4 info+++++++++++++++++++++++++++++++
ci-info: +-------+-----------------+----------+-----------------+-----------+-------+
ci-info: | Route | Destination | Gateway | Genmask | Interface | Flags |
ci-info: +-------+-----------------+----------+-----------------+-----------+-------+
ci-info: | 0 | 0.0.0.0 | 10.0.1.1 | 0.0.0.0 | eth0 | UG |
ci-info: | 1 | 10.0.1.0 | 0.0.0.0 | 255.255.255.0 | eth0 | U |
ci-info: | 2 | 169.254.169.254 | 0.0.0.0 | 255.255.255.255 | eth0 | UH |
ci-info: +-------+-----------------+----------+-----------------+-----------+-------+
ci-info: +++++++++++++++++++Route IPv6 info+++++++++++++++++++
ci-info: +-------+-------------+---------+-----------+-------+
ci-info: | Route | Destination | Gateway | Interface | Flags |
ci-info: +-------+-------------+---------+-----------+-------+
ci-info: | 9 | fe80::/64 | :: | eth0 | U |
ci-info: | 11 | local | :: | eth0 | U |
ci-info: | 12 | ff00::/8 | :: | eth0 | U |
ci-info: +-------+-------------+---------+-----------+-------+
Cloud-init v. 18.2-72.amzn2.0.6 running 'modules:config' at Sun, 10 Feb 2019 15:49:39 +0000. Up 8.99 seconds.
Loaded plugins: extras_suggestions, langpacks, priorities, update-motd
Existing lock /var/run/yum.pid: another copy is running as pid 3265.
Another app is currently holding the yum lock; waiting for it to exit...
The other application is: yum
Memory : 31 M RSS (321 MB VSZ)
Started: Sun Feb 10 15:49:38 2019 - 00:02 ago
State : Sleeping, pid: 3265
Another app is currently holding the yum lock; waiting for it to exit...
The other application is: yum
Memory : 70 M RSS (361 MB VSZ)
Started: Sun Feb 10 15:49:38 2019 - 00:04 ago
State : Running, pid: 3265
--> 1:openssl-libs-1.0.2k-16.amzn2.0.1.x86_64 from installed removed (updateinfo)
--> 1:openssl-1.0.2k-16.amzn2.0.1.x86_64 from installed removed (updateinfo)
--> 1:openssl-libs-1.0.2k-16.amzn2.0.2.x86_64 from amzn2-core removed (updateinfo)
--> 1:openssl-1.0.2k-16.amzn2.0.2.x86_64 from amzn2-core removed (updateinfo)
1 package(s) needed (+0 related) for security, out of 3 available
Resolving Dependencies
--> Running transaction check
---> Package kernel-tools.x86_64 0:4.14.88-88.76.amzn2 will be updated
---> Package kernel-tools.x86_64 0:4.14.94-89.73.amzn2 will be an update
--> Finished Dependency Resolution
Dependencies Resolved
================================================================================
Package Arch Version Repository Size
================================================================================
Updating:
kernel-tools x86_64 4.14.94-89.73.amzn2 amzn2-core 111 k
Transaction Summary
================================================================================
Upgrade 1 Package
Total download size: 111 k
Downloading packages:
Delta RPMs disabled because /usr/bin/applydeltarpm not installed.
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Updating : kernel-tools-4.14.94-89.73.amzn2.x86_64 1/2
Cleanup : kernel-tools-4.14.88-88.76.amzn2.x86_64 2/2
Verifying : kernel-tools-4.14.94-89.73.amzn2.x86_64 1/2
Verifying : kernel-tools-4.14.88-88.76.amzn2.x86_64 2/2
Updated:
kernel-tools.x86_64 0:4.14.94-89.73.amzn2
Complete!
Cloud-init v. 18.2-72.amzn2.0.6 running 'modules:final' at Sun, 10 Feb 2019 15:49:47 +0000. Up 16.22 seconds.
Loaded plugins: extras_suggestions, langpacks, priorities, update-motd
Existing lock /var/run/yum.pid: another copy is running as pid 3324.
Another app is currently holding the yum lock; waiting for it to exit...
The other application is: yum
Memory : 54 M RSS (270 MB VSZ)
Started: Sun Feb 10 15:49:45 2019 - 00:03 ago
State : Running, pid: 3324
Resolving Dependencies
--> Running transaction check
---> Package kernel.x86_64 0:4.14.94-89.73.amzn2 will be installed
---> Package openssl.x86_64 1:1.0.2k-16.amzn2.0.1 will be updated
---> Package openssl.x86_64 1:1.0.2k-16.amzn2.0.2 will be an update
---> Package openssl-libs.x86_64 1:1.0.2k-16.amzn2.0.1 will be updated
---> Package openssl-libs.x86_64 1:1.0.2k-16.amzn2.0.2 will be an update
--> Finished Dependency Resolution
Dependencies Resolved
================================================================================
Package Arch Version Repository Size
================================================================================
Installing:
kernel x86_64 4.14.94-89.73.amzn2 amzn2-core 19 M
Updating:
openssl x86_64 1:1.0.2k-16.amzn2.0.2 amzn2-core 496 k
openssl-libs x86_64 1:1.0.2k-16.amzn2.0.2 amzn2-core 1.2 M
Transaction Summary
================================================================================
Install 1 Package
Upgrade 2 Packages
Total download size: 21 M
Downloading packages:
Delta RPMs disabled because /usr/bin/applydeltarpm not installed.
--------------------------------------------------------------------------------
Total 33 MB/s | 21 MB 00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Updating : 1:openssl-libs-1.0.2k-16.amzn2.0.2.x86_64 1/5
Updating : 1:openssl-1.0.2k-16.amzn2.0.2.x86_64 2/5
Installing : kernel-4.14.94-89.73.amzn2.x86_64 3/5
Cleanup : 1:openssl-1.0.2k-16.amzn2.0.1.x86_64 4/5
Cleanup : 1:openssl-libs-1.0.2k-16.amzn2.0.1.x86_64 5/5
Verifying : 1:openssl-libs-1.0.2k-16.amzn2.0.2.x86_64 1/5
Verifying : kernel-4.14.94-89.73.amzn2.x86_64 2/5
Verifying : 1:openssl-1.0.2k-16.amzn2.0.2.x86_64 3/5
Verifying : 1:openssl-libs-1.0.2k-16.amzn2.0.1.x86_64 4/5
Verifying : 1:openssl-1.0.2k-16.amzn2.0.1.x86_64 5/5
Installed:
kernel.x86_64 0:4.14.94-89.73.amzn2
Updated:
openssl.x86_64 1:1.0.2k-16.amzn2.0.2
openssl-libs.x86_64 1:1.0.2k-16.amzn2.0.2
Complete!
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 10007 100 10007 0 0 10007 0 0:00:01 --:--:-- 0:00:01 99079
=> Downloading nvm as script to '/.nvm'
=> Profile not found. Tried (as defined in $PROFILE), ~/.bashrc, ~/.bash_profile, ~/.zshrc, and ~/.profile.
=> Create one of them and run this script again
=> Create it (touch ) and run this script again
OR
=> Append the following lines to the correct file yourself:
export NVM_DIR="/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm
=> Close and reopen your terminal to start using nvm or run the following to use it now:
export NVM_DIR="/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm
/var/lib/cloud/instance/scripts/part-001: line 4: /root/.nvm/nvm.sh: No such file or directory
/var/lib/cloud/instance/scripts/part-001: line 5: nvm: command not found
Loaded plugins: extras_suggestions, langpacks, priorities, update-motd
Existing lock /var/run/yum.pid: another copy is running as pid 11772.
Another app is currently holding the yum lock; waiting for it to exit...
The other application is: yum
Memory : 52 M RSS (268 MB VSZ)
Started: Sun Feb 10 15:50:08 2019 - 00:02 ago
State : Running, pid: 11772
No packages marked for update
Loaded plugins: extras_suggestions, langpacks, priorities, update-motd
Resolving Dependencies
--> Running transaction check
---> Package git.x86_64 0:2.17.2-2.amzn2 will be installed
--> Processing Dependency: perl-Git = 2.17.2-2.amzn2 for package: git-2.17.2-2.amzn2.x86_64
--> Processing Dependency: git-core-doc = 2.17.2-2.amzn2 for package: git-2.17.2-2.amzn2.x86_64
--> Processing Dependency: git-core = 2.17.2-2.amzn2 for package: git-2.17.2-2.amzn2.x86_64
--> Processing Dependency: emacs-filesystem >= 25.3 for package: git-2.17.2-2.amzn2.x86_64
--> Processing Dependency: perl(Term::ReadKey) for package: git-2.17.2-2.amzn2.x86_64
--> Processing Dependency: perl(Git::I18N) for package: git-2.17.2-2.amzn2.x86_64
--> Processing Dependency: perl(Git) for package: git-2.17.2-2.amzn2.x86_64
--> Processing Dependency: libsecret-1.so.0()(64bit) for package: git-2.17.2-2.amzn2.x86_64
--> Running transaction check
---> Package emacs-filesystem.noarch 1:25.3-3.amzn2.0.1 will be installed
---> Package git-core.x86_64 0:2.17.2-2.amzn2 will be installed
---> Package git-core-doc.noarch 0:2.17.2-2.amzn2 will be installed
---> Package libsecret.x86_64 0:0.18.5-2.amzn2.0.2 will be installed
---> Package perl-Git.noarch 0:2.17.2-2.amzn2 will be installed
--> Processing Dependency: perl(Error) for package: perl-Git-2.17.2-2.amzn2.noarch
---> Package perl-TermReadKey.x86_64 0:2.30-20.amzn2.0.2 will be installed
--> Running transaction check
---> Package perl-Error.noarch 1:0.17020-2.amzn2 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
================================================================================
Package Arch Version Repository Size
================================================================================
Installing:
git x86_64 2.17.2-2.amzn2 amzn2-core 217 k
Installing for dependencies:
emacs-filesystem noarch 1:25.3-3.amzn2.0.1 amzn2-core 64 k
git-core x86_64 2.17.2-2.amzn2 amzn2-core 4.0 M
git-core-doc noarch 2.17.2-2.amzn2 amzn2-core 2.3 M
libsecret x86_64 0.18.5-2.amzn2.0.2 amzn2-core 153 k
perl-Error noarch 1:0.17020-2.amzn2 amzn2-core 32 k
perl-Git noarch 2.17.2-2.amzn2 amzn2-core 70 k
perl-TermReadKey x86_64 2.30-20.amzn2.0.2 amzn2-core 31 k
Transaction Summary
================================================================================
Install 1 Package (+7 Dependent packages)
Total download size: 6.8 M
Installed size: 36 M
Downloading packages:
--------------------------------------------------------------------------------
Total 18 MB/s | 6.8 MB 00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : git-core-2.17.2-2.amzn2.x86_64 1/8
Installing : git-core-doc-2.17.2-2.amzn2.noarch 2/8
Installing : libsecret-0.18.5-2.amzn2.0.2.x86_64 3/8
Installing : 1:perl-Error-0.17020-2.amzn2.noarch 4/8
Installing : perl-TermReadKey-2.30-20.amzn2.0.2.x86_64 5/8
Installing : 1:emacs-filesystem-25.3-3.amzn2.0.1.noarch 6/8
Installing : perl-Git-2.17.2-2.amzn2.noarch 7/8
Installing : git-2.17.2-2.amzn2.x86_64 8/8
Verifying : 1:emacs-filesystem-25.3-3.amzn2.0.1.noarch 1/8
Verifying : perl-TermReadKey-2.30-20.amzn2.0.2.x86_64 2/8
Verifying : 1:perl-Error-0.17020-2.amzn2.noarch 3/8
Verifying : libsecret-0.18.5-2.amzn2.0.2.x86_64 4/8
Verifying : git-core-2.17.2-2.amzn2.x86_64 5/8
Verifying : git-2.17.2-2.amzn2.x86_64 6/8
Verifying : perl-Git-2.17.2-2.amzn2.noarch 7/8
Verifying : git-core-doc-2.17.2-2.amzn2.noarch 8/8
Installed:
git.x86_64 0:2.17.2-2.amzn2
Dependency Installed:
emacs-filesystem.noarch 1:25.3-3.amzn2.0.1
git-core.x86_64 0:2.17.2-2.amzn2
git-core-doc.noarch 0:2.17.2-2.amzn2
libsecret.x86_64 0:0.18.5-2.amzn2.0.2
perl-Error.noarch 1:0.17020-2.amzn2
perl-Git.noarch 0:2.17.2-2.amzn2
perl-TermReadKey.x86_64 0:2.30-20.amzn2.0.2
Complete!
Cloning into 'zero2architect'...
/var/lib/cloud/instance/scripts/part-001: line 16: npm: command not found
/var/lib/cloud/instance/scripts/part-001: line 17: node: command not found
Feb 10 15:50:16 cloud-init[3314]: util.py[WARNING]: Failed running /var/lib/cloud/instance/scripts/part-001 [127]
Feb 10 15:50:16 cloud-init[3314]: cc_scripts_user.py[WARNING]: Failed to run module scripts-user (scripts in /var/lib/cloud/instance/scripts)
Feb 10 15:50:16 cloud-init[3314]: util.py[WARNING]: Running module scripts-user (<module 'cloudinit.config.cc_scripts_user' from '/usr/lib/python2.7/site-packages/cloudinit/config/cc_scripts_user.pyc'>) failed
Cloud-init v. 18.2-72.amzn2.0.6 finished at Sun, 10 Feb 2019 15:50:16 +0000. Datasource DataSourceEc2. Up 45.55 seconds
Have you checked your SGs and NACL configurations? You need to allow port 80 (HTTP) and port 443 (HTTPS) in outbound SG rules - destination 0.0.0.0/0. You also need to allow the same on outbound NACL's rules and ephemeral ports on inbound rules. Makes sure that your instance is sitting in a public subnet (with route to IGW) and it has public/Elastic IPv4 attached to it.
If any one of those conditions is not met, your user data scrip will fail, since it need connection to the Internet (in your case).
If your instance is sitting in a private subnet, make sure that you are running NAT Gateway or NAT instance and that your route tables are properly configured, as well as SGs and NACLs. Also make sure that source/destination check is disabled on NAT instance if you are using it.
UPDATE
You log clearly says that you don't have npm and node installed so you need to pass installation instruction to the script as well.
npm install -y
is not the right way to install npm. You can follow these steps to install both node and npm.
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.32.0/install.sh | bash
. ~/.nvm/nvm.sh
nvm install 4.4.5
This will install node version 4.4.5. If you want some other version of node to be installed, then change the number for whatever supported version.

Docker on RHEL 7 in AWS can’t pull images

We're looking to incorporate docker on our project and I'm having some difficulty.
I installed Docker via the instructions here: https://docs.docker.com/engine/installation/linux/rhel/ and had no problems. However, when I try to pull any images from docker hub, it just hangs and nothing ever happens:
┌─[user#hostname]─(~)
└─[11:53]$ docker pull alpine:latest
Here's my docker version info:
┌─[user#hostname]─(~)
└─[11:53]$ docker version
Client:
Version: 1.11.2
API version: 1.23
Go version: go1.5.4
Git commit: b9f10c9
Built: Wed Jun 1 21:23:11 2016
OS/Arch: linux/amd64
Server:
Version: 1.11.2
API version: 1.23
Go version: go1.5.4
Git commit: b9f10c9
Built: Wed Jun 1 21:23:11 2016
OS/Arch: linux/amd64
This is a redhat 7.2 instance in a VPC. I'm using another rhel 7.2 instance to handle NAT through iptables. This issue is the first connectivity problem I've had.
I read elsewhere that specifying an http proxy would solve the issue, so I set up a squid proxy on my nat server, but to no avail. I followed the instructions here to set the proxy for docker to use: https://docs.docker.com/engine/admin/systemd/#/http-proxy
The proxy is getting the requests, but docker still can't pull any images. Here's the out put of my squid logs:
1467475616.376 110 10.0.0.50 TCP_MISS/200 3250 CONNECT registry-1.docker.io:443 - HIER_DIRECT/52.71.80.248 -
1467475616.415 35 10.0.0.50 TCP_MISS/200 4444 CONNECT auth.docker.io:443 - HIER_DIRECT/52.204.167.32 -
I'm running out of things to try here. Any help would be greatly appreciated.
EDIT
Got a new error! After tweaking the squid proxy configuration, I now get this error when attempting to pull an image:
┌─[user#hostname]─(~)
└─[15:15]$ sudo docker pull alpine
Using default tag: latest
Pulling repository docker.io/library/alpine
Error while pulling image: Get https://index.docker.io/v1/repositories/library/alpine/images: Service Unavailable
Here's the output of ping:
┌─[user#hostname]─(~)
└─[15:15]$ ping index.docker.io
PING us-east-1-elbio-rm5bon1qaeo4-623296237.us-east-1.elb.amazonaws.com (54.173.200.203) 56(84) bytes of data.
^C
--- us-east-1-elbio-rm5bon1qaeo4-623296237.us-east-1.elb.amazonaws.com ping statistics ---
3 packets transmitted, 0 received, 100% packet loss, time 1999ms
And wget can download a json file from the url in the docker error message:
┌─[user#hostname]─(~)
└─[15:17]$ wget https://index.docker.io/v1/repositories/library/alpine/images
--2016-07-02 15:17:20-- https://index.docker.io/v1/repositories/library/alpine/images
Resolving index.docker.io (index.docker.io)... 54.173.200.203, 52.22.190.106, 52.203.138.237
Connecting to index.docker.io (index.docker.io)|54.173.200.203|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [application/json]
Saving to: ‘images’
[ <=> ] 6,900 --.-K/s in 0s
2016-07-02 15:17:20 (185 MB/s) - ‘images’ saved [6900]

Resources