Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Lin__Joey
Innovator
500 Views

Mongodb connected failed in tls native installation

Jump to solution

This week I upgraded the TLS from that contained in EIS2.1.1 to EIS2.2.

I also upgraded OpenVino to 2020.2.

 

This time, I have remoted agent and dispatcher connected without error, but the Mongodb connected failed.

And the tls localhost:8080 webpage could not work, either.

What will be possible reasons for this issue? Should I need to use Docker version instead?

Your expertise will be highly appreciated!

 

Labels (1)
0 Kudos
1 Solution
Jia-Shing_W_Intel
Moderator
500 Views

Hi Joey,

Based on the log you provided, I’m guessing you have installed mongodb 3.4 on this device in the past.

Hit:5 http://tw.archive.ubuntu.com/ubuntu xenial-backports InRelease

Get:6 http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.4 Release [3457 B]

Get:7 http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.4 Release.gpg [801 B]

Ign:7 http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.4 Release.gpg

Hit:8 http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.4/multiverse amd64 Packages

Hit:9 http://security.ubuntu.com/ubuntu xenial-security InRelease

Ign:10 https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.0 InRelease

Hit:11 https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.0 Release

If you do “apt-key list”, you likely will see a public key for 3.4 and another one for 4.0. If you do “ls -la /etc/apt/sources.list.d/”, there likely is a mongodb-org-3.4.list in addition to mongodb-org-4.0.list. It’s safe to remove the file mongodb-org-3.4.list.

According to https://docs.mongodb.com/v4.0/tutorial/install-mongodb-on-ubuntu/, you will need to manually modify setup_TLS.sh and replace the 'echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.0.list' line with 'echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/4.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.0.list' for Ubuntu 16.04. 

Please do note that EIS is validated with Ubuntu 18.04 and we recommend using 18.04.

Regards,

Jia-Shing

View solution in original post

11 Replies
Jia-Shing_W_Intel
Moderator
500 Views

Hi Joey,

According to your follow-up email, TLS related services, such as mongod and perhaps others , are in an inactive state. Can you please do a "sudo systemctl daemon-reload" and see the services can start correctly?

If this doesn't work, please help us understand the steps you took to install and set up TLS. As part of tls/Setup/setup_TLS.sh, steps were taken to install, set up, and start mongod. Let's find out what went wrong.

Regards,

Jia-Shing

Lin__Joey
Innovator
500 Views

Dear Jia-shing;

Run “sudo systemctl daemon-reload”, but the mongod service still not available

My installation followed the steps in 1_Installation.md and 2_NativeDevelopment.md

I tried to run tls/Setup/setup_TLS.sh again, it succeed.

Yet, mongod still not running, and the connection failed

 

Could you please explain more about how to set up and start mongod?

Thank you in advance,

 

Joey

 

Jia-Shing_W_Intel
Moderator
500 Views

Hi Joey,

During your setup, did you see any error? Can you capture the installation logs and attach it here?

If you look at setup_TLS.sh, there is the following

echo "Setup MongoDB PPA Repository"
wget -qO - https://www.mongodb.org/static/pgp/server-4.0.asc | sudo -E apt-key add -
echo "deb [ arch=amd64 ] https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.0.list
sudo -E apt-get update
sudo -E apt-get install -y mongodb-org
sudo systemctl enable mongod
sudo systemctl start mongod
 

These lines are supposed to install mongodb, enable and start the daemon. Do you see /etc/systemd/system/multi-user.target.wants/mongod.service and /lib/systemd/system/mongod.service?

By the way, do you have any Docker container running (docker ps)? Is your TCP port 27017 in use? I am wondering if there is a port conflict that prevented mongod from running.

Regards,

Jia-Shing

Lin__Joey
Innovator
500 Views

Hi, Jia-Shing:

 

You are right. The log shows error when installing mongodb. The error message lists as below:

 

“….

W: GPG error: http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.4 Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY BC711F9BA15703C6

W: The repository 'http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.4 Release' is not signed.

N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.

N: See apt-secure(8) manpage for repository creation and user configuration details.

Reading package lists... Done

Building dependency tree      

Reading state information... Done

Some packages could not be installed. This may mean that you have

requested an impossible situation or if you are using the unstable

distribution that some required packages have not yet been created

or been moved out of Incoming.

The following information may help to resolve the situation:

 

The following packages have unmet dependencies:

 mongodb-org : Depends: mongodb-org-shell but it is not going to be installed

               Depends: mongodb-org-server but it is not going to be installed

               Depends: mongodb-org-mongos but it is not going to be installed

               Depends: mongodb-org-tools but it is not going to be installed

E: Unable to correct problems, you have held broken packages.

Failed to execute operation: No such file or directory

Failed to start mongod.service: Unit mongod.service not found.

"

regards,

 

Joey

Jia-Shing_W_Intel
Moderator
500 Views

Hi Joey,

Your device is missing the public key for mongodb-org. If you do "sudo -E wget -qO - https://www.mongodb.org/static/pgp/server-4.0.asc | sudo -E apt-key add -" from the commandline, do you see any error? If this works, run the installation scripts again. If it doesn't, please check your proxy settings.

Regards,

Jia-Shing

Lin__Joey
Innovator
500 Views

Dear Jia-Shing:

 

The network seems fine. However, the public key seems not working. Please check the message after running setup.

 

/home/joeylin/tls # sudo -E wget -qO - https://www.mongodb.org/static/pgp/server-4.0.asc | sudo -E apt-key add -

OK

/home/joeylin/tls# ./Setup/setup_TLS.sh

….

Reading package lists... Done

W: GPG error: http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.4 Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY BC711F9BA15703C6

E: The repository 'http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.4 Release' is not signed.

N: Updating from such a repository can't be done securely, and is therefore disabled by default.

N: See apt-secure(8) manpage for repository creation and user configuration details.

...

 

regards,

 

Joey

Jia-Shing_W_Intel
Moderator
500 Views

Hi Joey,

I'm curious, why is your setup installing mongodb 3.4 while mine is doing 4.0? Are you installing TLS from EIS 2.2 or 2.1.1? Below is some description of what the script lines do:

wget -qO - https://www.mongodb.org/static/pgp/server-4.0.asc | sudo -E apt-key add -   --> This line added the public key for mongodb-org v4.0.
echo "deb [ arch=amd64 ] https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.0.list    --> This line adds the mongodb 4.0 repository to the list.
sudo -E apt-get update --> updates package list
sudo -E apt-get install -y mongodb-org  --> expected to install the latest available, which is 4.0
sudo systemctl enable mongod
sudo systemctl start mongod
 

Please double check.

Regards,

Jia-Shing

Lin__Joey
Innovator
500 Views

Hi, Jia-shing:

 

I uses the EIS2.2 and the script in the setup_TLS.sh do call to install mongodb 4.0.

Somehow the script manage to install 3.4 and failed. Please see the installation log for details.

"

,,,,

Update PPA Repository Cache
Hit:1 http://tw.archive.ubuntu.com/ubuntu xenial InRelease
Hit:2 http://tw.archive.ubuntu.com/ubuntu xenial-updates InRelease
Hit:3 http://dl.google.com/linux/chrome/deb stable InRelease
Hit:4 http://tw.archive.ubuntu.com/ubuntu xenial-backports InRelease
Ign:5 http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.4 InRelease
Hit:6 http://security.ubuntu.com/ubuntu xenial-security InRelease
Hit:7 https://deb.nodesource.com/node_10.x xenial InRelease
Get:8 http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.4 Release [3457 B]
Ign:9 https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.0 InRelease
Get:10 http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.4 Release.gpg [801 B]
Hit:11 https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.0 Release
Ign:10 http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.4 Release.gpg
Reading package lists...
Reading package lists...
Building dependency tree...
Reading state information...
curl is already the newest version (7.47.0-1ubuntu2.14).
wget is already the newest version (1.17.1-1ubuntu1.5).
The following packages were automatically installed and are no longer required:
  blt libreadline5 snapd-login-service tk8.6-blt2.5
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 115 not upgraded.
Setup NodeJS PPA Repository

## Installing the NodeSource Node.js 10.x repo...


## Populating apt-get cache...

+ apt-get update
Hit:1 http://tw.archive.ubuntu.com/ubuntu xenial InRelease
Ign:2 http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.4 InRelease
Hit:3 http://tw.archive.ubuntu.com/ubuntu xenial-updates InRelease
Hit:4 http://dl.google.com/linux/chrome/deb stable InRelease
Get:5 http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.4 Release [3457 B]
Hit:6 http://tw.archive.ubuntu.com/ubuntu xenial-backports InRelease
Get:7 http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.4 Release.gpg [801 B]
Ign:8 https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.0 InRelease
Ign:7 http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.4 Release.gpg
Hit:9 https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.0 Release
Hit:10 https://deb.nodesource.com/node_10.x xenial InRelease
Hit:11 http://security.ubuntu.com/ubuntu xenial-security InRelease
Hit:12 http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.4/multiverse amd64 Packages
Fetched 4258 B in 0s (5562 B/s)
Reading package lists...

## Confirming "xenial" is supported...

+ curl -sLf -o /dev/null 'https://deb.nodesource.com/node_10.x/dists/xenial/Release'

## Adding the NodeSource signing key to your keyring...

+ curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add -
OK

## Creating apt sources list file for the NodeSource Node.js 10.x repo...

+ echo 'deb https://deb.nodesource.com/node_10.x xenial main' > /etc/apt/sources.list.d/nodesource.list
+ echo 'deb-src https://deb.nodesource.com/node_10.x xenial main' >> /etc/apt/sources.list.d/nodesource.list

