# Mender server 3.2: container deviceauth and useradm continuously restarting

**URL:** https://hub.mender.io/t/mender-server-3-2-container-deviceauth-and-useradm-continuously-restarting/5000
**Category:** General Discussions
**Tags:** mender-server
**Created:** [June 4, 2022, 6:58am UTC](https://hub.mender.io/t/mender-server-3-2-container-deviceauth-and-useradm-continuously-restarting/5000 "2022-06-04T06:58:07Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![joelguittet](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/joelguittet/32/1064_2.png) [@joelguittet](https://hub.mender.io/u/joelguittet)
#### Post date: [June 4, 2022, 6:58am UTC](https://hub.mender.io/t/mender-server-3-2-container-deviceauth-and-useradm-continuously-restarting/5000/1 "2022-06-04T06:58:07Z")

</div>

Hello,

I’m trying to setup a fresh installation of mender-server locally (this is done on a virtual machine hosted on Synology NAS, running ubuntu 22.04).

Currently I reach point where I should now create the first user, but it fails with the following mezssage:

> Error response from daemon: Container fb358b941c74205413d938ed65e2f037e1f08dd27f9fc828aa2e239152731032 is restarting, wait until the container is running

I have checked docker containers and deviceauth + useradm are continusouly restarting. Checking the logs give me the following error:

time=“2022-06-04T06:56:20Z” level=info msg=“User Administration Service starting up” file=main.go func=main.runServer line=155  
time=“2022-06-04T06:56:20Z” level=info msg=“running migrations in single tenant mode” file=migrations.go func=“mongo.(\*DataStoreMongo).Migrate” line=82  
time=“2022-06-04T06:56:20Z” level=info msg=“automigrate is ON, will apply migrations” file=migrations.go func=“mongo.(\*DataStoreMongo).Migrate” line=86  
time=“2022-06-04T06:56:20Z” level=info msg=“migrating useradm” file=migrations.go func=“mongo.(\*DataStoreMongo).Migrate” line=92  
time=“2022-06-04T06:56:20Z” level=info msg=“migration to version 1.0.0 skipped” db=useradm file=migrator\_simple.go func=“migrate.(\*SimpleMigrator).Apply” line=125  
time=“2022-06-04T06:56:20Z” level=info msg=“migration to version 1.1.4 skipped” db=useradm file=migrator\_simple.go func=“migrate.(\*SimpleMigrator).Apply” line=125  
time=“2022-06-04T06:56:20Z” level=info msg=“DB migrated to version 1.1.4” db=useradm file=migrator\_simple.go func=“migrate.(\*SimpleMigrator).Apply” line=140  
failed to read rsa private key: unknown server private key type; got: PRIVATE KEY, want: RSA PRIVATE KEY

What I have done wrong ? I have just followed the procedure at [https://docs.mender.io/3.2/server-installation/installation-with-docker-compose](https://docs.mender.io/3.2/server-installation/installation-with-docker-compose) but I suspect something need to be changed on keygen part.

Thanks for the feedbacks !

Joel

EDIT: it seems this can be due to newer version of openssl: [ssl - How to convert a private key to an RSA private key? - Stack Overflow](https://stackoverflow.com/questions/17733536/how-to-convert-a-private-key-to-an-rsa-private-key) can you confirm on mender side ? 🙂

---

<div class="post-metadata">

### Author: ![pedromiguel.sanchez](https://avatars.discourse-cdn.com/v4/letter/p/a88e4f/32.png) [@pedromiguel.sanchez](https://hub.mender.io/u/pedromiguel.sanchez)
#### Post date: [June 16, 2022, 9:08pm UTC](https://hub.mender.io/t/mender-server-3-2-container-deviceauth-and-useradm-continuously-restarting/5000/2 "2022-06-16T21:08:16Z")

</div>

Hi, I am facing the same problem with the latest version of mender server

It seems that the command  
`openssl rsa -in $FILE_NAME_PRIVATE_KEY -out $FILE_NAME_PRIVATE_KEY`

is no longer converting the keys to RSA format. This issue is mentioned in the key generation script but it seems that the command is no longer working:

```auto
# convert to RSA private key format, otherwise services complain:"
# level=fatal msg="failed to read rsa private key: jwt: can't open key - not an rsa private key" file=proc.go func=runtime.main line=183
openssl rsa -in $FILE_NAME_PRIVATE_KEY -out $FILE_NAME_PRIVATE_KEY

```

---

<div class="post-metadata">

### Author: ![pedromiguel.sanchez](https://avatars.discourse-cdn.com/v4/letter/p/a88e4f/32.png) [@pedromiguel.sanchez](https://hub.mender.io/u/pedromiguel.sanchez)
#### Post date: [June 17, 2022, 11:09am UTC](https://hub.mender.io/t/mender-server-3-2-container-deviceauth-and-useradm-continuously-restarting/5000/3 "2022-06-17T11:09:19Z")

</div>

Hi again, @joelguittet ,  
The problem is solved by adding “-traditional” option to the command so it looks like:

`openssl rsa -in $FILE_NAME_PRIVATE_KEY -out $FILE_NAME_PRIVATE_KEY -traditional`

---

<div class="post-metadata">

### Author: ![joelguittet](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/joelguittet/32/1064_2.png) [@joelguittet](https://hub.mender.io/u/joelguittet)
#### Post date: [June 19, 2022, 10:11am UTC](https://hub.mender.io/t/mender-server-3-2-container-deviceauth-and-useradm-continuously-restarting/5000/4 "2022-06-19T10:11:38Z")

</div>

Hello @pedromiguel.sanchez  
Thanks for the advice, will test on my side and report here !  
Joel

---

<div class="post-metadata">

### Author: ![joelguittet](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/joelguittet/32/1064_2.png) [@joelguittet](https://hub.mender.io/u/joelguittet)
#### Post date: [June 22, 2022, 9:38pm UTC](https://hub.mender.io/t/mender-server-3-2-container-deviceauth-and-useradm-continuously-restarting/5000/5 "2022-06-22T21:38:54Z")

</div>

Hello,  
The above solution fix the issue for me too.  
For information openssl version on ubuntu 22.04 is 3.0.2 actually.  
Joel

---

<div class="post-metadata">

### Author: ![petermilani80](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/petermilani80/32/1863_2.png) [@petermilani80](https://hub.mender.io/u/petermilani80)
#### Post date: [March 30, 2023, 5:02am UTC](https://hub.mender.io/t/mender-server-3-2-container-deviceauth-and-useradm-continuously-restarting/5000/6 "2023-03-30T05:02:07Z")

</div>

Also if you cant use the `-traditional` flag as your system is older than 22.04, you can edit the

mender-server/production/keys-generated/cert/private.key

and add `RSA` so that the headers reads `BEGIN RSA PRIVATE KEY` and ends with `END RSA PRIVATE KEY`
