I am at a loss here. I upgraded to 2.17 from 2.16 (Ubuntu 20.04). I thought I was installing hot-fixes but inadvertently upgraded to 2.17 on a production server...But I digress.
With 2.16, tikz worked fine and all rendered well. However, now the web pages are not rendering correctly at all and throwing a tikz error (see below), and students are not able to complete their work.
The server that I upgraded looks like this: https://webwork.unbsj.ca/webwork2
I followed the upgrade instructions in the release notes, all seemed to go well except for errors when running npm install in htdocs.
npm install (in htdocs) errors:
npm WARN logfile Error: EACCES: permission denied, scandir '/root/.npm/_logs'
npm WARN logfile error cleaning log files [Error: EACCES: permission denied, scandir '/root/.npm/_logs'] {
npm WARN logfile errno: -13,
npm WARN logfile code: 'EACCES',
npm WARN logfile syscall: 'scandir',
npm WARN logfile path: '/root/.npm/_logs'
npm WARN logfile }
> generate-assets
> node generate-assets
npm verb stack Error: EACCES: permission denied, mkdir '/root/.npm/_cacache/tmp'
npm verb cwd /opt/webwork/webwork2/htdocs
npm verb Linux 5.15.0-43-generic
npm verb node v16.16.0
npm verb npm v8.16.0
npm ERR! code EACCES
npm ERR! syscall mkdir
npm ERR! path /root/.npm/_cacache/tmp
npm ERR! errno -13
npm verb Error: EACCES: permission denied, mkdir '/root/.npm/_cacache/tmp'
npm ERR!
npm ERR! Your cache folder contains root-owned files, due to a bug in
npm ERR! previous versions of npm which has since been addressed.
npm ERR!
npm ERR! To permanently fix this problem, please run:
npm ERR! sudo chown -R 1000:1000 "/root/.npm"
npm verb exit -13
npm timing npm Completed in 254ms
npm verb unfinished npm timer command:run 1660002672320
npm verb code -13
npm ERR! Log files were not written due to an error writing to the directory: /root/.npm/_logs
npm ERR! You can rerun the command with `--loglevel=verbose` to see the logs in your terminal
npm timing command:install Completed in 1095ms
npm verb stack Error: command failed
npm verb stack at ChildProcess.<anonymous> (/usr/lib/node_modules/npm/node_modules/@npmcli/promise-spawn/lib/index.js:63:27)
npm verb stack at ChildProcess.emit (node:events:527:28)
npm verb stack at maybeClose (node:internal/child_process:1092:16)
npm verb stack at Process.ChildProcess._handle.onexit (node:internal/child_process:302:5)
npm verb cwd /opt/webwork/webwork2/htdocs
npm verb Linux 5.15.0-43-generic
npm verb node v16.16.0
npm verb npm v8.16.0
npm ERR! code 243
npm ERR! path /opt/webwork/webwork2/htdocs
npm ERR! command failed
npm ERR! command sh /tmp/prepare-9740eea2.sh
npm verb exit 243
npm timing npm Completed in 1209ms
npm verb code 243
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2022-08-08T23_51_11_334Z-debug-0.log
wwadmin@webwork:/opt/webwork/webwork2/htdocs$ node:internal/fs/utils:345
throw err;
^
Error: EACCES: permission denied, open '/opt/webwork/webwork2/htdocs/themes/math4-yellow/math4-overrides.js'
at Object.openSync (node:fs:585:3)
at Object.<anonymous> (/opt/webwork/webwork2/htdocs/generate-assets.js:210:19)
at Module._compile (node:internal/modules/cjs/loader:1105:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12)
at node:internal/main/run_main_module:17:47 {
errno: -13,
syscall: 'open',
code: 'EACCES',
path: '/opt/webwork/webwork2/htdocs/themes/math4-yellow/math4-overrides.js'
From the NPM log file:
61 verbose stack Error: ENOENT: no such file or directory, open '/opt/webwork/webwork2/bin/package.json'
62 verbose cwd /opt/webwork/webwork2/bin
63 verbose Linux 5.15.0-43-generic
64 verbose node v16.16.0
65 verbose npm v8.11.0
66 error code ENOENT
67 error syscall open
68 error path /opt/webwork/webwork2/bin/package.json
69 error errno -2
70 error enoent ENOENT: no such file or directory, open '/opt/webwork/webwork2/bin/package.json'
71 error enoent This is related to npm not being able to find a file.
71 error enoent
72 verbose exit -2
73 timing npm Completed in 153ms
74 verbose code -2
75 error A complete log of this run can be found in:
75 error /home/wwadmin/.npm/_logs/2022-08-08T23_08_18_530Z-debug-0.log
Homework set Problem Errors:
Warning messages
Failed to evaluate module
TikZImage: Can't locate TikZImage.pm in @INC (you may need to install
the TikZImage module) (@INC contains: /opt/webwork/pg/lib
/opt/webwork/webwork2/lib /etc/perl
/usr/local/lib/x86_64-linux-gnu/perl/5.30.0 /usr/local/share/perl/5.30.0
/usr/lib/x86_64-linux-gnu/perl5/5.30 /usr/share/perl5
/usr/lib/x86_64-linux-gnu/perl/5.30 /usr/share/perl/5.30
/usr/local/lib/site_perl /etc/apache2) at (eval 885) line 1.
ERROR: '/opt/webwork/webwork2/htdocs/static-assets.json' not found!
You may need to run 'npm install' from '/opt/webwork/webwork2/htdocs'. at /opt/webwork/webwork2/lib/WeBWorK/Utils.pm line 1875.
Landing page errors:
ERROR: '/opt/webwork/webwork2/htdocs/static-assets.json' not found!
You may need to run 'npm install' from '/opt/webwork/webwork2/htdocs'. at /opt/webwork/webwork2/lib/WeBWorK/Utils.pm line 1875.