avatar
Courses not loading in authoring tool after framework upgrade
by Sam Howell - Tuesday, 12 May 2020, 1:40 PM
 

Since upgrading the Adapt framework to 5.4.0, I've been unable to load any of my courses in the AAT.

Would appreciate any help for this.

Please see below for errors and output when trying to preview a new test course with vanilla theme in the AAT:

info [12 May 20 13:33:05 +00:00] configuration loaded from /home/squire/adapt_authoring/conf/config.json
info [12 May 20 13:33:05 +00:00] Supporting the following authentication types:
info [12 May 20 13:33:05 +00:00] - local
info [12 May 20 13:33:05 +00:00] Connection established: adapt-tenant-master
info [12 May 20 13:33:07 +00:00] Adapt authoring tool 0.10.3.
info [12 May 20 13:33:07 +00:00] Adapt framework 5.4.0.
info [12 May 20 13:33:07 +00:00] Server started listening on port 5000
info [12 May 20 13:34:47 +00:00] Retrieving JSON
info [12 May 20 13:34:47 +00:00] All theme assets processed
info [12 May 20 13:34:47 +00:00] All assets processed
info [12 May 20 13:34:47 +00:00] 3.1. Ensuring framework build exists
info [12 May 20 13:34:47 +00:00] 3.2. Using theme: 5d3b614faa03d12ad7ba36f3
info [12 May 20 13:34:47 +00:00] 3.3. Using menu: adapt-contrib-boxMenu
info [12 May 20 13:34:47 +00:00] grunt server-build:prod --outputdir=courses/5d3b60f6aa03d12ad7ba36d8/5ebaa3c99846211780c8c59e/build --theme=5d3b614faa03d12ad7ba36f3 --menu=adapt-contrib-boxMenu
error [12 May 20 13:34:50 +00:00] exec error: Error: Command failed: grunt server-build:prod --outputdir=courses/5d3b60f6aa03d12ad7ba36d8/5ebaa3c99846211780c8c59e/build --theme=5d3b614faa03d12ad7ba36f3 --menu=adapt-contrib-boxMenu

error [12 May 20 13:34:50 +00:00] stdout error: Running "server-build:prod" (server-build) task

Running "_log-vars" task
The following will be included in the build:
- adapt-contrib-boxMenu
- 5d3b614faa03d12ad7ba36f3
- adapt-contrib-text

>> Using source at 'src/'
>> Building to 'courses/5d3b60f6aa03d12ad7ba36d8/5ebaa3c99846211780c8c59e/build/'
>> Using theme '5d3b614faa03d12ad7ba36f3'
>> Using menu adapt-contrib-boxMenu'

Running "build-config" task
>> Plugin folder name 5d3b614faa03d12ad7ba36f3 does not match package name adapt-contrib-vanilla.

Running "copy:coreAssets" (copy) task


Running "copy:componentAssets" (copy) task


Running "copy:componentFonts" (copy) task


Running "copy:extensionAssets" (copy) task


Running "copy:extensionFonts" (copy) task


Running "copy:menuAssets" (copy) task


Running "copy:coreFonts" (copy) task
Copied 8 files

Running "copy:menuFonts" (copy) task


Running "copy:themeAssets" (copy) task


Running "copy:themeFonts" (copy) task


Running "copy:coreLibraries" (copy) task
Copied 19 files

Running "copy:libraries" (copy) task


Running "copy:coreRequired" (copy) task
Created 2 directories, copied 2 files

Running "copy:required" (copy) task


Running "less:compile" (less) task

Running "handlebars:compile" (handlebars) task
>> 1 file created.

Running "javascript:compile" (javascript) task

Running "babel:dist" (babel) task
Warning: Cannot find module 'fast-async' from '/home/squire/adapt_authoring/temp/5d3b60f6aa03d12ad7ba36d8/adapt_framework' Use --force to continue.

Aborted due to warnings.


