Showing posts with label Troubleshooting. Show all posts
Showing posts with label Troubleshooting. Show all posts

Wednesday, February 5, 2020

Error: CERT_UNTRUSTED in npm install

In ubuntu18, when I tired npm install, I am getting the following error

Error: CERT_UNTRUSTED

Fix : Remove the current nodejs and npm and install the latest nodejs and npm version.
This will fix the error

Tuesday, January 2, 2018

Starting frontend GLOBAL: cannot bind UNIX socket [/var/run/haproxy/admin.sock]

Haproxy Error: 
 [WARNING] 000/231555 (73783) : Can't open server state file '/var/state/haproxy/global': No such file or directory
Starting frontend GLOBAL: cannot bind UNIX socket [/var/run/haproxy/admin.sock]

How to fix this:

Login to the server
mkdir -p  /var/run/haproxy/
Start haproxy service

It works.  

Haproxy needs to write to /var/run/haproxy/admin.sock but it wont create the directory for you. Create the directory /var/run/haproxy

 

Saturday, December 30, 2017

package github.com/gorilla/mux: cannot download, $GOPATH not set

While installing a GO package, I am getting the following error.

# go get github.com/gorilla/mux
package github.com/gorilla/mux: cannot download, $GOPATH not set. For more details see: go help gopath


How to solve this error:

Login to the server.
# mkdir /path/to/a/folder
# vi ~/.bashrc
# export GOPATH=/path/to/a/folder
# source ~/.bashrc


Now try the command go get github.com/gorilla/mux, It works.



cannot find package "github.com/gorilla/mux"

In Go, while building (go build) I am getting the following error

cannot find package "github.com/gorilla/mux"

Solution:

Login to the server
# go get github.com/gorilla/mux 
# go build

This will  help to fix the package error.

But you may see another error :  cannot download, $GOPATH not set. For more details see: go help gopath

Click the link for the fix

Saturday, December 16, 2017

Handler 'handler' missing on module 'copy': module 'copy' has no attribute 'handler'

In my AWS Lambda function I am getting the following error in cloudwatch.

 Handler 'handler' missing on module 'copy': module 'copy' has no attribute 'handler' 

I am using a zip upload function, with Python 3.6.

 Solution:
Here the fix is how we call the handler. Its name.

In my case, I have renamed the copy.py to index.py
Inside the index.py, I have a function - def handler(event, context):

So my lambda handler is : index.handler
ie. Module.Function (filename.function_name)

Zip the folder and upload to lambda. See this blog for zip
 

Wednesday, December 13, 2017

errorMessage": "Cannot find module '/var/task/CreateThumbnail'

When I worked with AWS lambda function for creating a thumbnail for images uploaded to a S3 bucket. I am facing the following error while lambda test.

 errorMessage": "Cannot find module '/var/task/CreateThumbnail'

The reason for this issue is because of non proper zip the contents that we uploaded to lambda function.

zip -r ../yourfilename.zip *

Your folder may contain your index.js, node_modules, etc. files. Upload the new yourfilename.zip in your lambda function and try to run the test, the issue got fixed.

Monday, December 11, 2017

TypeError: csv is not a function in Nodejs

I am getting the following error in Nodejs, when I use a csv module.

TypeError: csv is not a function
    at Object.<anonymous> (/root/app.js:4:11)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.runMain (module.js:604:10)
    at run (bootstrap_node.js:383:7)
    at startup (bootstrap_node.js:149:9)
    at bootstrap_node.js:496:3


Here is my npm list:
[root@machine2 ~]# npm list
root@1.0.0 /root
├── csv@2.0.0 extraneous
└─┬ debug@3.1.0
  └── ms@2.0.0

 
Solution for this issue:
You need to remove the curret csv module and need to instll csv@0.3.7 which will solve this issue. Below given steps will surely help you.
 
[root@machine2 ~]# npm remove csv
- lodash.get@4.4.2 node_modules/lodash.get
- csv-generate@2.0.0 node_modules/csv-generate
- csv-parse@2.0.0 node_modules/csv-parse
- csv-stringify@2.0.0 node_modules/csv-stringify
- stream-transform@1.0.0 node_modules/stream-transform
- csv@2.0.0 node_modules/csv
npm WARN root@1.0.0 No description
npm WARN root@1.0.0 No repository field.
 

[root@machine2 ~]# npm list
root@1.0.0 /root
└─┬ debug@3.1.0
  └── ms@2.0.0

[root@machine2 ~]# npm install csv@0.3.7
root@1.0.0 /root
└── csv@0.3.7
npm WARN root@1.0.0 No description
npm WARN root@1.0.0 No repository field.
[root@machine2 ~]#


It works!
 

Thursday, December 7, 2017

Error on starting Consul

My Consul client is not able to start the consul service. Its getting the following error
Consul version is Consul v1.0.0 

