• Home
  • Categories
  • Recent
  • Popular
  • Top
  • Tags
  • Users
  • Groups
  • Documentation
    • Home
    • Read API
    • Write API
    • Plugin Development
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
v3.5.2 Latest
Buy Hosting

Index with name: _key_1_value_-1 already exists with different options

Scheduled Pinned Locked Moved Technical Support
v1.x.xv1.4.0mongod
12 Posts 3 Posters 8.2k Views
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    Leonardo Galani
    wrote on last edited by Leonardo Galani
    #1

    Hi.. i just tried to upgrade to the last version but im getting a mongodb error..
    this is the last commit om the branch v1.x.x

    commit d120ee86cfe2a55efcd3982cc3e8fa3f71284602
    Author: Misty (Bot) <[email protected]>
    Date:   Thu Dec 1 21:28:53 2016 +0000
    
    Incremented version number
    

    This is the error trying to .upgrade...

    3. Updating NodeBB data store schema...    
    5/12 09:42 [15858] - error: MongoError: exception: Index with name: _key_1_value_-1 already exists with different options
    at Function.MongoError.create (/home/forum/NodeBB/node_modules/mongodb-core/lib/error.js:31:11)
    at /home/forum/NodeBB/node_modules/mongodb-core/lib/connection/pool.js:462:72
    at authenticateStragglers (/home/forum/NodeBB/node_modules/mongodb-core/lib/connection/pool.js:410:16)
    at null.messageHandler (/home/forum/NodeBB/node_modules/mongodb-core/lib/connection/pool.js:444:5)
    at Socket.<anonymous> (/home/forum/NodeBB/node_modules/mongodb-core/lib/connection/connection.js:306:22)
    at emitOne (events.js:90:13)
    at Socket.emit (events.js:182:7)
    at readableAddChunk (_stream_readable.js:153:18)
    at Socket.Readable.push (_stream_readable.js:111:10)
    at TCP.onread (net.js:529:20)
    
    Error: undefined
    

    This is my mongo version:

    MongoDB shell version: 3.0.14
    
    1 Reply Last reply
    0
  • barisB Offline
    barisB Offline
    <baris> NodeBB
    wrote on last edited by
    #2

    Try dropping the indices first then running upgrade again.

    1 Reply Last reply
    1
  • L Offline
    L Offline
    Leonardo Galani
    wrote on last edited by Leonardo Galani
    #3

    Listed all the indexes as the official doc says: https://docs.mongodb.com/v3.2/tutorial/manage-indexes/

    now i only have the index that the mongo cant drop:

    Indexes for objects:
    
    [
    {
    	"v" : 1,
    	"key" : {
    		"_id" : 1
    	},
    	"name" : "_id_",
    	"ns" : "nodebb.objects"
    }
    ]
    Indexes for search:
    [
    {
    	"v" : 1,
    	"key" : {
    		"_id" : 1
    	},
    	"name" : "_id_",
    	"ns" : "nodebb.search"
    }
    ]
    Indexes for searchpost:
    [
    {
    	"v" : 1,
    	"key" : {
    		"_id" : 1
    	},
    	"name" : "_id_",
    	"ns" : "nodebb.searchpost"
    }
    ]
    Indexes for searchtopic:
    [
    {
    	"v" : 1,
    	"key" : {
    		"_id" : 1
    	},
    	"name" : "_id_",
    	"ns" : "nodebb.searchtopic"
    }
    ]
    Indexes for sessions:
    [
    {
    	"v" : 1,
    	"key" : {
    		"_id" : 1
    	},
    	"name" : "_id_",
    	"ns" : "nodebb.sessions"
    }
    ]
    Indexes for system.indexes:
    [ ]
    Indexes for system.users:
    [
    {
    	"v" : 1,
    	"key" : {
    		"_id" : 1
    	},
    	"name" : "_id_",
    	"ns" : "nodebb.system.users"
    }
    ]
    
    1 Reply Last reply
    0
  • L Offline
    L Offline
    Leonardo Galani
    wrote on last edited by
    #4

    But it still cant upgrade it...

    getting other error:

    5/12 12:09 [16752] - info: [database] Checking database indices.
    5/12 12:09 [16752] - error: Error creating index exception: E11000 duplicate key error index: nodebb.objects.$_key_1_value_-1 dup key: { : "ip:recent", : "10.y.x.14c" }
    5/12 12:09 [16752] - info: [database] Checking database indices done!
    5/12 12:09 [16752] - error: MongoError: exception: E11000 duplicate key error index: nodebb.objects.$_key_1_value_-1 dup key: { : "ip:recent", : "10.y.x.14c" }
    at Function.MongoError.create (/home/forum/NodeBB/node_modules/mongodb-core/lib/error.js:31:11)
    at /home/forum/NodeBB/node_modules/mongodb-core/lib/connection/pool.js:462:72
    at authenticateStragglers (/home/forum/NodeBB/node_modules/mongodb-core/lib/connection/pool.js:410:16)
    at null.messageHandler (/home/forum/NodeBB/node_modules/mongodb-core/lib/connection/pool.js:444:5)
    at Socket.<anonymous> (/home/forum/NodeBB/node_modules/mongodb-core/lib/connection/connection.js:306:22)
    at emitOne (events.js:90:13)
    at Socket.emit (events.js:182:7)
    at readableAddChunk (_stream_readable.js:153:18)
    at Socket.Readable.push (_stream_readable.js:111:10)
    at TCP.onread (net.js:529:20)
    
    Error: undefined
    

    (changed the ip address)

    1 Reply Last reply
    0
  • barisB Offline
    barisB Offline
    <baris> NodeBB
    wrote on last edited by
    #5

    Do you get the same error when you run ./nodebb upgrade again?

    1 Reply Last reply
    1
  • L Offline
    L Offline
    Leonardo Galani
    wrote on last edited by
    #6

    yep.. the same error

    5/12 12:09 [16752] - error: MongoError: exception: E11000 duplicate key error index: nodebb.objects.$_key_1_value_-1 dup key: { : "ip:recent", : "10.y.x.14c" }
    at Function.MongoError.create (/home/forum/NodeBB/node_modules/mongodb-core/lib/error.js:31:11)
    
    1 Reply Last reply
    0
  • barisB Offline
    barisB Offline
    <baris> NodeBB
    wrote on last edited by
    #7

    You can try removing that document and try running ./nodebb upgrade

    db.objects.remove({_key: "ip:recent", value: "insert ip here"});
    
    1 Reply Last reply
    1
  • L Offline
    L Offline
    Leonardo Galani
    wrote on last edited by
    #8

    ok.. after deleting a few recent ips.. (like..12...) it worked out... wondering why it happend... 😞

    1 Reply Last reply
    0
  • barisB Offline
    barisB Offline
    <baris> NodeBB
    wrote on last edited by
    #9

    Read more here about why it happens https://github.com/NodeBB/NodeBB/issues/4467

    1 Reply Last reply
    0
  • exodoE Offline
    exodoE Offline
    exodo Plugin & Theme Dev
    wrote on last edited by
    #10

    i have the same problem...

    1 Reply Last reply
    0
  • exodoE Offline
    exodoE Offline
    exodo Plugin & Theme Dev
    wrote on last edited by
    #11

    6/12 13:55 [3733] - error: Error creating index exception: E11000 duplicate key error index: exodef.objects.$key_1_value-1 dup key: { : "uid:2229:chat:rooms", : "1371" }
    6/12 13:55 [3733] - info: [database] Checking database indices done!
    6/12 13:55 [3733] - error: MongoError: exception: E11000 duplicate key error index: exodef.objects.$key_1_value-1 dup key: { : "uid:2229:chat:rooms", : "1371" }
    at Function.MongoError.create (/var/foroexodo/nodebb/node_modules/mongodb/node_modules/mongodb-core/lib/error.js:31:11)
    at /var/foroexodo/nodebb/node_modules/mongodb/node_modules/mongodb-core/lib/connection/pool.js:462:72
    at authenticateStragglers (/var/foroexodo/nodebb/node_modules/mongodb/node_modules/mongodb-core/lib/connection/pool.js:410:16)
    at null.messageHandler (/var/foroexodo/nodebb/node_modules/mongodb/node_modules/mongodb-core/lib/connection/pool.js:444:5)
    at Socket.<anonymous> (/var/foroexodo/nodebb/node_modules/mongodb/node_modules/mongodb-core/lib/connection/connection.js:306:22)
    at emitOne (events.js:77:13)
    at Socket.emit (events.js:169:7)
    at readableAddChunk (_stream_readable.js:153:18)
    at Socket.Readable.push (_stream_readable.js:111:10)
    at TCP.onread (net.js:537:20)

    Error: undefined

    1 Reply Last reply
    0
  • exodoE Offline
    exodoE Offline
    exodo Plugin & Theme Dev
    wrote on last edited by
    #12

    it worked after dropping 30 objects...
    good luck on standard users solving this lol

    1 Reply Last reply
    0

Copyright © 2023 NodeBB | Contributors
  • Login

  • Don't have an account? Register

  • Login or register to search.
Powered by NodeBB Contributors
  • First post
    Last post
0
  • Home
  • Categories
  • Recent
  • Popular
  • Top
  • Tags
  • Users
  • Groups
  • Documentation
    • Home
    • Read API
    • Write API
    • Plugin Development