# 500 Internal Server Error

**URL:** <https://discourse.mailinabox.email/t/500-internal-server-error/475>\
**Category:** Help with Setup/Upgrade\
**Created:** [May 15, 2015, 3:58pm UTC](https://discourse.mailinabox.email/t/500-internal-server-error/475 "2015-05-15T15:58:58Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![Panther](https://discourse.mailinabox.email/letter_avatar_proxy/v4/letter/p/a698b9/32.png) [@Panther](https://discourse.mailinabox.email/u/Panther)\
**Post date:** [May 15, 2015, 3:58pm UTC](https://discourse.mailinabox.email/t/500-internal-server-error/475/1 "2015-05-15T15:58:58Z")

</div>

I’m trying to install mail-in-a-box on a OVH VPS using a custom DNS server. I’ve tried installed twice with a clean OS and am still receiving the same errors.

At the end of an install I receive this in the console, whether that’s normal or not I’m unsure.

[http://cl.panther.io/image/0L1d1t1s0m0w/3WKh4h7.png](http://cl.panther.io/image/0L1d1t1s0m0w/3WKh4h7.png)

Ignoring the above, I then try to add another user but then get slapped with another 500 error.

[http://cl.panther.io/image/2Y133A0K272E/kiLMZU1.png](http://cl.panther.io/image/2Y133A0K272E/kiLMZU1.png)

On top of that, when I want to create a SSL certificate. The CSR code doesn’t show up to allow me to create a certificate. Someone help? D:

[http://cl.panther.io/image/0T0B3X2A3C3P](http://cl.panther.io/image/0T0B3X2A3C3P)

---

<div class="post-metadata">

**Author:** ![JoshData](https://discourse.mailinabox.email/user_avatar/discourse.mailinabox.email/joshdata/32/2153_2.png) [@JoshData](https://discourse.mailinabox.email/u/JoshData)\
**Post date:** [May 16, 2015, 11:11am UTC](https://discourse.mailinabox.email/t/500-internal-server-error/475/2 "2015-05-16T11:11:04Z")

</div>

Something went very wrong.

Can you see if there’s anything helpful in `/var/log/syslog` when you try to access that part of the control panel?

---

<div class="post-metadata">

**Author:** ![Panther](https://discourse.mailinabox.email/letter_avatar_proxy/v4/letter/p/a698b9/32.png) [@Panther](https://discourse.mailinabox.email/u/Panther)\
**Post date:** [May 16, 2015, 11:32am UTC](https://discourse.mailinabox.email/t/500-internal-server-error/475/3 "2015-05-16T11:32:45Z")

</div>

I don’t think the log is showing anything helpful however I’m not great at understanding this very well. I’ve linked the log however it just shows a bunch of [UFW BLOCK]

[http://cl.panther.io/text/030F3l1E1B0Q](http://cl.panther.io/text/030F3l1E1B0Q)

---

<div class="post-metadata">

**Author:** ![JoshData](https://discourse.mailinabox.email/user_avatar/discourse.mailinabox.email/joshdata/32/2153_2.png) [@JoshData](https://discourse.mailinabox.email/u/JoshData)\
**Post date:** [May 16, 2015, 12:05pm UTC](https://discourse.mailinabox.email/t/500-internal-server-error/475/4 "2015-05-16T12:05:47Z")

</div>

Here’s the relevant part:

```
May 15 16:48:22 vps169738 Exception on /mail/users/add [POST]
Traceback (most recent call last):
...
File "/usr/local/bin/mailinabox-daemon", line 140, in mail_users_add
 return add_mail_user(request.form.get('email', ''), request.form.get('password', ''), request.form.get('privileges', ''), env) 
File "/root/mailinabox/management/mailconfig.py", line 311, in add_mail_user
 return kick(env, "mail user added") 
File "/root/mailinabox/management/mailconfig.py", line 559, in kick
 results.append( do_web_update(env) ) 
File "/root/mailinabox/management/web_update.py", line 46, in do_web_update
 nginx_conf += make_domain_config(domain, template1, template2, env) 
File "/root/mailinabox/management/web_update.py", line 79, in make_domain_config
 ensure_ssl_certificate_exists(domain, ssl_key, ssl_certificate, env) 
File "/root/mailinabox/management/web_update.py", line 205, in ensure_ssl_certificate_exists
 "-out", ssl_certificate]) 
File "/root/mailinabox/management/utils.py", line 149, in shell
 ret = getattr(subprocess, method)(cmd_args, **kwargs) 
File "/usr/lib/python3.4/subprocess.py", line 557, in check_call
 raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command '['openssl', 'x509', '-req', '-days', '365', '-in', '/tmp/tmpg1dhv0m7', '-signkey', '/home/user-data/ssl/ssl_private_key.pem', '-out', '/home/user-data/ssl/panther.io/ssl_certificate.pem']' returned non-zero exit status 1

```

This was actually reported once before but not solved: [https://github.com/mail-in-a-box/mailinabox/issues/277](https://github.com/mail-in-a-box/mailinabox/issues/277)

Could you run:

```
openssl x509 -req -days 365 -in /tmp/tmpg1dhv0m7 -signkey /home/user-data/ssl/ssl_private_key.pem -out /home/user-data/ssl/panther.io/ssl_certificate.pem

```

on the command line and paste the output here?

---

<div class="post-metadata">

**Author:** ![Panther](https://discourse.mailinabox.email/letter_avatar_proxy/v4/letter/p/a698b9/32.png) [@Panther](https://discourse.mailinabox.email/u/Panther)\
**Post date:** [May 16, 2015, 12:09pm UTC](https://discourse.mailinabox.email/t/500-internal-server-error/475/5 "2015-05-16T12:09:13Z")

</div>

/tmp/tmpg1dhv0m7: No such file or directory

---

<div class="post-metadata">

**Author:** ![Panther](https://discourse.mailinabox.email/letter_avatar_proxy/v4/letter/p/a698b9/32.png) [@Panther](https://discourse.mailinabox.email/u/Panther)\
**Post date:** [May 16, 2015, 12:09pm UTC](https://discourse.mailinabox.email/t/500-internal-server-error/475/6 "2015-05-16T12:09:59Z")

</div>

root@vps169738:~# cd /tmp  
root@vps169738:/tmp# ls  
nsd.6994.task.0 nsd.6994.task.1 NUWLh950uK roundcubemail  
root@vps169738:/tmp#

---

<div class="post-metadata">

**Author:** ![JoshData](https://discourse.mailinabox.email/user_avatar/discourse.mailinabox.email/joshdata/32/2153_2.png) [@JoshData](https://discourse.mailinabox.email/u/JoshData)\
**Post date:** [May 16, 2015, 12:40pm UTC](https://discourse.mailinabox.email/t/500-internal-server-error/475/7 "2015-05-16T12:40:48Z")

</div>

Oh uh yeah that makes sense since it was a temporary file and is gone now.

I wonder if OVH provides a /tmp directory that behaves a little different from normal. I’m spinning up an OVH server now to test a possible solution.

---

<div class="post-metadata">

**Author:** ![Panther](https://discourse.mailinabox.email/letter_avatar_proxy/v4/letter/p/a698b9/32.png) [@Panther](https://discourse.mailinabox.email/u/Panther)\
**Post date:** [May 16, 2015, 12:41pm UTC](https://discourse.mailinabox.email/t/500-internal-server-error/475/8 "2015-05-16T12:41:48Z")

</div>

Alright great! Thanks for your help! - Your free to use mine considering I have no use for it atm and the long wait times for OVH to create and install your VPS.

---

<div class="post-metadata">

**Author:** ![JoshData](https://discourse.mailinabox.email/user_avatar/discourse.mailinabox.email/joshdata/32/2153_2.png) [@JoshData](https://discourse.mailinabox.email/u/JoshData)\
**Post date:** [May 16, 2015, 12:48pm UTC](https://discourse.mailinabox.email/t/500-internal-server-error/475/9 "2015-05-16T12:48:06Z")

</div>

Oh that’d be easier. Can you add my ssh public key to your box and let me know its IP?

```
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCy8tbNlXDjeFmFe5Gv5dZQIFXxY76oI5dBGrtFwf98GItMAnxJnZz3ZEh6N/CwGrtbOErORG8dwNzQg2yH5Xnfz64AZ3+60QBO87Ahsod4ng9DgybkO0kcmAeW1delJQGu8D2Z8CexX6KeClDBIygPU0fzoQQsg6Gxt7Jhg6bDz1co5U1TsOIaorc6rFaN9SmBl5TJUrczXLPvGo2D7czpdUfX0Vc/Ks2R4VM7TrXl4/tv43YoepxAx00SpGbm1r8a0K3vlkpQm7zDcZ8ywUyNUGIRc0TOhqlyqHGnBonesprnoxhp7VGIFeWERiDrJQxqXJ66+GnyOemY78ENj03J joshdata
```

---

<div class="post-metadata">

**Author:** ![Panther](https://discourse.mailinabox.email/letter_avatar_proxy/v4/letter/p/a698b9/32.png) [@Panther](https://discourse.mailinabox.email/u/Panther)\
**Post date:** [May 16, 2015, 12:57pm UTC](https://discourse.mailinabox.email/t/500-internal-server-error/475/10 "2015-05-16T12:57:46Z")

</div>

Added. the IP is “box.panther.io”

---

<div class="post-metadata">

**Author:** ![JoshData](https://discourse.mailinabox.email/user_avatar/discourse.mailinabox.email/joshdata/32/2153_2.png) [@JoshData](https://discourse.mailinabox.email/u/JoshData)\
**Post date:** [May 16, 2015, 1:10pm UTC](https://discourse.mailinabox.email/t/500-internal-server-error/475/11 "2015-05-16T13:10:04Z")

</div>

What’s the name of the user account? (If it’s `root`, `user`, or `ubuntu`, I tried that but got a password prompt, which would mean the key probably isn’t added correctly.)

---

<div class="post-metadata">

**Author:** ![Panther](https://discourse.mailinabox.email/letter_avatar_proxy/v4/letter/p/a698b9/32.png) [@Panther](https://discourse.mailinabox.email/u/Panther)\
**Post date:** [May 16, 2015, 1:12pm UTC](https://discourse.mailinabox.email/t/500-internal-server-error/475/12 "2015-05-16T13:12:30Z")

</div>

Might not have, just use the password login. [rest deleted by JoshData—got it thanks]

---

<div class="post-metadata">

**Author:** ![JoshData](https://discourse.mailinabox.email/user_avatar/discourse.mailinabox.email/joshdata/32/2153_2.png) [@JoshData](https://discourse.mailinabox.email/u/JoshData)\
**Post date:** [May 16, 2015, 1:43pm UTC](https://discourse.mailinabox.email/t/500-internal-server-error/475/13 "2015-05-16T13:43:39Z")

</div>

Thanks.

My earlier diagnosis wasn’t right. OVH is providing you with an Ubuntu image that is missing `/dev/stdin`, `/dev/stdout`, `/dev/stderr`. I have never seen that before and I think OVH is wrong. But I’ve committed a fix anyway:

> <https://github.com/mail-in-a-box/mailinabox/commit/4f98d470a0f60273a34326d22c517a89f0bc1b08>

I’ve updated your system to the latest development version of Mail-in-a-Box so you have that fix. It all _should_ work now, but let me know. Thanks for working through this with me.

---

<div class="post-metadata">

**Author:** ![Panther](https://discourse.mailinabox.email/letter_avatar_proxy/v4/letter/p/a698b9/32.png) [@Panther](https://discourse.mailinabox.email/u/Panther)\
**Post date:** [May 16, 2015, 1:45pm UTC](https://discourse.mailinabox.email/t/500-internal-server-error/475/14 "2015-05-16T13:45:28Z")

</div>

> [@JoshData](#):
>
> development version of Mail-in-a-Box so you have that fix. It all should work now, but let me know. Thanks for working through this with me.

No problem! Glad you could assist me with this.
