user data is not running at launch aws ec2 - linux

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.

Related

Install Jasmin SMS Gateway at Linux Centos 7

I am trying to install jasmin sms gatway,
I tried from that website https://docs.jasminsms.com/en/latest/installation/index.html
And tried all of these linux commands
curl -s https://setup.jasminsms.com/rpm | sudo bash
sudo yum install epel-release
sudo yum install jasmin-sms-gateway
With the last command :sudo yum install jasmin-sms-gateway
i got these
Loaded plugins: fastestmirror, tsflags, universal-hooks
Loading mirror speeds from cached hostfile
* EA4: 63.247.64.58
* cpanel-addons-production-feed: 63.247.64.58
* cpanel-plugins: 63.247.64.58
* base: forksystems.mm.fcix.net
* epel: d2lzkl7pfhq30w.cloudfront.net
* extras: mirror.centos.iad1.serverforge.org
* updates: mirror.cogentco.com
jookies_jasmin-sms-gateway/x86_64/signature | 833 B 00:00:00
jookies_jasmin-sms-gateway/x86_64/signature | 951 B 00:00:00 !!!
jookies_jasmin-sms-gateway-source/signature | 833 B 00:00:00
jookies_jasmin-sms-gateway-source/signature | 951 B 00:00:00 !!!
jookies_python-jasmin/x86_64/signature | 833 B 00:00:00
jookies_python-jasmin/x86_64/signature | 1.0 kB 00:00:00 !!!
jookies_python-jasmin-source/signature | 819 B 00:00:00
jookies_python-jasmin-source/signature | 1.0 kB 00:00:00 !!!
No package jasmin-sms-gateway available.
I am not sure how resolve this No package jasmin-sms-gateway available.
Kindly help i am new in linux

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.

Installing ERPNext on Ubuntu 20.0.4. SIGTERM being sent to Redis

