Skip to content
This repository has been archived by the owner on Feb 8, 2024. It is now read-only.

User is not being created by 10-postal #3

Open
rbozan opened this issue Oct 25, 2020 · 3 comments
Open

User is not being created by 10-postal #3

rbozan opened this issue Oct 25, 2020 · 3 comments

Comments

@rbozan
Copy link

rbozan commented Oct 25, 2020

An user is not being created (nothing in the users table in the database) even though I can see the following in the console:

postal-app          | [WARN] ** [container] RabbitMQ Host 'postal-rabbitmq' is not accessible, retrying.. (20 seconds so far)
postal-app          | [NOTICE] ** [container] Configuring Postal
postal-app          | [WARN] ** [container] Detecting new Install. Initializing Database
postal-clamav       | Sun Oct 25 13:12:06 2020 -> Database test passed.
postal-clamav       | Sun Oct 25 13:12:06 2020 -> daily.cvd updated (version: 25967, sigs: 4335099, f-level: 63, builder: raynman)
postal-clamav       | Sun Oct 25 13:12:06 2020 -> main database available for download (remote version: 59)
postal-clamav       | Sun Oct 25 13:12:13 2020 -> Testing database: '/data/definitions//tmp.2e52b2ad9a/clamav-03931e9d0f42251e955663d0921e269e.tmp-main.cvd' ...
postal-app          | [NOTICE] ** [container] Creating Administrative User
postal-app          | [WARN] ** [container] No Admin Email entered, setting default email login to '[email protected]'
postal-app          | [WARN] ** [container] WARNING: No Admin Pass entered, setting default password to 'postal'
postal-app          | [WARN] ** [container] No Admin First Name entered, setting default to 'Postal'
postal-app          | [WARN] ** [container] No Admin Last Name entered, setting default to 'Admin'
postal-clamav       | Sun Oct 25 13:12:27 2020 -> Database test passed.
postal-clamav       | Sun Oct 25 13:12:27 2020 -> main.cvd updated (version: 59, sigs: 4564902, f-level: 60, builder: sigmgr)
postal-clamav       | Sun Oct 25 13:12:27 2020 -> bytecode database available for download (remote version: 331)
postal-clamav       | Sun Oct 25 13:12:27 2020 -> Testing database: '/data/definitions//tmp.2e52b2ad9a/clamav-6fe8d96b89f9b01c332090ecd21ada9f.tmp-bytecode.cvd' ...
postal-clamav       | Sun Oct 25 13:12:27 2020 -> Database test passed.
postal-clamav       | Sun Oct 25 13:12:27 2020 -> bytecode.cvd updated (version: 331, sigs: 94, f-level: 63, builder: anvilleg)
postal-clamav       | [INFO] ** [clamav] Container Initialization Complete
postal-clamav       | [cont-init.d] 10-clamd: exited 0.
postal-clamav       | [cont-init.d] 99-container: executing... 
postal-clamav       | [cont-init.d] 99-container: exited 0.
postal-clamav       | [cont-init.d] done.
postal-clamav       | [services.d] starting services
postal-clamav       | [services.d] done.
postal-clamav       | [INFO] ** [zabbix] Starting Zabbix Agent
postal-clamav       | [INFO] ** [clamav] Starting ClamAV
postal-clamav       | [NOTICE] ** [freshclam] Definitions Updating Routines Initialized on Sun Oct 25 13:12:38 GMT 2020
postal-clamav       | [INFO] ** [freshclam] Downloading Latest Definitions
postal-app          | [cont-init.d] 10-postal: exited 0.
postal-app          | [cont-init.d] 99-container: executing... 
postal-app          | [cont-init.d] 99-container: exited 0.
postal-app          | [cont-init.d] done.
postal-app          | [services.d] starting services
postal-app          | [services.d] done.
postal-app          | [INFO] ** [zabbix] Starting Zabbix Agent
postal-app          | [INFO] ** [container] Starting postal
postal-app          | Started Procodile supervisor with PID 1101
postal-app          | Procodile Version   1.0.26
postal-app          | Application Root    /app
postal-app          | Supervisor PID      1101
postal-app          | Started             2020-10-25 13:13:10 +0000

However, using docker exec -it bash and afterwards running /app/bin/postal make-user actually works fine.

If it makes a difference: it does create an user on my local Fedora 33 machine, but does not on a machine running Fedora CoreOS Stable which is remotely accessed with docker context.

@tiredofit
Copy link
Owner

Interesting. I will look into in a few days and see where the breakage is.

@rbozan rbozan changed the title User is not being created by 10-postal.sh User is not being created by 10-postal Oct 25, 2020
@VeselaHouba
Copy link

The expect script is fine, just checked by disabling delete of file

  # rm -rf /tmp/create-pass.sh

and after container is up

docker exec -ti postal_app_1 /usr/bin/with-contenv /tmp/create-pass.sh

spawn /usr/bin/with-contenv bash /app/bin/postal make-user
No secret key was specified in the Postal config file. Using one for just this session
Postal User Creator
Enter the information required to create a new Postal user.
This tool is usually only used to create your initial admin user.

E-Mail Address      : [email protected]
First Name          : Admin
Last Name           : Admin
Initial Password:   : ********************

User has been created with e-mail address [email protected]

I tried adding some sleep time before script, to let postal start all its services before creating user, but no luck.
Maybe decoupling db initialisation and creating user as asynchronous task could help?

Of course it would be much better if guys from postalhq could implement non-interactive user creation postalserver/postal#145

@VeselaHouba
Copy link

Looks like they won't, postalserver/postal#145 was just closed with no follow-up. :(

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants