500 Internal Server Error

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

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

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

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?

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

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

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?

/tmp/tmpg1dhv0m7: No such file or directory

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

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.

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.

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

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

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.)

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

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:

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.

No problem! Glad you could assist me with this.