Picture of Lars Halkjær
Upgrading AT to 0.5.0
by Lars Halkjær - Monday, 3 September 2018, 1:06 AM
 

I am having trouble finding the right method for upgrading an existing AT server (Ubuntu 14.04.3) ver. 0.4.1/2.2.5.

My last attempt was to:

  1. run "node upgrade" and select tags/v0.5.0 as the AT version, and nothing for the framework version to keep 2.2.5.
  2. upgrade node to the lts version (8.11.4).
  3. run "node server".

But I get this error:

error creating server [Server at localhost:27017 reports wire version 0, but this version of Node.js Driver requires at least 2 (MongoDB2.6).]

Has anyone got a recipe for upgrading a 0.4.1/2.2.5 Ubuntu server to 0.5.0/2.2.5?

Picture of Jonathan Briggs
Re: Upgrading AT to 0.5.0
by Jonathan Briggs - Monday, 3 September 2018, 11:03 AM
 

Not on an Ubuntu server, but the 8.11.4 node package upgrade by itself wouldn't work for me - pushing npm to 6.4.0 was required separately.

Picture of Lars Halkjær
Re: Upgrading AT to 0.5.0
by Lars Halkjær - Monday, 3 September 2018, 9:30 PM
 

Hi Jonathan

Thank you for the suggestion.
I tried upgrading the server, and then upgrade node to 8.11.4 and npm to 6.4.0.
Unfortunately I still got the error.
I suspect it has to do with the database.

Picture of Dan Gray
Re: Upgrading AT to 0.5.0
by Dan Gray - Monday, 3 September 2018, 4:10 PM
 

Hi Lars, what version of MongoDB do you have installed on the server?

Picture of Lars Halkjær
Re: Upgrading AT to 0.5.0
by Lars Halkjær - Monday, 3 September 2018, 9:43 PM
 

Hi Dan, the MongoDB is ver. 2.4.9 (in light of which the error message makes some sense...).

It is the database installed when the AT server was first set up and I am a bit in doubt about how to upgrade it, and to which version it should be upgraded.

Picture of Lars Halkjær
Re: Upgrading AT to 0.5.0
by Lars Halkjær - Tuesday, 4 September 2018, 1:41 PM
 

Instead of updating an existing server I have tried to install the AT 0.5.0 from scratch on an Ubuntu 16.04.5 server.
I installed the prerequisites:

  • git v2.7.4
  • node v8.11.4
  • npm v6.4.1
  • grunt-cli v1.3.1
  • ffmpeg v2.8.15
  • mongod v4.0.2

After installing all this I checked the MongoDB status ("service mongod status"):

● mongod.service - MongoDB Database Server
   Loaded: loaded (/lib/systemd/system/mongod.service; disabled; vendor preset: enabled)
   Active: inactive (dead)
     Docs: https://docs.mongodb.org/manual

I then started it using "service mongod start" and status is now:

● mongod.service - MongoDB Database Server
   Loaded: loaded (/lib/systemd/system/mongod.service; disabled; vendor preset: enabled)
   Active: active (running) since Tue 2018-09-04 13:21:42 UTC; 6s ago
     Docs: https://docs.mongodb.org/manual
 Main PID: 1856 (mongod)
    Tasks: 26
   Memory: 175.5M
      CPU: 1.848s
   CGroup: /system.slice/mongod.service
           └─1856 /usr/bin/mongod --config /etc/mongod.conf

I then run:
git clone https://github.com/adaptlearning/adapt_authoring.git
npm install --production
node install
node server

Starting the server yields:

/adapt_authoring# node server
info: [04 Sep 2018 13:10:48 +00:00] configuration loaded from /root/adapt_authoring/conf/config.json
info: [04 Sep 2018 13:10:48 +00:00] Supporting the following authentication types:
info: [04 Sep 2018 13:10:48 +00:00] - local
error: [04 Sep 2018 13:10:48 +00:00] Check for updates failed, Error: Cannot determine framework version
Error: /root/adapt_authoring/temp/adapt_framework/package.json: ENOENT: no such file or directory, open '/root/adapt_authoring/temp/adapt_framework/package.json'
(node:1963) DeprecationWarning: current URL string parser is deprecated, and will be removed in a future version. To use the new parser, pass option { useNewUrlParser: true } to MongoClient.connect.
error: [04 Sep 2018 13:10:50 +00:00] MongoError: Authentication failed.
info: [04 Sep 2018 13:10:50 +00:00] error creating server [Authentication failed.]

If I edit the "adapt_authoring/conf/config.json" and set these to empty:
  "dbUser": "",
  "dbPass": "",
then starting the server yields:

~/adapt_authoring# node server
info: [04 Sep 2018 13:14:22 +00:00] configuration loaded from /root/adapt_authoring/conf/config.json
info: [04 Sep 2018 13:14:22 +00:00] Supporting the following authentication types:
info: [04 Sep 2018 13:14:22 +00:00] - local
error: [04 Sep 2018 13:14:23 +00:00] Check for updates failed, Error: Cannot determine framework version
Error: /root/adapt_authoring/temp/adapt_framework/package.json: ENOENT: no such file or directory, open '/root/adapt_authoring/temp/adapt_framework/package.json'
(node:2019) DeprecationWarning: current URL string parser is deprecated, and will be removed in a future version. To use the new parser, pass option { useNewUrlParser: true } to MongoClient.connect.
info: [04 Sep 2018 13:14:24 +00:00] Connection established: adapt-tenant-master
(node:2019) DeprecationWarning: collection.ensureIndex is deprecated. Use createIndexes instead.
warn: [04 Sep 2018 13:14:25 +00:00] - Authenticated User doesn't exist, cannot update
warn: [04 Sep 2018 13:14:25 +00:00] - Super Admin doesn't exist, cannot update
warn: [04 Sep 2018 13:14:25 +00:00] - Course Creator doesn't exist, cannot update
warn: [04 Sep 2018 13:14:25 +00:00] - Product Manager doesn't exist, cannot update
warn: [04 Sep 2018 13:14:25 +00:00] - Tenant Admin doesn't exist, cannot update

One thing I noticed was that the "adapt_authoring/temp/adapt_framework/" path, where it tries to find a "package.json" file, is non-existing.
I always assumed that it was created during the install (and it seems that the server script assumes the same).

I have tried some variations to this theme, but it seems to end the same way.
Can anybody spot an error in the procedure, or does anyone have experience with the error messages above?

Picture of Tom Taylor
Re: Upgrading AT to 0.5.0
by Tom Taylor - Wednesday, 5 September 2018, 2:06 PM
 

Hi Lars,

It looks like something went wrong during the install, as you look to have an incomplete config.json file. I'd try running the install.js script again, and see if that gets you any further.

Picture of Lars Halkjær
Re: Upgrading AT to 0.5.0
by Lars Halkjær - Wednesday, 5 September 2018, 4:16 PM
 

Hi Tom

I tried to install it 4 times with slight variations without success..

But running "node install" a second time at the end instead, did the trick - thanks Tom!