Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Admin Account Creation #29855

Closed
WhiteTiburon opened this issue Jul 18, 2023 · 11 comments · Fixed by #30015
Closed

Admin Account Creation #29855

WhiteTiburon opened this issue Jul 18, 2023 · 11 comments · Fixed by #30015

Comments

@WhiteTiburon
Copy link

Description:

I am attempting to create an Initial user via the compose file following https://docs.rocket.chat/setup-and-configure/accessing-your-workspace/creating-the-first-administrator and I get a

=== UnHandledPromiseRejection ===
errorClass [Error]: Match error: Expected string, got object
at check (packages/check/match.js:36:17)
at packages/accounts-password/password_server.js:324:3

It leads back to the password not being sent as a string. However, I made sure to make the password a string and still get the same error.

Steps to reproduce:

  1. add variables to compose file
  2. run compose file via docker-compose up -d

Expected behavior:

Creates user and I am able to log in.

Actual behavior:

I get this error in the logs:

Inserting admin user:
Name: Administrator
Email: [email protected]
Username: Jon
=== UnHandledPromiseRejection ===
errorClass [Error]: Match error: Expected string, got object
at check (packages/check/match.js:36:17)
at packages/accounts-password/password_server.js:324:3
at /app/bundle/programs/server/npm/node_modules/meteor/promise/node_modules/meteor-promise/fiber_pool.js:43:40
=> awaited here:
at Function.Promise.await (/app/bundle/programs/server/npm/node_modules/meteor/promise/node_modules/meteor-promise/promise_server.js:56:12)
at server/startup/initialData.js:122:4
at /app/bundle/programs/server/npm/node_modules/meteor/promise/node_modules/meteor-promise/fiber_pool.js:43:40 {
path: '',
sanitizedError: errorClass [Error]: Match failed [400]
at errorClass. (packages/check/match.js:91:27)
at new errorClass (packages/meteor.js:692:17)
at check (packages/check/match.js:36:17)
at packages/accounts-password/password_server.js:324:3
at /app/bundle/programs/server/npm/node_modules/meteor/promise/node_modules/meteor-promise/fiber_pool.js:43:40 {
isClientSafe: true,
error: 400,
reason: 'Match failed',
details: undefined,
errorType: 'Meteor.Error'
},
errorType: 'Match.Error'
}

Here is what I added to the compose file:

ADMIN_USERNAME: test
ADMIN_PASS: "password"
ADMIN_EMAIL: [email protected]

Screenshot 2023-07-18 at 11 00 17 AM
Screenshot 2023-07-18 at 11 00 59 AM

Server Setup Information:

| Rocket.Chat Version: 6.2.0
| NodeJS Version: 14.21.2 - x64
| MongoDB Version: 5.0.18
| MongoDB Engine: wiredTiger
| Platform: linux
| Process Port: 5182
| Site URL: http://localhost:5182
| ReplicaSet OpLog: Enabled
| Commit Hash: d918834
| Commit Branch: HEAD

Relevant logs:

@hugocostadev
Copy link
Contributor

Did you tried to create the admin thought the Setup Wizard step? It's easier and the most common flow that users do


Questions? Help needed? Feature Requests?

@Dnouv
Copy link
Member

Dnouv commented Jul 23, 2023

Hey @WhiteTiburon

I am unsure of the exact format you used for the compose file. But could you please try this (notice the no quotes around the password):

environment:
      - ADMIN_USERNAME=test
      - ADMIN_PASS=password
      - [email protected]

Thank you!

@WhiteTiburon
Copy link
Author

@Dnouv I used version 3 formatting. I tried what you suggested originally and I got the same error. Also, tried it again to make sure and same error. Receiving an object instead of a string.

@WhiteTiburon
Copy link
Author

Yea, but want to avoid that step.

@debdutdeb
Copy link
Member

we have a bug here

@debdutdeb
Copy link
Member

debdutdeb commented Jul 25, 2023

image

setPasswordAsync(id.insertedId, ['admin'])
// file: initialData.js

@WhiteTiburon
Copy link
Author

image

setPasswordAsync(id.insertedId, ['admin'])
// file: initialData.js

What should I do?

btison added a commit to btison/cloud-architecture-workshop-helm that referenced this issue Aug 2, 2023
@engelgabriel
Copy link
Member

Looks like a simple bug to fix. @debdutdeb can you provide a pull request?

@engelgabriel
Copy link
Member

engelgabriel commented Aug 3, 2023

Did you tried to create the admin thought the Setup Wizard step? It's easier and the most common flow that users do

@hugocostadev This suggestions does not solve the problem. The admin creating automation via environment variable needs to work. We must fix the bug.

@lamberms
Copy link

lamberms commented Aug 4, 2023

I am having the same issues with the newest docker container. For my use case this is necessary as my system comes up fresh every run with Docker volumes wiped. We can (with pain) get around it for now by setting up the first user every time we run.

@WhiteTiburon
Copy link
Author

Since it is being merged to develop does this mean the fix will not be included in 6.2.10?

@kodiakhq kodiakhq bot closed this as completed in #30015 Aug 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants