Closed jbrun001 closed 7 months ago
database successfully imported to uni server
git set up and code pulled from git to uni servers
Problem with bcyrpt npm install on uni servers. Likely to do with versions being out of date. Under review. Various solutions found online. One is to upgrade the version of ubuntu - I'd rather avoid that with it being end of term Another is to uninstall node and re-install it using nvm - this I might try. npm ERR! code 1 npm ERR! path /home/jbrun001/project/roombooking/node_modules/bcrypt npm ERR! command failed npm ERR! command sh /tmp/install-9d46bc39.sh npm ERR! node: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.28' not found (required by node)
31/03 update from research into Issue #47 https://github.com/nodesource/distributions/issues/1392 which details the issue. node 18 was compiled on a later version of ubutu and even though it doesn't need GLIBC_2.28 because it was orginally compiled on a machine that had it, it means that you have to have it to run it. only ubuntu 20 has this library.
Attempted to upgrade ubuntu from 18.04 to 20.04.
After a research here are the steps that were taken
sudo apt update
sudo apt upgrade
sudo apt get screen
screen -S ubuntu-upgrade
sudo do-release-upgrade
-- Yes to are you sure you want to do this over SSH
-- enter
-- upgrade failed due to lack of space
-- upgrade rolled back automaticallyRemaining options in action order:
The developer environment is using v18.18.1 but this is not available on ubuntu 18.04.x
PS D:\Yr02 Computing Project\git\roombooking> node -v
v18.18.1
Current versions:
jbrun001@doc215:~$ nvm -v
0.39.5
jbrun001@doc215:~$ node -v
v16.17.0
jbrun001@doc215:~$ npm -v
8.15.0
jbrun001@doc215:~$ hostnamectl
Static hostname: doc215
Icon name: computer-vm
Chassis: vm
Machine ID: 78d7d469d6b892d474201e4c38b0473b
Boot ID: 2e58b7ff709945488d25f1df778a4124
Virtualization: kvm
Operating System: Ubuntu 18.04.6 LTS
Kernel: Linux 4.15.0-163-generic
jbrun001@doc215:~$ x86-64
jbrun001@doc215:~$ df -h
Filesystem Size Used Avail Use% Mounted on
udev 217M 0 217M 0% /dev
tmpfs 49M 688K 48M 2% /run
/dev/mapper/vg-root 3.5G 3.3G 74M 98% /
tmpfs 241M 0 241M 0% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 241M 0 241M 0% /sys/fs/cgroup
/dev/vda1 461M 123M 315M 28% /boot
tmpfs 49M 0 49M 0% /run/user/1000
jbrun001@doc215:~$
Find out what version of GLIBC is installed on GS server
jbrun001@doc215:~$ ldd --version
dd (Ubuntu GLIBC 2.27-3ubuntu1.6) 2.27
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Written by Roland McGrath and Ulrich Drepper.
jbrun001@doc215:~$
find out what versions of node are already installed (not the currently used one but any that are installed)
jbrun001@doc215:~$ nvm ls
-> v16.17.0
system
default -> v16.17.0
iojs -> N/A (default)
unstable -> N/A (default)
node -> stable (-> v16.17.0) (default)
stable -> 16.17 (-> v16.17.0) (default)
lts/* -> lts/hydrogen (-> N/A)
lts/argon -> v4.9.1 (-> N/A)
lts/boron -> v6.17.1 (-> N/A)
lts/carbon -> v8.17.0 (-> N/A)
lts/dubnium -> v10.24.1 (-> N/A)
lts/erbium -> v12.22.12 (-> N/A)
lts/fermium -> v14.21.3 (-> N/A)
lts/gallium -> v16.20.2 (-> N/A)
lts/hydrogen -> v18.18.0 (-> N/A)
jbrun001@doc215:~$
So we have 2.27 GLIBC and node 16.17.0
Try installing node 16.15.1 via nvm - keeping the existing version in place so we can go back to it if needed
jbrun001@doc215:~$ nvm install 16.15.1
This results in not enough space errors. examples are
deps/openssl: Cannot mkdir: No space left on device
/lib Cannot mkdir: No space left on device
From what I can tell it's not meant to be installing node in /lib etc. it's meant to be installing it in /home/jbrun001. It looks like the "system" version of node is what's installed. This is very strange because in my forum assignment I used bcrypt and it installed ok. Could this be because the package.json specifies a specific version of bcrypt that needs to be loaded, and this version is one the only works against 2.28. Because the package.json and the package.lock are in git they get synced to the GS server and then when npm install bcrypt it automatically gets the version in the package.json and not the one that's compatiable with the current version of node?
Disconnecting the tracking for package.json and package.json.lock
from the roombooking folder which is synced with git locally in the terminal window of vscode
git rm --cached package.json
git rm --cached package-lock.json
.gitignore added:
# package files - these can be re-created if needed on a new install with npm init
# and then running the npm install (all the modules here) part of the readme.md
package.json
package.json.lock
This resulted in package.json and package.json.lock remaining on my local system.
package-json.lock seems to still be in git (not ok) but package.json isn't on the server (thats ok)
ok error is that the file name is wrong in git ignore
changed to:
# package files - these can be re-created if needed on a new install with npm init
# and then running the npm install (all the modules here) part of the readme.md
package.json
package-lock.json
Now everything is as expected.
I have taken a local backup of the two files in case this causes anyone a problem.
GS virtual myserver servers are not accessible at the moment:
Looks like DNS lookup issue internally from doc.gold.ac.uk to myserver.doc.gold.ac.uk
and also DNS lookup on doc.gold.ac.uk.
The proxy server received an invalid response from an upstream server.
The proxy server could not handle the request
Reason: DNS lookup failure for: myserver.doc.gold.ac.uk
Apache/2.4.41 (Ubuntu) Server at www.doc.gold.ac.uk Port 443
doc.gold.ac.uk failing tracert
tracert doc.gold.ac.uk
Tracing route to doc.gold.ac.uk [158.223.1.108]
over a maximum of 30 hops:
...
4 8 ms 13 ms 9 ms 128.hiper04.sheff.dial.plus.net.uk [195.166.143.128]
5 7 ms 10 ms 10 ms peer7-et-3-0-1.telehouse.ukcore.bt.net [109.159.252.152]
6 8 ms 13 ms 5 ms linx-gw1.ja.net [195.66.224.15]
7 13 ms 7 ms 9 ms ae23.londtt-sbr1.ja.net [146.97.35.169]
8 11 ms 5 ms 6 ms ae28.londtw-sbr2.ja.net [146.97.33.62]
9 7 ms 7 ms 7 ms ae26.londtw-ban1.ja.net [146.97.35.218]
10 16 ms 6 ms 6 ms 146.97.141.21
11 * * * Request timed out.
12 * * * Request timed out.
13 * * * Request timed out.
Can't do any more until this is resolved. Might be maintenance affecting the servers. going in to create a new server might have the same issue.
servers back up. I'll go in on Tuesday. The two failed upgrade attempts are
taking up all the space in /tmp.. So will need to create a new virtual server.
but I can't delete them because I'm not root and I can't sudo.
drwx------ 8 root root 4096 Mar 23 12:34 ubuntu-release-upgrader-i3kp8mlm
drwx------ 8 root root 4096 Mar 23 12:16 ubuntu-release-upgrader-qt5x732_
After a lot of false starts I've got it running on Ubuntu18. I had to delete the machine and start over. I tried ubuntu20 but uni hasn't allocated enough space on that for even just the apt installs we need.
You will see that it doesn't format a the moment and you can't get past the login page. Formatting is simple - it's just that the style.css isn't being picked up by unix but it works on windows so that's just putting more of a path in. The form won't submit because of the security settings I think, so I will look at putting a switch in for these tomorrow.
Note that this is a copy of the database from planetscale. I can switch it to point at planetscale, but at the moment it's how it will be when we submit.
The issue was that we had a package.json in git. (not a bad thing). That contains the versions and dependencies, so when it was git pulled to the uni server and I tried to npm install, it tried to load the exact version of the packages in the package.json (which work in the dev environment) and not the ones that would work with ubuntu18. The process of trying to fix filled up the server. Solution was.
This means that the uni server might not be using exactly the same packages as we use when we're developing, except for tinymce where the actual version is specified in the npm install
Uni package.json for reference
"dependencies": {
"bcrypt": "^5.1.1",
"body-parser": "^1.20.2",
"cookie-parser": "^1.4.6",
"dotenv": "^16.4.5",
"ejs": "^3.1.9",
"express": "^4.19.2",
"express-session": "^1.18.0"
,
"morgan": "^1.10.0",
"multer": "^1.4.5-lts.1",
"mysql2": "^3.9.3",
"path": "^0.12.7",
"qrcode": "^1.5.3",
"sanitize-html": "^2.13.0",
"speakeasy": "^2.0.0",
"tinymce": "^6.8.3"
Investigated cloud services that were free or had trials for the period of review for the project. A cloud service helps the development process, it means that all developers can access the database at the same time and they can work locally on the code, only needing to push source changes to github. Other cloud offerings are available - for example google cloud offers $300 worth of free hosting for 90 days. However this may require re-work of the connection code for the database but also all the file storage code, because google apps only use google drive for file storage, not filesystem storage. With the deadline approaching the sensible thing to do is to host with GS for the app and the database. Prove this works. This means there is a working solution in place. This is a better option at this point than trying to re-implement on a cloud platform which has no guarantees in the timeframe. Hosting at GS means that testing becomes very hard for the development team. So I propose that the development continues on the development platform planetscale.