marciogranzotto / addon-nightscout

Home Assistant Add-On for Nightscout
GNU General Public License v3.0
13 stars 15 forks source link

Failing to start database mongodb #7

Open errorkallu opened 3 years ago

errorkallu commented 3 years ago

Hi I installed the addon-nightscout on my Home assistent and wen i start the addon it is giving me an error saying "INFO: Nginx waiting for Nightscout...

Can you Please Help me to fix it

Thanking you -sri

marciogranzotto commented 2 years ago

please check if this issue still happens with the new 1.2.0 version

BaQs commented 2 years ago

@marciogranzotto : I think this comes WITH the new version:

2021-10-17T10:39:37.116+0200 I CONTROL [main] SERVER RESTARTED 2021-10-17T10:39:37.130+0200 I CONTROL [initandlisten] MongoDB starting : pid=1623 port=27017 dbpath=/var/lib/mongodb 64-bit host=1dd81675-nightscout 2021-10-17T10:39:37.130+0200 I CONTROL [initandlisten] db version v3.6.3 2021-10-17T10:39:37.130+0200 I CONTROL [initandlisten] git version: 9586e557d54ef70f9ca4b43c26892cd55257e1a5 2021-10-17T10:39:37.130+0200 I CONTROL [initandlisten] OpenSSL version: OpenSSL 1.1.1 11 Sep 2018 2021-10-17T10:39:37.130+0200 I CONTROL [initandlisten] allocator: tcmalloc 2021-10-17T10:39:37.130+0200 I CONTROL [initandlisten] modules: none 2021-10-17T10:39:37.130+0200 I CONTROL [initandlisten] build environment: 2021-10-17T10:39:37.130+0200 I CONTROL [initandlisten] distarch: x86_64 2021-10-17T10:39:37.130+0200 I CONTROL [initandlisten] target_arch: x86_64 2021-10-17T10:39:37.130+0200 I CONTROL [initandlisten] options: { config: "/etc/mongodb.conf", net: { bindIp: "127.0.0.1" }, storage: { dbPath: "/var/lib/mongodb", journal: { enabled: true } }, systemLog: { destination: "file", logAppend: true, path: "/var/log/mongodb/mongodb.log" } } 2021-10-17T10:39:37.131+0200 I - [initandlisten] Detected data files in /var/lib/mongodb created by the 'mmapv1' storage engine, so setting the active storage engine to 'mmapv1'. 2021-10-17T10:39:37.158+0200 I JOURNAL [initandlisten] journal dir=/var/lib/mongodb/journal 2021-10-17T10:39:37.158+0200 I JOURNAL [initandlisten] recover : no journal files present, no recovery needed 2021-10-17T10:39:37.209+0200 I JOURNAL [durability] Durability thread started 2021-10-17T10:39:37.209+0200 I JOURNAL [journal writer] Journal writer thread started 2021-10-17T10:39:37.210+0200 I CONTROL [initandlisten] 2021-10-17T10:39:37.210+0200 I CONTROL [initandlisten] WARNING: Access control is not enabled for the database. 2021-10-17T10:39:37.210+0200 I CONTROL [initandlisten] Read and write access to data and configuration is unrestricted. 2021-10-17T10:39:37.210+0200 I CONTROL [initandlisten] 2021-10-17T10:39:37.246+0200 F CONTROL [initandlisten] ** IMPORTANT: UPGRADE PROBLEM: The data files need to be fully upgraded to version 3.4 before attempting an upgrade to 3.6; see http://dochub.mongodb.org/core/3.6-upgrade-fcv for more details. 2021-10-17T10:39:37.246+0200 I NETWORK [initandlisten] shutdown: going to close listening sockets... 2021-10-17T10:39:37.246+0200 I NETWORK [initandlisten] removing socket file: /tmp/mongodb-27017.sock 2021-10-17T10:39:37.247+0200 I REPL [initandlisten] shutdown: removing all drop-pending collections... 2021-10-17T10:39:37.247+0200 I REPL [initandlisten] shutdown: removing checkpointTimestamp collection... 2021-10-17T10:39:37.247+0200 I STORAGE [initandlisten] shutdown: waiting for fs preallocator... 2021-10-17T10:39:37.247+0200 I STORAGE [initandlisten] shutdown: final commit... 2021-10-17T10:39:37.247+0200 I JOURNAL [initandlisten] journalCleanup... 2021-10-17T10:39:37.247+0200 I JOURNAL [initandlisten] removeJournalFiles 2021-10-17T10:39:37.247+0200 I JOURNAL [initandlisten] old journal file will be removed: /var/lib/mongodb/journal/j._0 2021-10-17T10:39:37.248+0200 I JOURNAL [initandlisten] Terminating durability thread ... 2021-10-17T10:39:37.349+0200 I JOURNAL [journal writer] Journal writer thread stopped 2021-10-17T10:39:37.350+0200 I JOURNAL [durability] Durability thread stopped 2021-10-17T10:39:37.350+0200 I STORAGE [initandlisten] shutdown: closing all files... 2021-10-17T10:39:37.352+0200 I STORAGE [initandlisten] closeAllFiles() finished 2021-10-17T10:39:37.352+0200 I STORAGE [initandlisten] shutdown: removing fs lock... 2021-10-17T10:39:37.352+0200 I CONTROL [initandlisten] now exiting 2021-10-17T10:39:37.352+0200 I CONTROL [initandlisten] shutting down with code:62`

BaQs commented 2 years ago

From what I can read on the web, this command was missing before the upgrade:

db.adminCommand( { setFeatureCompatibilityVersion: "3.4" } )

marciogranzotto commented 2 years ago

@BaQs strange... maybe try to uninstall the add-on and add it again so it can recreate the database instead of using your old one

BaQs commented 2 years ago

Can I backup the db somehow?

BaQs commented 2 years ago

Ok I managed by installing few packages within the docker container. Then mongodump Copy the file somewhere Fresh-install the addon restore the mongo database

\o/

commputethis commented 2 years ago

I am having this exact issue. I have tried uninstalling/re-installing multiple times. I am running Home Assistant 22.9.2.
image
image

I've tried with and without SSL enabled (API key in screenshot is not the one I am using, but is the same length).
image

This is the end of the log file. image

I can see the add-on installed properly, at least according to supervisor logs:
image

What can I try to fix this?

commputethis commented 2 years ago

Uninstalled NightScout AddOn Updated Home Assistant Installed NightScout AddOn Added proper configuration fields Started NightScout AddOn

Problem pesists. :-(
image

jonathanware commented 1 year ago

I'm getting this issue as well. Any chance this can be fixed?

marciogranzotto commented 1 year ago

hmm... I've noticed that @commputethis is using it on a raspberry pi. I've only used it on x86_64 and have no way of easily test in on raspberry

marciogranzotto commented 1 year ago

I've just released v1.4.1 with a possible fix for this issue.