Administrative settings not saving to database

Hi Folks -

Recently installed invoiceninja. Great program.

  1. Install went well.
  2. Set up administrative account no problem
  3. Application can save new clients and invoices to db no problem
  4. Problem: No changes made in settings will take. this includes everything under application settings and mail settings panel. Database information tests properly.

Mail settings fail with “can’t connect to mail.service.host” which tells me what I’m typing into the field isn’t being processed. Changes to the hostname just come back as “successful save” with no change to the data field presented.

Laravel log gives me the same error re: email. Nothing to see re: the hostname.

Any thoughts? Chmod something wrong?

Thanks,
ALC

Changes to /settings/system_settings are saved to the .env file in the root folder of the project, maybe the web user don’t have permission to update the file?

Understood. So if you’d be so kind to sanity check something for me.

Here are the permissions on the .env file at the root folder of the project and the contents of the file presently

root@5d46b8aa0d78:/var/www/app# ls -l .env
-rw-r–r-- 1 www-data www-data 3323 Apr 14 01:17 .env

Contents: (sanitized where appropriate) this is in a docker container)

MAIL_FROM_ADDRESS=user@mail.com
DB_HOST=mysql
HOSTNAME=5d46b8aa0d78
SELF_UPDATER_SOURCE=
PHP_INI_DIR=/usr/local/etc/php
PHP_ASC_URL=https://secure.php.net/get/php-7.0.17.tar.xz.asc/from/this/mirror
INVOICENINJA_VERSION=3.2.0
PHP_CFLAGS=’-fstack-protector-strong -fpic -fpie -O2’
MAIL_USERNAME=username
PHP_MD5=549df69a7a3c79d49fcafe2097579d9e
PHPIZE_DEPS=‘autoconf file g++ gcc libc-dev make pkg-config re2c’
APP_URL=http://localhost:8000
PHP_URL=https://secure.php.net/get/php-7.0.17.tar.xz/from/this/mirror
MAIL_PASSWORD=password
PHP_LDFLAGS=’-Wl,-O1 -Wl,–hash-style=both -pie’
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
DB_DATABASE=ninja
PHANTOMJS=phantomjs-2.1.1-linux-x86_64
GPG_KEYS=‘1A4E8B7277C42E53DBA9C7B9BCAA30EA9C0D5763 6E4F6AB321FDC07F2C332E3AC2BF0BC433CFC8B3’
PHP_CPPFLAGS=’-fstack-protector-strong -fpic -fpie -O2’
PWD=/var/www/app
DB_PASSWORD=pwd
MAIL_FROM_NAME=’“My name”’
PHANTOMJS_BIN_PATH=/usr/local/bin/phantomjs
APP_KEY=SomeRandomString
APP_DEBUG=true
SHLVL=0
HOME=/var/www
DB_USERNAME=root
PHP_SHA256=471c16fcdd6a5e1a37199e97bcaeea6117626229785185be7532aaa7c6ee04be
APP_CIPHER=rijndael-128
MAIL_DRIVER=smtp
affinity:container==dcf2017f9c774b17cd427bda39caeb2bfca75c3863313074c99d3a8d7b6e897d
LOG=errorlog
PHP_VERSION=7.0.17
PHP_EXTRA_CONFIGURE_ARGS=’–enable-fpm --with-fpm-user=www-data --with-fpm-group=www-data’
MAIL_HOST=mail.service.host
USER=www-data
HTTP_COOKIE=‘XSRF-TOKEN=eyJpdiI6IlhBcnVua2RqWXVFTzBGNlNcL2VYcXFBPT0iLCJ2YWx1ZSI6Ijc3RkY5QWZYZVRodTl3MmtqT0J1djhSNFU1NWR0UVJWNW52SGtKZ0pKQ2VGM3ZPdDE2ZFwvOUJtbDhpRlVWVVlaU2t3K29qcU5XZ1ZjWjdSTkVTaDh2UT09IiwibWFjIjoiZjFmMzQwZDQ5NTJiZDEwZmZmMjNmMzhlNDc2M2U1ZWY1NmVjNzVjNTAyMGY4ZGYxZWU5OWUyZGE3MGI1ODNkMiJ9; ninja_session=eyJpdiI6IjNVTU9sd1U4MjRBa0tjVUVKcUI3MlE9PSIsInZhbHVlIjoiazBFXC8yYm1OQXRmU2VkQ3VMSHlIT2dNc0dianE0OXFcL2RHcnJLa2Y1NUNDMllvcmFPQktuY2Z6dVpOeldwdVB1bFhncURvNTdKUVJXRGJpT0NnZVJIdz09IiwibWFjIjoiYjMxZGQ4MmQyMDhjNDZlNzlhMmY3ZDYxMGIwNmEyODNmNzYwYWNiMTIxYzNhYjQ2MTMyZDA4MDFkZWQ4ZDNmYiJ9’
HTTP_ACCEPT_LANGUAGE=en-US,en;q=0.8
HTTP_ACCEPT_ENCODING=‘gzip, deflate’
HTTP_REFERER=http://invoiceninja.{xxxxxxxx}.com/settings/system_settings
HTTP_ACCEPT=text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,/;q=0.8
HTTP_CONTENT_TYPE=application/x-www-form-urlencoded
HTTP_USER_AGENT=‘Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.133 Safari/537.36’
HTTP_UPGRADE_INSECURE_REQUESTS=1
HTTP_ORIGIN=http://invoiceninja.[xxxxxxxx].com
HTTP_CACHE_CONTROL=max-age=0
HTTP_CONTENT_LENGTH=553
HTTP_CONNECTION=keep-alive
HTTP_HOST=invoiceninja.[xxxxxxxx].com
SCRIPT_FILENAME=/var/www/app/public/index.php
REDIRECT_STATUS=200
SERVER_NAME=your_ininja_site
SERVER_PORT=80
SERVER_ADDR=xxx.xxx.xxx.xxx
REMOTE_PORT=50112
REMOTE_ADDR=xxx.xxx.xxx.xxx
SERVER_SOFTWARE=nginx/1.11.13
GATEWAY_INTERFACE=CGI/1.1
REQUEST_SCHEME=http
SERVER_PROTOCOL=HTTP/1.1
DOCUMENT_ROOT=/var/www/app/public
DOCUMENT_URI=/index.php
REQUEST_URI=/update_setup
SCRIPT_NAME=/index.php
CONTENT_LENGTH=553
CONTENT_TYPE=application/x-www-form-urlencoded
REQUEST_METHOD=POST
QUERY_STRING=
FCGI_ROLE=RESPONDER
PHP_SELF=/index.php
REQUEST_TIME_FLOAT=1492132637.3611
REQUEST_TIME=1492132637
argc=0
REQUIRE_HTTPS=false
DB_TYPE=mysql
MAIL_PORT=587
MAIL_ENCRYPTION=tls
MAILGUN_DOMAIN=
MAILGUN_SECRET=

I’d suggest manually updating the .env file.

Do you have other problems with the app or just updating /settings/system_settings

Presently it’s just the settings/system_settings

Manual updates are certainly possible, but I’d like to avoid that complexity for the system owner should they ever decide they want to make a change.

Not sure, here’s the relevant code if you want to try to debug it:

https://github.com/invoiceninja/invoiceninja/blob/master/app/Http/Controllers/AppController.php#L196

Thanks Hillel -

changes made to the .env are not being reflected in the systems panel. Very strange.