MongoDB not connected

Hi there,

i have tried to use a mongoDB to store current time [=NOW()] but i get the error that my database is not connected.

I installed and strated it the way it was discribed in the Cedalo Documentary, with the commandline commands.

would be nice if anyone could help me! :slight_smile:

Cheers!
Susanne

Hi Susanne,

I might need a little more context :slight_smile: !
Would you mind posting the Screenshot of your Connector and the function which you are using?
Further, you can check if the db is running with:

docker ps

I assume, you used this command for the MongoDB Setup?

sudo docker run --name mymongodb --net streamsheets andresvidal/rpi3-mongodb3

Cheers,

Tizian

Hello Tizian,

yes for installing mongoDB in Docker i used:
sudo docker run --name mymongodb --net streamsheets andresvidal/rpi3-mongodb3

and when i check the db status with docker ps i see that the standard port 27017 is up running:

94e055fd4585 andresvidal/rpi3-mongodb3 “/docker-entrypoint.…” 4 days ago Up 13 minutes 27017/tcp, 28017/tcp streamsheets-internal-database

this is the function i’m using:

=MONGO.STORE(|MongoDB_Test,“test”,JSON(D42:E42))

i also have another problem:

everytime i start a Mongo.STORE function my REST.REQUESTS stop working. I have a DISCONNECTED ERROR then. Could it be the Problem that i’m using the 1.3 Streamsheets version not the 1.4?

Thanks for the help! :blush::rofl:

Cheers
Susanne

You forget the Connector screenshot :wink:
But actually to really see what’s going on, it would be great if you could export your machine and send it to me. With the Streams attached.

You can delete all personal data before doing so (create a copy to not destroy your work :wink: )

Usually this should be no problem even in v1.3
There have been changes in the v1.4 but it was mainly because of the open source release.
Moreover, we so far still only have a v1.3 for the Raspberry Pi (v1.4 coming soon) :innocent:

Hello Tizian,

sorry for forgetting.

here it comes:

and also an export of the machine that i’m using:
Machine_Forum.json (16.0 KB)

thanks!

For me it worked.

Maybe docker is weird. Try

docker start mymongodb

and then reload the connector again.

Still have no connection. I get this message:

  • MongoDB_Test

12:21:55 --failed to connect to server [mymongodb:27017] on first connect [Error: getaddrinfo EAI_AGAIN mymongodb at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:60:26) { name: ‘MongoNetworkError’, message: ‘getaddrinfo EAI_AGAIN mymongodb’, stack: 'Error: getaddrinfo EAI_AGAIN mymongodb\n at ’ + 'GetAddrInfoReqWrap.onlookup [as oncomplete] ’ + ‘(dns.js:60:26)’ }]

The reason may be, that this MongoDB Image is not an official one.
MongoDB does not officially support ARM (Raspberry Pi) architecture.

Unfortunately, I have had this as well some time ago, but was not able to understand why.
I had the same Error Code and wasn’t able to access my db anymore. I will look around, maybe there is an updated MongoDB Version for Raspis.

The quickfix was to rename the DB:

E.g.:

sudo docker run --name mymongodb2 --net streamsheets andresvidal/rpi3-mongodb3

Start it again

docker start mymongodb2

Maybe this works for you too. :crossed_fingers:

Hi it worked!:star_struck::star_struck: how can i now see the data i’m storing? :rofl::joy::rofl::question: I’m sorry i’m a complete noob with docker :sweat_smile:

Thanks for the help!

No Problem :slight_smile:

You can see all stored data by using an empty Query in Streamsheets (easiest way).

=MONGO.QUERY(|Docker_MongoDB_Producer,"testcollection",,INBOX(),,,,)

Which is basically a query on all elements of the “testcollection” collection, with the response target being the INBOX() of your Streamsheet.