Due to renames of the website, the website build job broke. To fix it:
Workaround: a7.libelektra.org gets updates, but is only executed for master
Current status: https://build.libelektra.org/jenkins/job/elektra-website/721/console
+ kdb run-website-backend
terminate called after throwing an instance of 'cppcms::json::bad_value_cast'
what(): cppcms::json::bad_cast: Can't write undefined value to stream
Aborted
Build step 'Execute shell' marked build as failure
Most likely some configuration keys were (not) renamed.
There are already errors earlier in the log:
npm ERR! Linux 3.2.68-vs2.3.2.17-beng
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install" "--unsafe-perm"
npm ERR! node v6.14.1
npm ERR! npm v3.10.10
npm ERR! path /usr/local/elektra_backend/share/elektra/tool_data/website-frontend/node_modules/.staging/@types/prop-types-f494f49b
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall rename
npm ERR! enoent ENOENT: no such file or directory, rename '/usr/local/elektra_backend/share/elektra/tool_data/website-frontend/node_modules/.staging/@types/prop-types-f494f49b' -> '/usr/local/elektra_backend/share/elektra/tool_data/website-frontend/node_modules/nodeunit/node_modules/tap/node_modules/@types/prop-types'
npm ERR! enoent ENOENT: no such file or directory, rename '/usr/local/elektra_backend/share/elektra/tool_data/website-frontend/node_modules/.staging/@types/prop-types-f494f49b' -> '/usr/local/elektra_backend/share/elektra/tool_data/website-frontend/node_modules/nodeunit/node_modules/tap/node_modules/@types/prop-types'
npm ERR! enoent This is most likely not a problem with npm itself
npm ERR! enoent and is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! Please include the following file with any support request:
npm ERR! /usr/local/elektra_backend/share/elektra/tool_data/website-frontend/npm-debug.log
@Namoshek do you have any idea about this npm ERR?
/usr/local/elektra_backend/share/elektra/tool_data/website-frontend contains the data.
I wonder which place I forgot to rename (#2886) because in your scripts you actually used everywhere variables.
Doesn't seem like you forgot to rename anything, there is really good variable usage everywhere in the scripts. Only the documentation header is still the same. 馃槄
Can you grab and paste the npm-debug.log output? And did you simply rename the directory on the server or what did you do? Nginx config updated? Is there a package-lock.json on the server (according to a quick search, this seems to be a common issue... whyever)?
Thank you for the quick reply!
Can you grab and paste the npm-debug.log output?
It consists of many many ENOENT and ends with:
42096 verbose stack Error: ENOENT: no such file or directory, rename '/usr/local/elektra_backend/share/elektra/tool_data/website-frontend/node_modules/.staging/@types/prop-types-dbe1f68c' -> '/usr/local/elektra_backend/share/elektra/tool_data/website-frontend/node_modules/grunt-concat/node_modules/tap/node_modules/@types/prop-types'
42096 verbose stack at destStatted (/usr/lib/node_modules/npm/lib/install/action/finalize.js:25:7)
42096 verbose stack at /usr/lib/node_modules/npm/node_modules/graceful-fs/polyfills.js:264:29
42096 verbose stack at FSReqWrap.oncomplete (fs.js:123:15)
42096 verbose stack
42096 verbose stack Error: ENOENT: no such file or directory, rename '/usr/local/elektra_backend/share/elektra/tool_data/website-frontend/node_modules/.staging/@types/prop-types-dbe1f68c' -> '/usr/local/elektra_backend/share/elektra/tool_data/website-frontend/node_modules/grunt-concat/node_modules/tap/node_modules/@types/prop-types'
42096 verbose stack at Error (native)
42097 verbose cwd /usr/local/elektra_backend/share/elektra/tool_data/website-frontend
42098 error Linux 3.2.68-vs2.3.2.17-beng
42099 error argv "/usr/bin/node" "/usr/bin/npm" "install" "--unsafe-perm"
42100 error node v6.14.1
42101 error npm v3.10.10
42102 error path /usr/local/elektra_backend/share/elektra/tool_data/website-frontend/node_modules/.staging/@types/prop-types-dbe1f68c
42103 error code ENOENT
42104 error errno -2
42105 error syscall rename
42106 error enoent ENOENT: no such file or directory, rename '/usr/local/elektra_backend/share/elektra/tool_data/website-frontend/node_modules/.staging/@types/prop-types-dbe1f68c' -> '/usr/local/elektra_backend/share/elektra/tool_data/website-frontend/node_modules/grunt-concat/node_modules/tap/node_modules/@types/prop-types'
42107 error enoent ENOENT: no such file or directory, rename '/usr/local/elektra_backend/share/elektra/tool_data/website-frontend/node_modules/.staging/@types/prop-types-dbe1f68c' -> '/usr/local/elektra_backend/share/elektra/tool_data/website-frontend/node_modules/grunt-concat/node_modules/tap/node_modules/@types/prop-types'
42107 error enoent This is most likely not a problem with npm itself
42107 error enoent and is related to npm not being able to find a file.
42108 verbose exit [ -2, true ]
And did you simply rename the directory on the server or what did you do?
Until now I mostly did changes in the source directory (and in the build job, I renamed it from elektra-homepage to elektra-website).
Nginx config updated?
Not yet, as the installation failed much earlier.
Is there a package-lock.json on the server (according to a quick search, this seems to be a common issue... whyever)?
At least not at the installation path.
We removed everything in the beginning of the deployment script, so this should not be the issue.
Hm ok, the logs are not quite helpful. If the install directory is a new one, I don't see where our scripts can fail. So I suspect an issue with npm which did not occur previously due to some caching maybe.
The node and npm versions on the server are quite old. Latest LTS version of node is 10.16.3 with npm version 6.9.0 included. We are still on 6.14.1 (node) / 3.10.10 (npm). So I would start with an update of those if no other software prevents an update.
With newer npm it fails with different errors.
2019-08-18T19_24_08_690Z-debug.log
I now added a redirect page to a7.libelektra.org (unfortunately there is an quite old version and the https certificate is outdated)
Seems like an issue with concurrent reads and writes. Can you try to raise the limit with ulimit -n 20000 or some other limit higher than the current one and rerun the build?
Thank you that did it for my local installation! I now have built it locally and copied it to the webserver. Build job is disabled.
It is still open why it does not build on the build server but it seems like it is not due to the rename, otherwise I could not have built it locally?
I now try with purged npm cache (removed ~/.npm) and if it does not work I will upgrade nodejs/npm (and maybe the whole distro, too).
Most helpful comment
Seems like an issue with concurrent reads and writes. Can you try to raise the limit with
ulimit -n 20000or some other limit higher than the current one and rerun the build?