I am following this tutorial, to install ERPNext on my Ubuntu 20.0.4 LTS OS.
I managed to follow all the instructions, however, when I run bench start, the system fails to start.
Here is the console output:
WARN: bench is installed in editable mode!
This is not the recommended mode of installation for production. Instead, install the package from PyPI with: `pip install frappe-bench`
10:26:19 system | redis_cache.1 started (pid=11096)
10:26:19 system | redis_queue.1 started (pid=11097)
10:26:19 system | redis_socketio.1 started (pid=11095)
10:26:19 redis_socketio.1 | 11105:C 24 May 2022 10:26:19.200 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
10:26:19 system | socketio.1 started (pid=11100)
10:26:19 redis_queue.1 | 11106:C 24 May 2022 10:26:19.205 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
10:26:19 system | web.1 started (pid=11098)
10:26:19 redis_queue.1 | 11106:C 24 May 2022 10:26:19.208 # Redis version=5.0.7, bits=64, commit=00000000, modified=0, pid=11106, just started
10:26:19 redis_queue.1 | 11106:C 24 May 2022 10:26:19.208 # Configuration loaded
10:26:19 redis_queue.1 | 11106:M 24 May 2022 10:26:19.209 * Increased maximum number of open files to 10032 (it was originally set to 1024).
10:26:19 redis_queue.1 | 11106:M 24 May 2022 10:26:19.217 * Running mode=standalone, port=11000.
10:26:19 redis_cache.1 | 11103:C 24 May 2022 10:26:19.223 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
10:26:19 redis_cache.1 | 11103:C 24 May 2022 10:26:19.224 # Redis version=5.0.7, bits=64, commit=00000000, modified=0, pid=11103, just started
10:26:19 redis_cache.1 | 11103:C 24 May 2022 10:26:19.224 # Configuration loaded
10:26:19 redis_cache.1 | 11103:M 24 May 2022 10:26:19.225 * Increased maximum number of open files to 10032 (it was originally set to 1024).
10:26:19 system | watch.1 started (pid=11099)
10:26:19 redis_socketio.1 | 11105:C 24 May 2022 10:26:19.229 # Redis version=5.0.7, bits=64, commit=00000000, modified=0, pid=11105, just started
10:26:19 redis_socketio.1 | 11105:C 24 May 2022 10:26:19.229 # Configuration loaded
10:26:19 redis_socketio.1 | 11105:M 24 May 2022 10:26:19.230 * Increased maximum number of open files to 10032 (it was originally set to 1024).
10:26:19 redis_socketio.1 | 11105:M 24 May 2022 10:26:19.231 * Running mode=standalone, port=12000.
10:26:19 system | worker_short.1 started (pid=11113)
10:26:19 system | schedule.1 started (pid=11115)
10:26:19 redis_cache.1 | 11103:M 24 May 2022 10:26:19.243 * Running mode=standalone, port=13000.
10:26:19 redis_cache.1 | 11103:M 24 May 2022 10:26:19.244 # Server initialized
10:26:19 redis_cache.1 | 11103:M 24 May 2022 10:26:19.244 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
10:26:19 redis_cache.1 | 11103:M 24 May 2022 10:26:19.244 # WARNING you have Transparent Huge Pages (THP) support enabled in your kernel. This will create latency and memory usage issues with Redis. To fix this issue run the command 'echo never > /sys/kernel/mm/transparent_hugepage/enabled' as root, and add it to your /etc/rc.local in order to retain the setting after a reboot. Redis must be restarted after THP is disabled.
10:26:19 redis_cache.1 | 11103:M 24 May 2022 10:26:19.244 * Ready to accept connections
10:26:19 redis_queue.1 | 11106:M 24 May 2022 10:26:19.247 # Server initialized
10:26:19 redis_queue.1 | 11106:M 24 May 2022 10:26:19.248 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
10:26:19 redis_queue.1 | 11106:M 24 May 2022 10:26:19.248 # WARNING you have Transparent Huge Pages (THP) support enabled in your kernel. This will create latency and memory usage issues with Redis. To fix this issue run the command 'echo never > /sys/kernel/mm/transparent_hugepage/enabled' as root, and add it to your /etc/rc.local in order to retain the setting after a reboot. Redis must be restarted after THP is disabled.
10:26:19 redis_queue.1 | 11106:M 24 May 2022 10:26:19.248 * Ready to accept connections
10:26:19 redis_socketio.1 | 11105:M 24 May 2022 10:26:19.248 # Server initialized
10:26:19 redis_socketio.1 | 11105:M 24 May 2022 10:26:19.248 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
10:26:19 redis_socketio.1 | 11105:M 24 May 2022 10:26:19.249 # WARNING you have Transparent Huge Pages (THP) support enabled in your kernel. This will create latency and memory usage issues with Redis. To fix this issue run the command 'echo never > /sys/kernel/mm/transparent_hugepage/enabled' as root, and add it to your /etc/rc.local in order to retain the setting after a reboot. Redis must be restarted after THP is disabled.
10:26:19 redis_socketio.1 | 11105:M 24 May 2022 10:26:19.249 * Ready to accept connections
10:26:19 system | worker_long.1 started (pid=11118)
10:26:19 system | worker_default.1 started (pid=11124)
10:26:21 socketio.1 | listening on *: 9000
10:26:23 schedule.1 | WARN: bench is installed in editable mode!
10:26:23 schedule.1 |
10:26:23 schedule.1 | This is not the recommended mode of installation for production. Instead, install the package from PyPI with: `pip install frappe-bench`
10:26:23 schedule.1 |
10:26:23 web.1 | WARN: bench is installed in editable mode!
10:26:23 web.1 |
10:26:23 web.1 | This is not the recommended mode of installation for production. Instead, install the package from PyPI with: `pip install frappe-bench`
10:26:23 web.1 |
10:26:23 watch.1 | WARN: bench is installed in editable mode!
10:26:23 watch.1 |
10:26:23 watch.1 | This is not the recommended mode of installation for production. Instead, install the package from PyPI with: `pip install frappe-bench`
10:26:23 watch.1 |
10:26:26 watch.1 |
10:26:26 web.1 | * Running on all addresses.
10:26:26 web.1 | WARNING: This is a development server. Do not use it in a production deployment.
10:26:26 web.1 | * Running on http://[PUBLIC_IP_ADDRESS]:8000/ (Press CTRL+C to quit)
10:26:26 web.1 | * Restarting with stat
10:26:27 web.1 | * Debugger is active!
10:26:27 web.1 | * Debugger PIN: 214-927-934
10:26:28 watch.1 | yarn run v1.22.18
10:26:28 watch.1 | $ node esbuild --watch --live-reload
10:26:30 watch.1 | clean: postcss.plugin was deprecated. Migration guide:
10:26:30 watch.1 | https://evilmartians.com/chronicles/postcss-8-plugin-migration
10:26:35 system | worker_short.1 stopped (rc=1)
10:26:35 system | sending SIGTERM to redis_cache.1 (pid 11096)
10:26:35 system | sending SIGTERM to redis_socketio.1 (pid 11095)
10:26:35 system | sending SIGTERM to redis_queue.1 (pid 11097)
10:26:35 system | sending SIGTERM to web.1 (pid 11098)
10:26:35 system | sending SIGTERM to socketio.1 (pid 11100)
10:26:35 system | sending SIGTERM to watch.1 (pid 11099)
10:26:35 system | sending SIGTERM to schedule.1 (pid 11115)
10:26:35 system | sending SIGTERM to worker_long.1 (pid 11118)
10:26:35 system | sending SIGTERM to worker_default.1 (pid 11124)
10:26:35 redis_cache.1 | 11103:signal-handler (1653387995) Received SIGTERM scheduling shutdown...
10:26:35 redis_cache.1 | 11103:M 24 May 2022 10:26:35.885 # User requested shutdown...
10:26:35 redis_cache.1 | 11103:M 24 May 2022 10:26:35.885 * Removing the pid file.
10:26:35 redis_cache.1 | 11103:M 24 May 2022 10:26:35.885 # Redis is now ready to exit, bye bye...
10:26:35 system | redis_queue.1 stopped (rc=-15)
10:26:35 system | worker_default.1 stopped (rc=-15)
10:26:35 system | redis_socketio.1 stopped (rc=-15)
10:26:35 system | redis_cache.1 stopped (rc=-15)
10:26:35 system | socketio.1 stopped (rc=-15)
10:26:35 system | schedule.1 stopped (rc=-15)
10:26:36 system | web.1 stopped (rc=-15)
10:26:36 system | watch.1 stopped (rc=-15)
What is causing this issue, and how do I fix it?
It seems that they are errors in the latest versions of the bench installer, it has happened to me in some VPS.
The first is a problem with the Transparent Huge Pages (THP), you have to disable them, I suggest you create a service that checks that they are disabled during boot and keep them that way, or try this option:
https://www.ibm.com/docs/en/db2-big-sql/5.0.4?topic=sql-disabling-transparent-hugepages
You also have a problem with the number of files to watch, you can solve it with this:
sudo vim /etc/sysctl.conf
fs.inotify.max_user_watches=524288
vm.overcommit_memory = 1
Check:
sudo sysctl -p
It should appear something like this:
fs.file-max = 65535
vm.swappiness = 10
fs.inotify.max_user_watches = 524288
Remember to restart.

Pytorch Cuda for ubuntu 20.04

I'm trying to get pytorch with cuda 10 compatibility via :
conda install pytorch torchvision cudatoolkit=10.2 -c pytorch
from(https://discuss.pytorch.org/t/pytorch-with-cuda-11-compatibility/89254)
but there is timeout error:
Proceed ([y]/n)? y
Downloading and Extracting Packages
pytorch-mutex-1.0 | 3 KB | | 0%
torchvision-0.12.0 | 8.8 MB | | 0%
ffmpeg-4.3 | 9.9 MB | | 0%
pytorch-1.11.0 | 622.9 MB | | 0%
CondaHTTPError: HTTP 000 CONNECTION FAILED for url <https://conda.anaconda.org/pytorch/noarch/pytorch-mutex-1.0-cuda.tar.bz2>
Elapsed: -
CondaHTTPError: HTTP 000 CONNECTION FAILED for url <https://conda.anaconda.org/pytorch/noarch/pytorch-mutex-1.0-cuda.tar.bz2>
Elapsed: -
So I was running WSL2 and didn't shut down for many days. A reboot fixed the issue.

issue while importing metrics with datadog

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

Resources