WARNING: LAN keyring exists but -encrypt given, using keyring
==> Starting Consul agent...
==> Joining cluster...
==> 5 error(s) occurred:

* Failed to join 192.168.1.10: No installed keys could decrypt the message
* Failed to join
192.168.1.11: No installed keys could decrypt the message
* Failed to join
192.168.1.12: No installed keys could decrypt the message
* Failed to join
192.168.1.13: No installed keys could decrypt the message
* Failed to join
192.168.1.14: No installed keys could decrypt the message

Solution for this issue:

1. cd $consul-data-dir/serf
2.  Added the current encryption key in "local.keyring"
3. Start consul

It works. In my case I have two data center. One data center's encryption key is missing in file  "local.keyring". After updating and restarting it works fine.

Monday, December 4, 2017

Nomad Error:FIX

How to solve this Nomad Error.

Error submitting job: Unexpected response code: 500 (rpc error: 11 error(s) occurred:

* Task group <TASK_NAME> validation failed: 1 error(s) occurred:

* 1 error(s) occurred:

* Max parallel can not be less than one: 0 < 1
* Task group <GROUP_NAME> validation failed: 1 error(s) occurred:

* 1 error(s) occurred:


I am using Nomad version 0.7.0

Solution:

In my job stanza, I need to add max_parallel count

update {
   
    stagger = "10s"
   
    max_parallel = 2
 
    }


For more details, read here

Wednesday, July 12, 2017

How can we change from address in mutt

How can I change the from address in mutt?

Mutt is a mail client in Linux. By default the from address of the mail which is sent by muttrc will be the machine hostname. You can change that using the following steps.

1. Login to the server as root.
2. vi /etc/Muttrc
Update the file using the following.
set realname="Dennis Young"
set from="dennis.young@young.com"
set use_from=yes

3.Save the file

This helps to solve the issue.

Tuesday, July 11, 2017

ERROR 1558 (HY000): Column count of mysql.user is wrong. Expected 42, found 39. Created with MySQL 50173, now running 50556. Please use mysql_upgrade to fix this error.

I am getting the following error in mysql operation.

ERROR 1558 (HY000): Column count of mysql.user is wrong. Expected 42, found 39. Created with MySQL 50173, now running 50556. Please use mysql_upgrade to fix this error.

Solution:

Login to the server
[root@blackmagic ~]# mysql_upgrade -u root -p
Enter password:

(Enter your password)

This will fix the issue and its solved.

Thursday, June 15, 2017

monit dead but pid file exists

When I tried to start monit process, I am getting the following error

monit dead but pid file exists

Issue is solved by the following setps:

1. Login to the server.
2. vim /etc/monit.conf
Remove the following line set statefile /var/monit/state
3. Restart monit

Click here to see the steps to solve - monit dead but subsys locked


monit dead but subsys locked

When I tried to check the status of monit process, I am getting the following error

monit dead but subsys locked

Issue is solved by the following setps:

1. Login to the server.
2. vim /etc/monit.conf
Add the following, set daemon 120
3. Restart monit

This will help to solve this error.

Sunday, May 21, 2017

Error while starting jenkins

Today, when I install and setup Jenkins, I am getting the following error while starting the jenkins service.

OS : CentOS release 6.8 (Final)

Following is the error:

Running from: /usr/lib/jenkins/jenkins.war
May 21, 2017 7:38:37 PM Main deleteWinstoneTempContents
WARNING: Failed to delete the temporary Winstone file /tmp/winstone/jenkins.war
Jenkins requires Java7 or later, but you are running 1.7.0_131-mockbuild_2017_02_13_15_19-b00 from /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.131.x86_64/jre
java.lang.UnsupportedClassVersionError: winstone/Launcher : Unsupported major.minor version 52.0
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:803)
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
        at java.net.URLClassLoader.defineClass(URLClassLoader.java:442)
        at java.net.URLClassLoader.access$100(URLClassLoader.java:64)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:354)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:348)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:347)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
        at Main._main(Main.java:224)
        at Main.main(Main.java:112)


Solution to fix the issue:

1. Take the backup of /etc/init.d/jenkins to a safe location.
2.  update-alternatives --config java (to the latest java) 
3. Update the file /etc/init.d/jenkins after candidates with your result of echo $JAVA_HOME

The  /etc/init.d/jenkins snippet is below
# Search usable Java as /usr/bin/java might not point to minimal version required by Jenkins.
# see http://www.nabble.com/guinea-pigs-wanted-----Hudson-RPM-for-RedHat-Linux-td25673707.html
candidates="
/usr/java/latest/bin/java
/etc/alternatives/java
/usr/lib/jvm/java-1.8.0/bin/java
/usr/lib/jvm/jre-1.8.0/bin/java
/usr/lib/jvm/java-1.7.0/bin/java
/usr/lib/jvm/jre-1.7.0/bin/java
/usr/bin/java



4. Restart jenkins