strider icon indicating copy to clipboard operation
strider copied to clipboard

Error updating Strider database

Open pedrofranceschi opened this issue 12 years ago • 15 comments

I was trying to update my database from Strider 1.3.1 to the latest version and I got this error:

deploy@integrator:~$ STRIDER_DB_UPGRADE=yes strider -p 8080
13 Jan 01:34:18 - info: Using MongoDB URL: mongodb://localhost/strider-foss
13 Jan 01:34:18 - warn: connect.multipart() will be removed in connect 3.0
13 Jan 01:34:18 - warn: visit https://github.com/senchalabs/connect/wiki/Connect-3.0 for alternatives
13 Jan 01:34:18 - warn: connect.limit() will be removed in connect 3.0
13 Jan 01:34:18 - warn: No SMTP creds - forgot password flow will not work
13 Jan 01:34:18 - info: STRIDER_DB_UPGRADE is set to yes
13 Jan 01:34:18 - info: Updating database from version 0 to 1
13 Jan 01:34:18 - info: converting users 2
13 Jan 01:34:18 - info: projects 0 522e39b6d47dafc50e000008

/usr/lib/node_modules/strider/node_modules/mongoose/lib/utils.js:419
        throw err;
              ^
TypeError: Cannot read property 'id' of undefined
    at makeProvider (/usr/lib/node_modules/strider/lib/models/upgrade/from0to1.js:256:47)
    at makeProject (/usr/lib/node_modules/strider/lib/models/upgrade/from0to1.js:408:15)
    at Promise.<anonymous> (/usr/lib/node_modules/strider/lib/models/upgrade/from0to1.js:238:23)
    at Promise.<anonymous> (/usr/lib/node_modules/strider/node_modules/mongoose/node_modules/mpromise/lib/promise.js:162:8)
    at Promise.EventEmitter.emit (events.js:95:17)
    at Promise.emit (/usr/lib/node_modules/strider/node_modules/mongoose/node_modules/mpromise/lib/promise.js:79:38)
    at Promise.fulfill (/usr/lib/node_modules/strider/node_modules/mongoose/node_modules/mpromise/lib/promise.js:92:20)
    at Promise.resolve (/usr/lib/node_modules/strider/node_modules/mongoose/lib/promise.js:108:15)
    at Promise.<anonymous> (/usr/lib/node_modules/strider/node_modules/mongoose/node_modules/mpromise/lib/promise.js:162:8)
    at Promise.EventEmitter.emit (events.js:95:17)

Any idea what's going on?

Thanks,

Pedro

pedrofranceschi avatar Jan 13 '14 03:01 pedrofranceschi

This looks like a bug in the upgrade script. We'd need to dig into the structure of your documents to see exactly why it's blowing up.

niallo avatar Jan 13 '14 19:01 niallo

Is there any way to rollback to 1.3.1? Because now I don't have a CI server anymore :(

pedrofranceschi avatar Jan 13 '14 19:01 pedrofranceschi

I tried to rollback to 1.3.1 with sudo npm install -g [email protected] but I got this error:

deploy@integrator:~$ strider -p 8080
13 Jan 17:56:42 - info: Using MongoDB URL: mongodb://localhost/strider-foss

TypeError: Object function Loader(lesspaths) {
  this.types = {
    'job': job,
    'runner': runner,
    'provider': provider,
    'basic': basic
  }
  this.ids = {}
  this.lesspaths = lesspaths || []
  this.extensions = {
    job: {},
    runner: {},
    provider: {},
    basic: {}
  }
} has no method 'initExtensions'
    at module.exports (/usr/lib/node_modules/strider/main.js:102:10)
    at start (/usr/lib/node_modules/strider/bin/strider:129:3)
    at Object.cb (/usr/lib/node_modules/strider/bin/strider:157:5)
    at Object.ArgParser.parse (/usr/lib/node_modules/strider/node_modules/nomnom/nomnom.js:306:21)
    at Object.<anonymous> (/usr/lib/node_modules/strider/bin/strider:160:8)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Function.Module.runMain (module.js:497:10)

pedrofranceschi avatar Jan 13 '14 19:01 pedrofranceschi

yeah you'll need to uninstall and then reinstall -- b/c all the sub packages are different

Jared

On Mon, Jan 13, 2014 at 12:58 PM, Pedro Franceschi <[email protected]

wrote:

I tried to rollback to 1.3.1 with sudo npm install -g [email protected] but I got this error:

deploy@integrator:~$ strider -p 8080 13 Jan 17:56:42 - info: Using MongoDB URL: mongodb://localhost/strider-foss

TypeError: Object function Loader(lesspaths) { this.types = { 'job': job, 'runner': runner, 'provider': provider, 'basic': basic } this.ids = {} this.lesspaths = lesspaths || [] this.extensions = { job: {}, runner: {}, provider: {}, basic: {} } } has no method 'initExtensions' at module.exports (/usr/lib/node_modules/strider/main.js:102:10) at start (/usr/lib/node_modules/strider/bin/strider:129:3) at Object.cb (/usr/lib/node_modules/strider/bin/strider:157:5) at Object.ArgParser.parse (/usr/lib/node_modules/strider/node_modules/nomnom/nomnom.js:306:21) at Object. (/usr/lib/node_modules/strider/bin/strider:160:8) at Module._compile (module.js:456:26) at Object.Module._extensions..js (module.js:474:10) at Module.load (module.js:356:32) at Function.Module._load (module.js:312:12) at Function.Module.runMain (module.js:497:10)

— Reply to this email directly or view it on GitHubhttps://github.com/Strider-CD/strider/issues/332#issuecomment-32204969 .

jaredly avatar Jan 13 '14 19:01 jaredly

I uninstalled all strider packages completely and even after reinstalling [email protected], I got the same error. Any idea?

pedrofranceschi avatar Jan 13 '14 20:01 pedrofranceschi

Well you need to restore your database to pre-upgrade

niallo avatar Jan 13 '14 22:01 niallo

I did the backup after the error :X no way to manually rollback?

pedrofranceschi avatar Jan 13 '14 22:01 pedrofranceschi

The upgrade writes to the database. That is why the warning message says to backup your database before running the upgrade (https://github.com/Strider-CD/strider/blob/master/lib/models/upgrade/index.js#L26).

I'm sorry, there isn't a way to manually rollback the contents of your database without a backup :(

niallo avatar Jan 13 '14 22:01 niallo

Ok, my fault. I’ll start from scratch. Is there any way to at least get my deployment scripts from MongoDB?

On Jan 13, 2014, at 8:18 PM, niallo [email protected] wrote:

The upgrade writes to the database. That is why the warning message says to backup your database before running the upgrade (https://github.com/Strider-CD/strider/blob/master/lib/models/upgrade/index.js#L26).

I'm sorry, there isn't a way to manually rollback the contents of your database without a backup :(

— Reply to this email directly or view it on GitHub.

pedrofranceschi avatar Jan 13 '14 22:01 pedrofranceschi

Yes, you should be able to find project settings (like deployment scripts) in the database. They should be in your user document, if the old ones still exist (which hopefully they do).

niallo avatar Jan 13 '14 22:01 niallo

Yep, I was able to get my deployment scripts from my user document. Reinstalled the latest version and everything is working smoothly.

pedrofranceschi avatar Jan 14 '14 14:01 pedrofranceschi

Glad to hear it!

On Tuesday, January 14, 2014, Pedro Franceschi wrote:

Yep, I was able to get my deployment scripts from my user document. Reinstalled the latest version and everything is working smoothly.

— Reply to this email directly or view it on GitHubhttps://github.com/Strider-CD/strider/issues/332#issuecomment-32266658 .

Niall O'Higgins W: http://niallohiggins.com E: [email protected] T: @niallohiggins

niallo avatar Jan 14 '14 17:01 niallo

Is there anything actionable here?

jaredly avatar Jan 31 '14 21:01 jaredly

Other than there being a bug somewhere in the upgrade process, no.

niallo avatar Feb 02 '14 20:02 niallo

I think best to put effort into from-scratch installs rather than tracking down odd upgrade cases. If this keeps happening we can investigate. Need more info.

niallo avatar Feb 02 '14 20:02 niallo