YunoHost-Apps / rocketchat_ynh

Rocket.Chat package for YunoHost
https://rocket.chat/
GNU General Public License v3.0
16 stars 22 forks source link

Installation script for non AVX supported CPUs #132

Closed KamuiX closed 2 years ago

KamuiX commented 2 years ago

My YunoHost server Hardware: An old rig with an Intel(R) Core™2 Duo CPU E8400 @ 3.00GHz, 8GB of RAM and 3x500GB in RAID 5 YunoHost version: 4.3.6.3 (stable) I have access to my server : SSH and Web

Description of my issue

I have opened a support request in Yunohost forums regarding this problem. https://forum.yunohost.org/t/rocket-chat-fails-to-install/20327. The Yunohost app fails to install because MongoDB 5.X crash on execution.

It seems that @Aleks was right and mongodb 5.X demands for a CPU with AVX support. We can check if our CPU has this technology using cat /proc/cpuinfo | grep flags | grep avx Thanks @Aleks once again.

So my idea...why not add the above check and dynamically change the mongoDB repos in _common.sh to version 4.4.15. Although this is not enougg and more changes have to be done in script.

--EDIT--

Manually installed mongodb 4.4.15 (Successfully) and run the install script without the mongodb install procedure. Everything were smooth and new application added in Yunohost. Although When I tried to access the app I got error.

First error was about a store.journal parameter in mongodb configuration, which I had to comment out. MongoDB started properly but not rocketchat. Initially the service starts correctly but after 1 minutes fails with error.

rocketchat[31148]: /var/www/rocketchat/programs/server/node_modules/fibers/future.js:313 rocketchat[31148]: throw(ex); rocketchat[31148]: ^ rocketchat[31148]: MongoServerSelectionError: Server selection timed out after 30000 ms rocketchat[31148]: at Timeout._onTimeout (/var/www/rocketchat/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/core/sdam/topology.js:437:30) rocketchat[31148]: at listOnTimeout (internal/timers.js:557:17) rocketchat[31148]: at processTimers (internal/timers.js:500:7) { rocketchat[31148]: reason: TopologyDescription { rocketchat[31148]: type: 'ReplicaSetNoPrimary', rocketchat[31148]: setName: null, rocketchat[31148]: maxSetVersion: null, rocketchat[31148]: maxElectionId: null, rocketchat[31148]: servers: Map(0) {}, rocketchat[31148]: stale: false, rocketchat[31148]: compatible: true, rocketchat[31148]: compatibilityError: null, rocketchat[31148]: logicalSessionTimeoutMinutes: null, rocketchat[31148]: heartbeatFrequencyMS: 10000, rocketchat[31148]: localThresholdMS: 15, rocketchat[31148]: commonWireVersion: 9 rocketchat[31148]: } rocketchat[31148]: }

and after some messing around got the below

rocketchat[2270]: /var/www/rocketchat/programs/server/node_modules/fibers/future.js:313 rocketchat[2270]: throw(ex); rocketchat[2270]: ^ rocketchat[2270]: MongoServerSelectionError: Server selection timed out after 30000 ms rocketchat[2270]: at Timeout._onTimeout (/var/www/rocketchat/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/core/sdam/topology rocketchat[2270]: at listOnTimeout (internal/timers.js:557:17) rocketchat[2270]: at processTimers (internal/timers.js:500:7) { rocketchat[2270]: reason: TopologyDescription { rocketchat[2270]: type: 'ReplicaSetNoPrimary', rocketchat[2270]: setName: null, rocketchat[2270]: maxSetVersion: null, rocketchat[2270]: maxElectionId: null, rocketchat[2270]: servers: Map(1) { rocketchat[2270]: 'localhost:27017' => ServerDescription { rocketchat[2270]: address: 'localhost:27017', rocketchat[2270]: error: undefined, rocketchat[2270]: roundTripTime: 16.84, rocketchat[2270]: lastUpdateTime: 107041052, rocketchat[2270]: lastWriteDate: null, rocketchat[2270]: opTime: null, rocketchat[2270]: type: 'RSGhost', rocketchat[2270]: topologyVersion: { rocketchat[2270]: processId: ObjectID { _bsontype: 'ObjectID', id: [Buffer [Uint8Array]] }, rocketchat[2270]: counter: 0 rocketchat[2270]: }, rocketchat[2270]: minWireVersion: 0, rocketchat[2270]: maxWireVersion: 9, rocketchat[2270]: maxBsonObjectSize: 16777216, rocketchat[2270]: maxMessageSizeBytes: 48000000, rocketchat[2270]: maxWriteBatchSize: 100000, rocketchat[2270]: hosts: [], rocketchat[2270]: passives: [], rocketchat[2270]: arbiters: [], rocketchat[2270]: tags: [], rocketchat[2270]: logicalSessionTimeoutMinutes: 30 rocketchat[2270]: } rocketchat[2270]: }, rocketchat[2270]: stale: false, rocketchat[2270]: compatible: true, rocketchat[2270]: compatibilityError: null, rocketchat[2270]: logicalSessionTimeoutMinutes: null, rocketchat[2270]: heartbeatFrequencyMS: 10000, rocketchat[2270]: localThresholdMS: 15, rocketchat[2270]: commonWireVersion: 9 rocketchat[2270]: } rocketchat[2270]: }

ericgaspar commented 2 years ago

You should be able to install mongodb with the testing version. sudo yunohost app install https://github.com/YunoHost-Apps/rocketchat_ynh/tree/testing

KamuiX commented 2 years ago

You should be able to install mongodb with the testing version. sudo yunohost app install https://github.com/YunoHost-Apps/rocketchat_ynh/tree/testing

oO thanks @ericgaspar! seems it has been requested already. Should I execute

echo "mongodb-org hold" \| sudo dpkg --set-selections echo "mongodb-org-server hold" \| sudo dpkg --set-selections echo "mongodb-org-shell hold" \| sudo dpkg --set-selections echo "mongodb-org-mongos hold" \| sudo dpkg --set-selections echo "mongodb-org-tools hold" \| sudo dpkg --set-selections

to protect the packages from update?

ericgaspar commented 2 years ago

I am not really sure we need this... (to be tested without I guess)

KamuiX commented 2 years ago

I am not really sure we need this... (to be tested without I guess)

Thanks once again. Installation was smooth and everything works out of the box. I had a problem with Admin password but I suppose my copy->paste in terminal somehow messed things up. I reset the password using mongosh and doing the below

use rocketchat db.getCollection('users').update({username:"<username you choose for admin>"}, { $set: {"services" : { "password" : {"bcrypt" : "$2a$10$n9CM8OgInDlwpvjLKLPML.eizXIzLlRtgCh3GRLafOdR9ldAUh/KG" } } } })

This will set admin pass to 12345 so don't forget to change it ASAP.

Regarding the packages @ericgaspar seems like they are not in the apt-mark showhold list although after checking on yunohost update packages there were no message to update mongodb to 5.X. Seems eveything is fine.