Skip to content

Mongo Completely Broken.

General
20 3 5.6k 1
  • @Sampo2910 quite possible, yes. What is the output of

    sudo dpkg -l | grep mongodb
    

    or

    sudo apt list --installed | grep mongodb
    
    wrote on last edited by
    #10

    @phenomlab Here is the output for both.

    smiley@fmjcod4:~$ sudo dpkg -l | grep mongodb
    [sudo] password for smiley:
    iU  mongodb-mongosh                            2.3.7                                         amd64        MongoDB Shell CLI REPL Package
    iU  mongodb-org                                8.0.4                                         amd64        MongoDB open source document-oriented database system (metapackage)
    iU  mongodb-org-database                       8.0.4                                         amd64        MongoDB open source document-oriented database system (metapackage)
    iU  mongodb-org-database-tools-extra           8.0.4                                         amd64        Extra MongoDB database tools
    iU  mongodb-org-shell                          8.0.4                                         amd64        MongoDB shell client
    iU  mongodb-org-tools                          8.0.4                                         amd64        MongoDB tools
    rc  mongodb-server                             1:3.6.9+really3.6.8+90~g8e540c0b6d-0ubuntu5.3 all          object/document-oriented database (managed server package)
    ii  mongodb-server-core                        1:3.6.9+really3.6.8+90~g8e540c0b6d-0ubuntu5.3 amd64        object/document-oriented database (server binaries package)
    smiley@fmjcod4:~$ ^C
    smiley@fmjcod4:~$ sudo apt list --installed | grep mongodb
    
    WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
    
    mongodb-mongosh/focal/mongodb-org/8.0,now 2.3.7 amd64 [installed,automatic]
    mongodb-org-database-tools-extra/focal/mongodb-org/8.0,now 8.0.4 amd64 [installed,automatic]
    mongodb-org-database/focal/mongodb-org/8.0,now 8.0.4 amd64 [installed,automatic]
    mongodb-org-shell/focal/mongodb-org/8.0,now 8.0.4 amd64 [installed,automatic]
    mongodb-org-tools/focal/mongodb-org/8.0,now 8.0.4 amd64 [installed,automatic]
    mongodb-org/focal/mongodb-org/8.0,now 8.0.4 amd64 [installed]
    mongodb-server-core/focal-updates,focal-security,now 1:3.6.9+really3.6.8+90~g8e540c0b6d-0ubuntu5.3 amd64 [installed,auto-removable]
    
  • wrote on last edited by
    #11

    It is running but I still cannot do any updates as mentioned.

    smiley@fmjcod4:~$ sudo service mongodb status
    ● mongodb.service - LSB: An object/document-oriented database
         Loaded: loaded (/etc/init.d/mongodb; generated)
         Active: active (running) since Tue 2024-12-31 02:13:22 EET; 1h 8min ago
           Docs: man:systemd-sysv-generator(8)
        Process: 14698 ExecStart=/etc/init.d/mongodb start (code=exited, status=0/SUCCESS)
          Tasks: 34 (limit: 16594)
         Memory: 149.6M
         CGroup: /system.slice/mongodb.service
                 └─14716 /usr/bin/mongod --config /etc/mongodb.conf
    
    Dec 31 02:13:21 fmjcod4 systemd[1]: Starting LSB: An object/document-oriented database...
    Dec 31 02:13:21 fmjcod4 mongodb[14698]:  * Starting database mongodb
    Dec 31 02:13:22 fmjcod4 mongodb[14698]:    ...done.
    Dec 31 02:13:22 fmjcod4 systemd[1]: Started LSB: An object/document-oriented database.
    
  • It is running but I still cannot do any updates as mentioned.

    smiley@fmjcod4:~$ sudo service mongodb status
    ● mongodb.service - LSB: An object/document-oriented database
         Loaded: loaded (/etc/init.d/mongodb; generated)
         Active: active (running) since Tue 2024-12-31 02:13:22 EET; 1h 8min ago
           Docs: man:systemd-sysv-generator(8)
        Process: 14698 ExecStart=/etc/init.d/mongodb start (code=exited, status=0/SUCCESS)
          Tasks: 34 (limit: 16594)
         Memory: 149.6M
         CGroup: /system.slice/mongodb.service
                 └─14716 /usr/bin/mongod --config /etc/mongodb.conf
    
    Dec 31 02:13:21 fmjcod4 systemd[1]: Starting LSB: An object/document-oriented database...
    Dec 31 02:13:21 fmjcod4 mongodb[14698]:  * Starting database mongodb
    Dec 31 02:13:22 fmjcod4 mongodb[14698]:    ...done.
    Dec 31 02:13:22 fmjcod4 systemd[1]: Started LSB: An object/document-oriented database.
    
    wrote on last edited by
    #12

    @Sampo2910 I can take a look at this today at some point. Can you PM me the login details?

  • wrote on last edited by
    #13

    Repo problem

  • @Sampo2910 I can take a look at this today at some point. Can you PM me the login details?

    wrote on last edited by
    #14

    @phenomlab I will PM you .Thank you.

  • Repo problem

    wrote on last edited by
    #15

    @DownPW Seems not

    Hit:10 https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/8.0 InRelease
    
  • Just for the record after I reboot server I can see my page again. But same errors are there.

    I use the method for it form a friend. Its a bit old but still works.

    wrote on last edited by
    #16

    @Sampo2910 This is in fact the issue. From your server, I see

    db version v3.6.8
    git version: 8e540c0b6db93ce994cc548f000900bdc740f80a
    OpenSSL version: OpenSSL 1.1.1f  31 Mar 2020
    allocator: tcmalloc
    modules: none
    build environment:
        distarch: x86_64
        target_arch: x86_64
    

    This is seriously out of date - the current version of MongoDB is 8.x. MongoDB 3.6 was released in November 2017 and reached end of life in April 2021. To upgrade MongoDB from version 3 to version 8, you first need to perform a series of incremental upgrades through intermediate versions like 4 and 7, as you cannot directly jump from 3 to 8 due to significant compatibility changes.

    My suggestion would be as follows

    1. Dump the existing database as a backup.
    2. Completely remove version 3.6 and install MongoDB 8.x.
    3. Recreate the database.
    4. Restore the backed-up database.

    In theory, this is straightforward, but in practice, not so much. The application you are running is 2 years old and may use statements that no longer exist in MongoDB or have been superseded by others. This means that your application may not work correctly, or at all once MongoDB has been updated.

  • @Sampo2910 This is in fact the issue. From your server, I see

    db version v3.6.8
    git version: 8e540c0b6db93ce994cc548f000900bdc740f80a
    OpenSSL version: OpenSSL 1.1.1f  31 Mar 2020
    allocator: tcmalloc
    modules: none
    build environment:
        distarch: x86_64
        target_arch: x86_64
    

    This is seriously out of date - the current version of MongoDB is 8.x. MongoDB 3.6 was released in November 2017 and reached end of life in April 2021. To upgrade MongoDB from version 3 to version 8, you first need to perform a series of incremental upgrades through intermediate versions like 4 and 7, as you cannot directly jump from 3 to 8 due to significant compatibility changes.

    My suggestion would be as follows

    1. Dump the existing database as a backup.
    2. Completely remove version 3.6 and install MongoDB 8.x.
    3. Recreate the database.
    4. Restore the backed-up database.

    In theory, this is straightforward, but in practice, not so much. The application you are running is 2 years old and may use statements that no longer exist in MongoDB or have been superseded by others. This means that your application may not work correctly, or at all once MongoDB has been updated.

    wrote on last edited by
    #17

    @phenomlab

    Hi and thanks for looking.

    I knew that it was all old and outdated so yeah that makes sense. I will have to Google how to do all that. Its just one db. I could always create a new one once updated as there is not so much on this one ( easier I keep it) but still no guarantee this application will work with latest version anyway.

    Easiest is I just leave it and never update 🙂 Its gaming server and for testing only, so maybe no harm done leaving it.

  • @phenomlab

    Hi and thanks for looking.

    I knew that it was all old and outdated so yeah that makes sense. I will have to Google how to do all that. Its just one db. I could always create a new one once updated as there is not so much on this one ( easier I keep it) but still no guarantee this application will work with latest version anyway.

    Easiest is I just leave it and never update 🙂 Its gaming server and for testing only, so maybe no harm done leaving it.

    wrote on last edited by
    #18

    @Sampo2910 my only concern around this route is any vulnerabilities exposed due to the lack of support and updates.

  • @Sampo2910 my only concern around this route is any vulnerabilities exposed due to the lack of support and updates.

    wrote on last edited by
    #19

    @phenomlab Well as you seen it was asking to fix broken install.

    I basically forced that.

    sudo apt -o Dpkg::Options::="--force-overwrite" --fix-broken install
    

    I can see you cringing haha. But it seems to have worked. Update was ok and the upgrade bar 2 all worked.

    smiley@fmjcod4:~$ sudo apt update
    [sudo] password for smiley:
    Hit:1 http://fi.archive.ubuntu.com/ubuntu focal InRelease
    Hit:2 http://fi.archive.ubuntu.com/ubuntu focal-updates InRelease
    Hit:3 http://fi.archive.ubuntu.com/ubuntu focal-backports InRelease
    Hit:4 http://fi.archive.ubuntu.com/ubuntu focal-security InRelease
    Hit:5 https://dl.google.com/linux/chrome/deb stable InRelease
    Hit:6 http://ppa.launchpad.net/maxmind/ppa/ubuntu focal InRelease
    Hit:7 http://ppa.launchpad.net/system76-dev/stable/ubuntu focal InRelease
    Hit:8 https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.4 InRelease
    Hit:9 https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/8.0 InRelease
    Hit:10 https://downloads.sourceforge.net/project/d-apt d-apt InRelease
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    2 packages can be upgraded. Run 'apt list --upgradable' to see them.
    smiley@fmjcod4:~$ sudo apt upgrade
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    Calculating upgrade... Done
    The following packages were automatically installed and are no longer required:
      mongodb-database-tools mongodb-mongosh
    Use 'sudo apt autoremove' to remove them.
    Get more security updates through Ubuntu Pro with 'esm-apps' enabled:
      node-hosted-git-info python2.7-minimal python2.7 node-tar
      python-pkg-resources node-ip libpython2.7-minimal libpython2.7-stdlib
    Learn more about Ubuntu Pro at https://ubuntu.com/pro
    The following packages have been kept back:
      amd64-microcode linux-firmware
    0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.
    

    Of course I am fully aware that this is a mess 🙂 But I am limited skill wise. The website can be seen and the data from the games is getting saved so at the moment its ok 🙂 But i like perfect and this is far from it. Hey Ho.

  • @phenomlab Well as you seen it was asking to fix broken install.

    I basically forced that.

    sudo apt -o Dpkg::Options::="--force-overwrite" --fix-broken install
    

    I can see you cringing haha. But it seems to have worked. Update was ok and the upgrade bar 2 all worked.

    smiley@fmjcod4:~$ sudo apt update
    [sudo] password for smiley:
    Hit:1 http://fi.archive.ubuntu.com/ubuntu focal InRelease
    Hit:2 http://fi.archive.ubuntu.com/ubuntu focal-updates InRelease
    Hit:3 http://fi.archive.ubuntu.com/ubuntu focal-backports InRelease
    Hit:4 http://fi.archive.ubuntu.com/ubuntu focal-security InRelease
    Hit:5 https://dl.google.com/linux/chrome/deb stable InRelease
    Hit:6 http://ppa.launchpad.net/maxmind/ppa/ubuntu focal InRelease
    Hit:7 http://ppa.launchpad.net/system76-dev/stable/ubuntu focal InRelease
    Hit:8 https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.4 InRelease
    Hit:9 https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/8.0 InRelease
    Hit:10 https://downloads.sourceforge.net/project/d-apt d-apt InRelease
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    2 packages can be upgraded. Run 'apt list --upgradable' to see them.
    smiley@fmjcod4:~$ sudo apt upgrade
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    Calculating upgrade... Done
    The following packages were automatically installed and are no longer required:
      mongodb-database-tools mongodb-mongosh
    Use 'sudo apt autoremove' to remove them.
    Get more security updates through Ubuntu Pro with 'esm-apps' enabled:
      node-hosted-git-info python2.7-minimal python2.7 node-tar
      python-pkg-resources node-ip libpython2.7-minimal libpython2.7-stdlib
    Learn more about Ubuntu Pro at https://ubuntu.com/pro
    The following packages have been kept back:
      amd64-microcode linux-firmware
    0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.
    

    Of course I am fully aware that this is a mess 🙂 But I am limited skill wise. The website can be seen and the data from the games is getting saved so at the moment its ok 🙂 But i like perfect and this is far from it. Hey Ho.

    wrote on last edited by
    #20

    @Sampo2910 said in Mongo Completely Broken.:

    I can see you cringing

    Yes, that does make me slightly uncomfortable 😬 but OK.


