apostrophe icon indicating copy to clipboard operation
apostrophe copied to clipboard

error adding first user admin

Open suman313 opened this issue 1 year ago • 7 comments

I am use Ubuntu 22.04.1 LTS. After following all the instruction I am getting this error while creating an admin-level user when I run this command: node app @apostrophecms/user:add suman313 admin

the error: suman313@DESKTOP-J22AUU3:/mnt/d/gitHubProjects/apostropheCMS/apos-app$ node app @apostrophecms/user:add suman313 admin MongoServerSelectionError: connect ECONNREFUSED 127.0.0.1:27017 at Timeout._onTimeout (/mnt/d/gitHubProjects/apostropheCMS/apos-app/node_modules/mongodb/lib/core/sdam/topology.js:438:30) at listOnTimeout (node:internal/timers:559:17) at processTimers (node:internal/timers:502:7) { reason: TopologyDescription { type: 'Single', setName: null, maxSetVersion: null, maxElectionId: null, servers: Map(1) { '127.0.0.1:27017' => [ServerDescription] }, stale: false, compatible: true, compatibilityError: null, logicalSessionTimeoutMinutes: null, heartbeatFrequencyMS: 10000, localThresholdMS: 15, commonWireVersion: null } }

Can anyone tell me what is wrong in this. The installation of this project is very complex. Takes so much time.

suman313 avatar Apr 29 '23 16:04 suman313

It looks like your MongoDB server isn't running. Therefore Apostrophe can't save the admin to the database. If you try: sudo systemctl status mongod what do you get back?

BoDonkey avatar Apr 30 '23 09:04 BoDonkey

@suman313 Yeah it looks the issue you are facing is timeout error when apostrophe trying to connect to mongodb server. Therefore make sure mongodb server is running and credentials are correct.

probiruk avatar Apr 30 '23 14:04 probiruk

It looks like your MongoDB server isn't running. Therefore Apostrophe can't save the admin to the database. If you try: sudo systemctl status mongod what do you get back?

I get back this: System has not been booted with systemd as init system (PID 1). Can't operate. Failed to connect to bus: Host is down

Actually when I run m 5.0, I get this: `mongod: error while loading shared libraries: libcrypto.so.1.1: cannot open shared object file: No such file or directory mongod: error while loading shared libraries: libcrypto.so.1.1: cannot open shared object file: No such file or directory

Checking for stable release of MongoDB 5.0

Activating: MongoDB Server 5.0.17, MongoDB Database Tools 100.7.0

Installation to /home/suman313/.local/bin complete!`

Is this an issue?

suman313 avatar May 01 '23 06:05 suman313

Based on that I think you might be trying to run this in a docker container without standing up a mongodb server for it to talk to as well.

On Mon, May 1, 2023 at 2:34 AM Suman Modak @.***> wrote:

It looks like your MongoDB server isn't running. Therefore Apostrophe can't save the admin to the database. If you try: sudo systemctl status mongod what do you get back?

I get back this: System has not been booted with systemd as init system (PID 1). Can't operate. Failed to connect to bus: Host is down

— Reply to this email directly, view it on GitHub https://github.com/apostrophecms/apostrophe/issues/4146#issuecomment-1529403397, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAH27I247LOKYCCCBLGW2DXD5KPBANCNFSM6AAAAAAXQKJBBQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>

--

THOMAS BOUTELL | CHIEF TECHNOLOGY OFFICER APOSTROPHECMS | apostrophecms.com | he/him/his

boutell avatar May 01 '23 14:05 boutell

Based on that I think you might be trying to run this in a docker container without standing up a mongodb server for it to talk to as well. On Mon, May 1, 2023 at 2:34 AM Suman Modak @.> wrote: It looks like your MongoDB server isn't running. Therefore Apostrophe can't save the admin to the database. If you try: sudo systemctl status mongod what do you get back? I get back this: System has not been booted with systemd as init system (PID 1). Can't operate. Failed to connect to bus: Host is down — Reply to this email directly, view it on GitHub <#4146 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAH27I247LOKYCCCBLGW2DXD5KPBANCNFSM6AAAAAAXQKJBBQ . You are receiving this because you are subscribed to this thread.Message ID: @.> -- THOMAS BOUTELL | CHIEF TECHNOLOGY OFFICER APOSTROPHECMS | apostrophecms.com | he/him/his

Thanks a lot for your reply. But I think this is not an issue. I am inside Ubuntu and not in a docker container. image I have followed every step as it is from the documentation. I will try to do the same again and update here my progress. Thank you.

suman313 avatar May 01 '23 18:05 suman313

Make sure that you are doing the m install and running the mongod command from within wsl.

BoDonkey avatar May 01 '23 18:05 BoDonkey

OK, so you are using WSL, which also does not use systemd. This is why Bob's suggested command did not work for you.

Our developer guide for Windows recommends using the "m" utility to set up mongod and then manually start it and leave it running for Apostrophe to talk to while you are working. Did you do that as described here?

https://v3.docs.apostrophecms.org/cookbook/windows-development.html

There are other ways to install and start up mongodb, we can help you most easily if you follow the path we've given here, but the important thing is that mongodb must be running in order for Apostrophe to talk to it. Just like firing up mysql for Wordpress to talk to.

On Mon, May 1, 2023 at 2:50 PM Robert Means @.***> wrote:

Make sure that you are doing the m install and running the mongod command from within wsl.

— Reply to this email directly, view it on GitHub https://github.com/apostrophecms/apostrophe/issues/4146#issuecomment-1530067934, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAH27IE3RXU2QPXEY6KSP3XEAAWXANCNFSM6AAAAAAXQKJBBQ . You are receiving this because you commented.Message ID: @.***>

--

THOMAS BOUTELL | CHIEF TECHNOLOGY OFFICER APOSTROPHECMS | apostrophecms.com | he/him/his

boutell avatar May 01 '23 19:05 boutell