## Running `apt-get update` for you...

+ apt-get update
Hit:1 http://tw.archive.ubuntu.com/ubuntu xenial InRelease
Hit:2 http://dl.google.com/linux/chrome/deb stable InRelease
Ign:3 http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.4 InRelease
Hit:4 http://tw.archive.ubuntu.com/ubuntu xenial-updates InRelease
Hit:5 http://tw.archive.ubuntu.com/ubuntu xenial-backports InRelease
Hit:6 http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.4 Release
Get:7 http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.4 Release.gpg [801 B]
Ign:8 https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.0 InRelease
Hit:9 https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.0 Release
Ign:7 http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.4 Release.gpg
Hit:11 https://deb.nodesource.com/node_10.x xenial InRelease
Hit:12 http://security.ubuntu.com/ubuntu xenial-security InRelease
Fetched 801 B in 0s (1003 B/s)
Reading package lists...

## Run `sudo apt-get install -y nodejs` to install Node.js 10.x and npm
## You may also need development tools to build native addons:
     sudo apt-get install gcc g++ make
## To install the Yarn package manager, run:
     curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
     echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
     sudo apt-get update && sudo apt-get install yarn


Reading package lists...
Building dependency tree...
Reading state information...
nodejs is already the newest version (10.20.1-1nodesource1).
The following packages were automatically installed and are no longer required:
  blt libreadline5 snapd-login-service tk8.6-blt2.5
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 115 not upgraded.
Setup MongoDB PPA Repository
OK
deb [ arch=amd64 ] https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.0 multiverse
Hit:1 http://tw.archive.ubuntu.com/ubuntu xenial InRelease
Hit:2 http://tw.archive.ubuntu.com/ubuntu xenial-updates InRelease
Hit:3 http://dl.google.com/linux/chrome/deb stable InRelease
Ign:4 http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.4 InRelease
Hit:5 http://tw.archive.ubuntu.com/ubuntu xenial-backports InRelease
Get:6 http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.4 Release [3457 B]
Get:7 http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.4 Release.gpg [801 B]
Ign:7 http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.4 Release.gpg
Hit:8 http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.4/multiverse amd64 Packages
Hit:9 http://security.ubuntu.com/ubuntu xenial-security InRelease
Ign:10 https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.0 InRelease
Hit:11 https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.0 Release
Hit:13 https://deb.nodesource.com/node_10.x xenial InRelease
Fetched 4258 B in 6s (688 B/s)
Reading package lists...
Reading package lists...
Building dependency tree...
Reading state information...
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 mongodb-org : Depends: mongodb-org-shell but it is not going to be installed
               Depends: mongodb-org-server but it is not going to be installed
               Depends: mongodb-org-mongos but it is not going to be installed
               Depends: mongodb-org-tools but it is not going to be installed

.....

"

By the way, I am using Ubuntu 16.04, and will be the version of python affect the installation version selection?

regards,

Joey

 

Jia-Shing_W_Intel
Moderator
501 Views

Hi Joey,

Based on the log you provided, I’m guessing you have installed mongodb 3.4 on this device in the past.

Hit:5 http://tw.archive.ubuntu.com/ubuntu xenial-backports InRelease

Get:6 http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.4 Release [3457 B]

Get:7 http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.4 Release.gpg [801 B]

Ign:7 http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.4 Release.gpg

Hit:8 http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.4/multiverse amd64 Packages

Hit:9 http://security.ubuntu.com/ubuntu xenial-security InRelease

Ign:10 https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.0 InRelease

Hit:11 https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.0 Release

If you do “apt-key list”, you likely will see a public key for 3.4 and another one for 4.0. If you do “ls -la /etc/apt/sources.list.d/”, there likely is a mongodb-org-3.4.list in addition to mongodb-org-4.0.list. It’s safe to remove the file mongodb-org-3.4.list.

According to https://docs.mongodb.com/v4.0/tutorial/install-mongodb-on-ubuntu/, you will need to manually modify setup_TLS.sh and replace the 'echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.0.list' line with 'echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/4.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.0.list' for Ubuntu 16.04. 

Please do note that EIS is validated with Ubuntu 18.04 and we recommend using 18.04.

Regards,

Jia-Shing

View solution in original post

Lin__Joey
Innovator
500 Views

Hi, Jia-shing:

The issue has been resolved.

I checked the /etc/apt/sources.list.d/, and I saw mongodb3.4.list.

I removed it and tried the setup_TLS.sh again after modifying with the line you provided for ubuntu16.04 LTS

'echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.0.list' line with 'echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/4.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.0.list'

The mongodb 4.0 is setup and running. 

Thank you so much for your quick response, and supports,

Joey

Jia-Shing_W_Intel
Moderator
500 Views

Hi Joey,

Glad to know your issues are resolved. Have fun with EIS and TLS! :)

Regards,

Jia-Shing

Reply