Related Topics
  • Mongodb or Redis

    General database mongodb redis
    29
    11 Votes
    29 Posts
    12k Views
    phenomlab
    @Madchatthew still a great catch.
  • Is my Mongodb installation correct?

    Solved General mongodb
    27
    4
    13 Votes
    27 Posts
    13k Views
    ahmed
    [image: yuuuuu.png]
  • mongodb backup problem

    Moved Configure mongodb
    3
    1
    1 Votes
    3 Posts
    1k Views
    phenomlab
    You might want to also review this post https://sudonix.org/topic/389/mongodb-backup-script
  • mongodb replica set

    Configure mongodb docker ansible
    11
    2 Votes
    11 Posts
    4k Views
    phenomlab
    @veronikya said in mongodb replica set: The host’s local dns resolution is not configured. The problem of the host’s hosts being unable to be resolved in docker has been solved. Surprisingly Solution: Edit the /etc/resovel.conf file Add 127.0.0.53 One immediate issue I can think of here is that editing resolv.conf directly is no longer supported and not recommended (because the changes do not survive a reboot) - unless you install the resolvconf package?
  • 3 Votes
    2 Posts
    995 Views
    phenomlab
    @DownPW This isn’t something I have readily available, and because I’m not entirely familiar with the database structure of NodeBB, it’s something that would require research and development in terms of script. I think it’d be quicker to ask this in the NodeBB forums.
  • Nodebb: failed to restore a mongo dump

    Solved Configure mongodb
    2
    1 Votes
    2 Posts
    1k Views
    DownPW
    @phenomlab In fact I specified the sub rep and not the rep DON’T DO THIS: nodebb@nodebbpwclonedb:~/nodebb$ sudo mongorestore --username admin --password XXXXXXXXXXXXXX --nsInclude nodebb.objects --drop /home/nodebb/nodebb_DB_20230107/nodebb/ BUT THIS : nodebb@nodebbpwclonedb:~/nodebb$ sudo mongorestore --username admin --password XXXXXXXXXXXXXX --nsInclude nodebb.objects --drop /home/nodebb/nodebb_DB_20230107/
  • Mongodb Authorisation.

    Solved General mongodb
    17
    2 Votes
    17 Posts
    5k Views
    phenomlab
    @Sampo2910 I just saw this on the NodeBB community site and it seems very much in line with the issue you are experiencing. Worth a look I think https://community.nodebb.org/topic/16826/does-nodebb-work-with-mongodb-6-0
  • mongorestore "E11000 duplicate key error collection"

    Solved Configure mongodb restore
    1
    1 Votes
    1 Posts
    2k Views
    No one has replied