Execution Time (2020-05-12 13:34:48 UTC-0)
loading tasks          50ms  ▇ 2%
copy:componentAssets   45ms  ▇ 2%
copy:componentFonts    43ms  ▇ 2%
copy:extensionAssets   30ms  ▇ 1%
copy:extensionFonts    25ms  ▇ 1%
copy:coreFonts         30ms  ▇ 1%
copy:libraries         74ms  ▇▇ 4%
copy:required          68ms  ▇▇ 3%
less:compile          775ms  ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 39%
handlebars:compile    212ms  ▇▇▇▇▇ 11%
javascript:compile    529ms  ▇▇▇▇▇▇▇▇▇▇▇ 26%
loading grunt-babel    41ms  ▇ 2%
Total 2s


error [12 May 20 13:34:50 +00:00] Command failed: grunt server-build:prod --outputdir=courses/5d3b60f6aa03d12ad7ba36d8/5ebaa3c99846211780c8c59e/build --theme=5d3b614faa03d12ad7ba36f3 --menu=adapt-contrib-boxMenu

error [12 May 20 13:34:50 +00:00] Command failed: grunt server-build:prod --outputdir=courses/5d3b60f6aa03d12ad7ba36d8/5ebaa3c99846211780c8c59e/build --theme=5d3b614faa03d12ad7ba36f3 --menu=adapt-contrib-boxMenu

 

 

Picture of Matt Leathes
Re: Courses not loading in authoring tool after framework upgrade
by Matt Leathes - Tuesday, 12 May 2020, 3:57 PM
 

Based on this:
Warning: Cannot find module 'fast-async' from '/home/squire/adapt_authoring/temp/5d3b60f6aa03d12ad7ba36d8/adapt_framework'

It looks like your copy of the framework needs npm install re-running. Sorry, as I don't really use the AAT much I don't know the best way to go about this or how to do a framework upgrade in a way that means this doesn't happen. I can't seem to find a wiki page that specifically covers just updating the Framework part of the authoring tool?

avatar
Re: Courses not loading in authoring tool after framework upgrade
by Sam Howell - Wednesday, 13 May 2020, 7:09 AM
 

Thanks for the suggestion, Matt.

I tried sudo npm install in the directory mentioned above and got the following errors - do these mean anything to you? I'm not really sure what to look for here...

$ sudo npm install

> nodent-runtime@3.2.1 install /home/squire/adapt_authoring/temp/5d3b60f6aa03d12ad7ba36d8/adapt_framework/node_modules/nodent-runtime
> node build.js

fs.js:114
    throw err;
    ^

