Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exports not created after update from 2.3.3 to 5.3.0 #1497

Open
figureone opened this issue Jan 6, 2020 · 1 comment
Open

Exports not created after update from 2.3.3 to 5.3.0 #1497

figureone opened this issue Jan 6, 2020 · 1 comment

Comments

@figureone
Copy link

What version were you using?

Version 5.3.0 (open source)

What steps can we follow to reproduce the behaviour?

We upgraded a Learning Locker server from version 2.3.3 to 5.3.0 by creating a new VM, installing the latest version of Learning Locker using the deployll.sh install script, exporting/importing the database using mongodump and mongorestore, and then running all pending migrations via node cli/dist/server migrateMongo. Old server was Ubuntu 16.04.6 LTS, new server is Ubuntu 18.04.3 LTS.

We also copied existing exports to the new server in /usr/local/learninglocker/current/webapp/storage/downloads.

The only problem we've run into so far is attempting to generate new exports via Data > Source > Export panel.

What is the actual behaviour?

In the Downloads tab, new exports appear in the list, but the clock icon never disappears.

What is the expected behavior?

Exports are generated for download.

Is there any additional information that will help us replicate/understand the problem?

pm2 logs reports the following API error:

{ 
  message: 'Cannot read property \'split\' of undefined',
  stack: 'TypeError: Cannot read property \'split\' of undefined
    at SingleNested.Subdocument.isModified (/usr/local/learninglocker/releases/ll-20191226-de2193d10df0de45fc7e5d80b81f2292f6563f4b/webapp/node_modules/mongoose/lib/types/subdocument.js:120:51)
    at SingleNested.<anonymous> (/usr/local/learninglocker/releases/ll-20191226-de2193d10df0de45fc7e5d80b81f2292f6563f4b/webapp/node_modules/mongoose-timestamp/index.js:53:22)
    at callMiddlewareFunction (/usr/local/learninglocker/releases/ll-20191226-de2193d10df0de45fc7e5d80b81f2292f6563f4b/webapp/node_modules/kareem/index.js:482:23)
    at SingleNested.next (/usr/local/learninglocker/releases/ll-20191226-de2193d10df0de45fc7e5d80b81f2292f6563f4b/webapp/node_modules/kareem/index.js:58:7)
    at _next (/usr/local/learninglocker/releases/ll-20191226-de2193d10df0de45fc7e5d80b81f2292f6563f4b/webapp/node_modules/kareem/index.js:106:10)
    at process.nextTick (/usr/local/learninglocker/releases/ll-20191226-de2193d10df0de45fc7e5d80b81f2292f6563f4b/webapp/node_modules/kareem/index.js:507:38)
    at _combinedTickCallback (internal/process/next_tick.js:131:7)
    at process._tickDomainCallback (internal/process/next_tick.js:218:9)' 
}

Looks like mongoose-timestamp is attempting to call isModified() for Subdocument, but mongoose itself expects params for isModified() for the Subdocument type.
https://github.com/drudge/mongoose-timestamp/blob/v0.5.0/index.js#L53
https://github.com/Automattic/mongoose/blob/5.7.5/lib/types/subdocument.js#L118

package-lock.json reports these versions:
mongoose-timestamp: 0.5.0
mongoose: 5.7.5

From the mongoose issue queue, this appears fixed in 5.7.6:
Automattic/mongoose#8251

Any help appreciated! Cheers and Happy New Year.

@figureone
Copy link
Author

Aloha, I just tested applying the patch from Automattic/mongoose@875d681 and restarted via pm2 restart all.

Exports now appear to be working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant