• Encountered this error during upgrade (1.9.x -> 1.10.0).

    Forums are down, so I don't have access to the admin console. Looks like it's permissions based. Is it safe to delete the offending duplicate (and my command line mongodb kung fu is weak so assistiance would be grealy appreciated).

    Updating NodeBB...
    
    1. Updating package.json file with defaults...  OK
    
    2. Bringing base dependencies up to date...  started
    npm WARN [email protected] requires a peer of [email protected]^3.0.2 but none was installed.
    npm WARN [email protected] requires a peer of [email protected]/erlpack but none was installed.
    npm WARN [email protected] requires a peer of [email protected]^0.2.6 but none was installed.
    npm WARN [email protected] requires a peer of [email protected]^0.0.3 but none was installed.
    npm WARN [email protected] requires a peer of [email protected]^2.0.1 but none was installed.
    npm WARN [email protected] requires a peer of [email protected]^0.5.4 but none was installed.
    npm WARN [email protected] requires a peer of [email protected]^0.14.5 but none was installed.
    
    3. Checking installed plugins for updates...  OK
    4. Updating NodeBB data store schema...
    Parsing upgrade scripts... 
    OK | 4 script(s) found, 53 skipped
      → [2017/6/22] Hash all IP addresses stored in Recent IPs zset... OK
      → [2018/5/28] Give global search privileges... OK
      → [2018/6/7] Give post history viewing privilege to registered-users on all categories... OK
      → [2018/6/8] Give deleted post viewing privilege to moderators on all categories...
    2018-11-09T16:07:00.294Z [31427] - error: [groups.join] Could not create new hidden group MongoError: E11000 duplicate key error collection: nodebb.objects index: _key_1_value_-1 dup key: { : "group:cid:166:privileges:posts:view_deleted", : null }
        at Function.MongoError.create (/opt/nodebb/node_modules/mongodb/node_modules/mongodb-core/lib/error.js:45:10)
        at toError (/opt/nodebb/node_modules/mongodb/lib/utils.js:149:22)
        at /opt/nodebb/node_modules/mongodb/lib/collection.js:1029:39
        at /opt/nodebb/node_modules/mongodb/node_modules/mongodb-core/lib/connection/pool.js:544:18
        at _combinedTickCallback (internal/process/next_tick.js:73:7)
        at process._tickCallback (internal/process/next_tick.js:104:9)
    Error occurred
    Error occurred during upgrade: MongoError: E11000 duplicate key error collection: nodebb.objects index: _key_1_value_-1 dup key: { : "group:cid:166:privileges:posts:view_deleted", : null }
        at Function.MongoError.create (/opt/nodebb/node_modules/mongodb/node_modules/mongodb-core/lib/error.js:45:10)
        at toError (/opt/nodebb/node_modules/mongodb/lib/utils.js:149:22)
        at /opt/nodebb/node_modules/mongodb/lib/collection.js:1029:39
        at /opt/nodebb/node_modules/mongodb/node_modules/mongodb-core/lib/connection/pool.js:544:18
        at _combinedTickCallback (internal/process/next_tick.js:73:7)
        at process._tickCallback (internal/process/next_tick.js:104:9)
    
    /opt/nodebb/node_modules/mongodb/lib/utils.js:132
          throw err;
          ^
    MongoError: E11000 duplicate key error collection: nodebb.objects index: _key_1_value_-1 dup key: { : "group:cid:166:privileges:posts:view_deleted", : null }
        at Function.MongoError.create (/opt/nodebb/node_modules/mongodb/node_modules/mongodb-core/lib/error.js:45:10)
        at toError (/opt/nodebb/node_modules/mongodb/lib/utils.js:149:22)
        at /opt/nodebb/node_modules/mongodb/lib/collection.js:1029:39
        at /opt/nodebb/node_modules/mongodb/node_modules/mongodb-core/lib/connection/pool.js:544:18
        at _combinedTickCallback (internal/process/next_tick.js:73:7)
        at process._tickCallback (internal/process/next_tick.js:104:9)
    
  • NodeBB Admin

    Try running the same upgrade script with ./nodebb upgrade view_deleted_privilege alternatively you can apply this fix and run it again. https://github.com/NodeBB/NodeBB/commit/472490158856efa22cfe4a2bbb29ab6ddf90a1cc


  • In a fit of desperation, I ran the nodebb upgrade again and it finished with no errors. Should I be worried? (yes, I made a backup so I have a safety net if necessary).

  • NodeBB Admin

    Nope that upgrade can be run multiple times without side effects.


Suggested Topics

| | |

© 2014 – 2022 NodeBB, Inc. — Made in Canada.