Error: EACCES: permission denied, open '/home/squire/adapt_authoring/temp/5d3b60f6aa03d12ad7ba36d8/adapt_framework/node_modules/nodent-runtime/dist/index.js'
    at Object.openSync (fs.js:443:3)
    at Object.writeFileSync (fs.js:1194:35)
    at Object.<anonymous> (/home/squire/adapt_authoring/temp/5d3b60f6aa03d12ad7ba36d8/adapt_framework/node_modules/nodent-runtime/build.js:5:4)
    at Module._compile (internal/modules/cjs/loader.js:776:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:829:12)
    at startup (internal/bootstrap/node.js:283:19)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! nodent-runtime@3.2.1 install: `node build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the nodent-runtime@3.2.1 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/squire2/.npm/_logs/2020-05-13T07_04_37_961Z-debug.log

Picture of Matt Leathes
Re: Courses not loading in authoring tool after framework upgrade
by Matt Leathes - Wednesday, 13 May 2020, 9:20 AM
 

Delete the node_modules folder from /home/squire/adapt_authoring/temp/5d3b60f6aa03d12ad7ba36d8/adapt_framework/ then try again. Also make sure you're not running some hideously out-of-date version of NodeJS - anything more recent than v8 but no more recent than LTS should be fine.

Out of interest, how did you actually perform the Framework upgrade in the first place? It should have handled doing all this for you. I'm told the correct command to run to upgrade the Framework only to a specific release is:

node upgrade --continue y --updateAutomatically n --authoringToolGitTag n --frameworkGitTag v5.4.0

(presumably after stopping the authoring tool server)

Could be worth trying that again?

 

avatar
Re: Courses not loading in authoring tool after framework upgrade
by Sam Howell - Wednesday, 13 May 2020, 10:16 AM
 

I tried that command in my adapt_authoring dir, but it returned the same errors, which is strange as I managed to upgrade before by simply running node upgrade.js (as I'm prompted to do when there is a new version and I've run node server).

To be honest I don't think my Adapt file structure (and possibly certain permissions) are quite set up correctly. I wonder if it's worth doing a clean install if nothing else works, and after confirming I've backed up all that I can. Due to this current issue, I haven't been able to export anything more from the AAT; I get the same errors - but I do have recent course backups, so I shouldn't lose anything important in the process of a clean install. There's always the chance that I end up regretting it if I hit a barrier somewhere down the line, but if I can't sort this issue out soon then I'll be out of ideas and options.

This has also made we wonder if it's easier/safer to just build courses in the framework going forward... Is there anything the AAT offers that can't reliably be done in the framework?

Picture of Matt Leathes
Re: Courses not loading in authoring tool after framework upgrade
by Matt Leathes - Wednesday, 13 May 2020, 2:02 PM
 

That is a bit odd. Sorry I can't help more, I'm not that knowledgeable about that side of things in the AAT!

Is there anything the AAT offers that can't reliably be done in the framework?

If you're comfortable working with JSON and doing simple HTML formatting - not really TBH.

Here at Kineo even if we're producing a course that will eventually be maintained in the Authoring Tool we'll often still build it using the Framework as it's quicker to do so (once you know how to do it) then import it into the AAT at the end of the project. The only caveat is that you obviously need to check that any customisation you're doing (to the theme, adding new plugins etc) is all AAT compatible and - more importantly - isn't going to break any other courses on that AAT instance!

One thing the AAT does let you do is build multiple courses from the same source code - you can do this in the Framework but you'll need to use rub-cli to do so. It also doesn't require you to have two copies of your course content, like the standard Grunt build process does. Instead of having all your content in src/course and copying it into the build folder, you just have source code in your src folder and all your content in the builds folder. Which also means you don't need to run any commands just because you've changed JSON or added an asset.

It does require a slightly different folder structure, instead of src & build folder, you have:

  • builds
    • course1
    • course2
    • course3
  • src
    • components
    • core
    • extensions
    • menu
    • theme

I tend to start by downloading the framework as normal using the adapt-cli, building it using grunt dev (then stopping it via CTRL+c), then deleting src/course, renaming 'build' to 'builds' and moving the course content from the 'builds' folder into 'builds/m05' (or whatever naming convention you like to use). Then you can run rub dev m05 to switch over to rub-cli and build it with that instead.

You might also find https://github.com/tomgreenfield/CSVeat for setting up the course structure for you.

avatar
Re: Courses not loading in authoring tool after framework upgrade
by Sam Howell - Wednesday, 13 May 2020, 3:23 PM
 

Thanks for the info.

I almost forgot to say, your solution worked! I deleted the node_modules folder, ran npm install again and now my courses are loading from the AAT.

I'd be interested in trying out rub-cli if you recommend it for building, though I still don't fully understand how it works (could you provide any other resources/links for using this tool?)

For now, I might just try out building my next course in the framework and compare the experience with building in the AAT.

Picture of Matt Leathes
Re: Courses not loading in authoring tool after framework upgrade
by Matt Leathes - Wednesday, 13 May 2020, 4:05 PM
 
I almost forgot to say, your solution worked!

Good news!

I'd be interested in trying out rub-cli if you recommend it for building, though I still don't fully understand how it works

Have you done any framework stuff before using the standard adapt CLI and Grunt? If not, it's probably easier for you to get started with that then switch over to rub-cli - which essentially just 'extends' the behaviour of the standard Adapt OS grunt commands.

If you have any immediate questions then feel free to pop into the Framework chat room and ask.

avatar
Re: Courses not loading in authoring tool after framework upgrade
by Sam Howell - Thursday, 14 May 2020, 7:25 AM
 

Yes, I developed my first theme by building in the framework, running grunt dev etc.

I think I'll try building my next course solely using the framework as a way to get more comfortable with it before trying rub-cli.

Thanks again for your help.