Error 500 | cPanel v5 Installation

Hi,

I’m trying to install latest invoiceninja (zip file from official site) on my WHM/cPanel server, but I get error 500 before I can install the software. I’m using a subdomain on a cPanel account.

php version: 8.0.14-1.1.1.cpanel
logs: no logs on storage/logs/

I’ve already tried to ask for help on GitHub but couldn’t help: https://github.com/invoiceninja/invoiceninja/issues/7118

Hi,

Are there any errors in the web server error logs?

How can I see this web server error log?

I suggest asking your webhost for advice on finding it.

If you see a 500 the details should be logged somewhere.

Same issue here.Need to set Options +Indexes


Error 

[Thu Jan 20 17:50:41.868649 2022] [autoindex:error] [pid 3555716:tid 139881967769344] [client 34.82.100.142:0] AH01276: Cannot serve directory /home/tno/web/billing.thenorthernoffice.com/public_html/: No matching DirectoryIndex (index.html,index.cgi,index.pl,index.php,index.xhtml,index.htm) found, and server-generated directory index forbidden by Options directive

Thanks for the info!

cc @david

Didn’t find any log on my log files referring to this specific subdomain.

@thenorthernoffice, do you also have WHM/cPanel? With config do you have on your server?

Running with Hestia. I am having my server “go to” person look at it and I’ll get back once I know what he thinks

Hi,

I just had my sysadmin look at this problem and reported this, any ideas?:

I am not seeing any specific setup page and can only see what gets loaded. The main index loads the /home/carlosmendiola/public_html/facturacion/config/database.php file, which tells it to use ‘forge’ as the database user. I am not seeing any specific PHP related errors, and all those extensions are installed currently.

I performed an strace of the PHP-FPM and only had it print write() syscalls which should have the error in it. It is still trying to use the configured database instead of showing it should be doing a setup/new install:

[22:16:41 cp1 root@94408210 ~]cPs# strace -s 8192 -ffvtTyyy -e write -p 16453
strace: Process 16453 attached
22:16:49 write(8</home/carlosmendiola/public_html/facturacion/storage/logs/laravel.log>, "[2022-01-24 21:16:49] production.INFO: account table not found  \n", 65) = 65 <0.000024>
22:16:49 write(4<UNIX:[40753606]>, "\1\6\0\1\10\331\7\0Status: 500 Internal Server Error\r\nCache-Control: no-cache, private\r\ndate: Mon, 24 Jan 2022 21:16:49 GMT\r\nContent-Type: text/html; charset=UTF-8\r\nAccess-Control-Allow-Origin: *\r\nAccess-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS\r\nAccess-Control-Allow-Headers: X-API-COMPANY-KEY,X-API-SECRET,X-API-TOKEN,X-API-PASSWORD,DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range,X-CSRF-TOKEN,X-XSRF-TOKEN,X-LIVEWIRE\r\nAccess-Control-Expose-Headers: X-APP-VERSION,X-MINIMUM-CLIENT-VERSION\r\nX-APP-VERSION: 5.3.48\r\nX-MINIMUM-CLIENT-VERSION: 5.0.16\r\nContent-Encoding: gzip\r\nVary: Accept-Encoding\r\n\r\n\37\213\10\0\0\0\0\0\0\3\255X\333n\3436\20}\317W0Z\264q\320H\262\235K\23\3376\355^\372\222b\213&/Ew\261\240)\312fB\221\2I\331q\3\3\375\210~a\277\244C\312\212%K\362\356\6\25\202D\324\334g\310\231\303\214\16\337~xs\367\307o\357\320\334$|r0\262\177\20\307b6\366\250\360&\7\7\10\236\321\234\342h\342^\335\362\320\367\321;\245\244\32 \344\373\33\246\335g\244\211b\251\231\324\210q&\210aR\240\231\301\263\3161z\252q\254+_F\341\256\246\252'w\314p\352\374ht\303X\362\344\226\252\5U\271\327\2430\377\326\240/\241\6#2\307JS3\3662\23\373\227\336d\207,pB\307\336\202\321e*\225\361\20\221\302P\1\354K\26\231\3718\242\vF\250\357\26'\210\tf\30\346\276&\230\323q\257EYD\363\20!+%}^XJ\255\v\365\315\355\357\357\321\235|\240\242\22oY\25\321*\366\215e)k\332Ut\353\314\351\252\226\334\7\244\25\31{\341\275\16q\232\6\367\3725\213\306]zzu~\205\247\227\347\275\350\364\364\274{zq\26y(\2421U\223zy*\212\346\306\244\2030\21411\231\302\4\"\f\10V\\\352\204\212\210I\216\3\"\223p\1\v\251B\314S&\350\275\276\356\7\227A\177\263\4\37\352\266\252\341\274\207@w\202\341L< E9$Wh?U o\310\334Csx\313\275\322\326-+\30\314\264\301\206\21\353\211\267\253\242\221_\312\31\2478e\3329O\264~\35\343\204\361\325\370CJ\305\17\267X\350\357#\246S\216Wc\275\304\251\227;\242\315\212S=\247\0246\215Y\245P,C\37\215\25\257\327\307\2616D\224\273ce\\y\254i\250\17\201\322\340\213\363\376\305\264\33_\305?\366.\317\372Q\335hi\3037\345\211`!\5\203}Z$)\204C\220\245\225]\330pd\234\0014\371s\311\24\3758\340\22GL\314>\235\240\352\207\217AD!\35\r\337\231\0\27\250?\345\222<\264\222\33\10m\0021\247\217\r\237\r\236\362&53\305\242v\257\2342\364\264)\346\0A\206\350p\335\30\332\307@\317\241\37Pm\332\202/8\324\27\30\332\311\\\266\2476\247\356S\356\350\340\3366\236J82\216]\252\333\302\215\2302\253O c:v\337bE\361\261[1\221f&\177\325\224Sb\216k*\34\313\300_\322\351\0033>\316\214\214\31\347'(\347o \24\26j$\364\204\5K\260m\225~\4\35\305\276\f\320y\27\36=\334\222l3\34 \316\26\324:_\10\17\327\327\17t\25+ \352\32\21=\241X\311\4=\255\321\32\32\215\335\326\223\306\203\262\347\34\227\332\305W7=\"\345\3\243\320\2535\364\352\353\323\352:H\230\10\234\3460?\276\2430\37\306\7\333\303\227\23\6JJS\32\246>4=\310\206Z\371Dr;\252_\365\310\305Y\334\37:\216u\256 \230\316\n\266\222\350\24\223\207\231\222\231\210\n\331\5V\235\35\205\307m\212\374\10+;\241^\246\317>P\r8%\0034Ul67\202j\335\271\352~\267c\320\346\274\301\367\257p\270Z\334\321TF+D8\326z\354aa\2475\303\232F\310k\0\10N b\213\202\337v\17\304g\3\373\327Z\321\376iy\202\2248\347,\212 )\300\353\32\227\365\323\327)\26~\17A\352\24\215\374^\267\213\346\0\24\24u\310\253b\222%\263o\31\247\0205\234\364\220p\6[\310\2670\5 \210\240K\337\21\202\373t\346\325\301\322\306\321\245\37gp\30\nO\220\234\336\303\21\205\340\0?5Ha\16\370\342\347\347\2#g\241\234\203\20\222P>G\245\234<\347\240\2775g;\356n\364%\221\3045\2\224D\203\245\337\v\3736\237\366\345\314\311\271_\266\f\210\31\232h\237@\364\340t\35\30\216\254\325B\245\223,\v\270\346\343\367\37y\203\244}\240\331\240\177\377\376\7\2251e\315BhM4@\343\21.\354N3c\240S\271\276\342,\352\4%`\367\333\232H^\343\26Om]\20\244k\277\216\272\217!\336\251@^\304\206e\255\274\25\20\271\351pE\247}~\331\300\312\270{\325\237\342\253\36\276\352\322\363\213\313\263\3238&\0\365\260\301>\270;\225>]`\350\2671\346\232\226\277\333\224\351*q\v\r\v\17^\246f\311\300\343eP8\212\306\10\216\r\272\331,;\307\303\r\303\315\226aGd\270\263\376\f8\355s\2468p\36\35\325\210\16\251WH\16\351\336\344\243\373'\7\200\201\374|g\352\0>\343\266\237\302\214\335\10\340(z\7\21167L\3\332\247\252sThw\10\340\350\244$\rR\205\2\210e\r?CN\241Z0k\r\264<0d\3630l\325\234#\362\301\346V\303\376\2\37w\365\263\30u\16\v\215[/\237K\357(`|k\323\250\f \28\23I\222%v\350\325\f{o?\374\372&\277\315\330\324\320\310\373\377\2546]*^|\203\371\3620w\267\31\273\7I\214\365J\220b\357\265_\244\252g\261\2556\236-v)-\235\343\372\305:\317\322FC\305\265\246k\270}\24\\\1\224\30\326h\353\332\227&\255A\261Q4\3554\353\367R\270\27\33C\275A\213\39\223L\341\"\262\217\305\261mq\6\360z\257\0\0226\f\254\"\200\223vsyg\376f{q/\272x\201\311\226\317\336\346\366\276?3vTX\343\305\5u\271\\B\322\27\222\301(c\342>\337\233\0\203\26\230\254\0\10pFV\241\267't\0\306\332\16pPy7g\32\1\372\3260\33Q\246\0011\347\265\325v\242P\2413\350~+\231\241\0314\0203\247h\nw\vD\37S\252`\"\21\212\340d\312L\25\32\202}V\341\266\2200\0\271`\365\27\0\261\314\34\356\343\266}\333\262\336P\254\4J\244\242-\334\365M\272>\256~+\201\316\352\361\33\205\26\26\26\0201\6hMU\313?\230\302\202\n\3002\377/\332\177mT\355\235V\23\0\0\0\0\0\0\0\0\0\1\3\0\1\0\10\0\0\0\0\0\0\0;\n ", 2296) = 2296 <0.000014>
22:16:49 write(8</home/carlosmendiola/public_html/facturacion/storage/logs/laravel.log>, "[2022-01-24 21:16:49] production.INFO: account table not found  \n", 65) = 65 <0.000016>
22:16:49 write(2<pipe:[40755266]>, "\0fscf\0", 6) = 6 <0.000013>
^Cstrace: Process 16453 detached

I am fairly sure it is expecting the database to already be populated, though I am not familiar with this script. There would be a .sql file within the script’s directory structure that it would use for setup, which I am not seeing anywhere.

This is an apache configuration issue, unfortunately it has been too long since I have used Apache to suggest the correct fix.

@carlosmendiola

Can you confirm that you have copied the .env.example file to .env?

Hi, I don’t understand. So I have to change the name of that file?

I currently have:

.env.ci
.env.dusk.example
.env.example
.env.travis

Changing the .env.example to .env I got through the installation process. I am still getting some errors however:

  1. I can’t log in using Safari. I can put mu username, but won’t type the password. In Chrome I can log in.

  2. When I try to download or see a PDF invoice I get this error:

500: Internal Server Error

There was an error generating the PDF with Phantom JS

Just figured it out the problem:

NINJA_ENVIRONMENT=“selfhost”

#options - snappdf / phantom / hosted_ninja
PDF_GENERATOR=hosted_ninja

PHANTOMJS_KEY=’-keygeneratedbyphantom-’
PHANTOMJS_SECRET=secret

UPDATE_SECRET=secret

I’ve tried with both PDF_GENERATOR=hosted_ninja and phantom (with the key) and didn’t work

@carlosmendiola

After updating the .env you may need to run

/update?secret=secret in the browser to flush the cache.

Hi,

I’m still having problems with InvoiceNinja…

No error on server logs, but get an error while generating the pdf invoice.

This is my .env (***** is marked for privacy)

APP_NAME=“Invoice Ninja”
APP_ENV=production
APP_KEY=*****
APP_DEBUG=“false”

APP_URL="*****"

DB_CONNECTION=“mysql”
MULTI_DB_ENABLED=false

DB_HOST=“localhost”
DB_DATABASE=“"
DB_USERNAME="

DB_PASSWORD=“"
DB_PORT="

DEMO_MODE=false

BROADCAST_DRIVER=log
LOG_CHANNEL=stack
CACHE_DRIVER=file
QUEUE_CONNECTION=sync
SESSION_DRIVER=file
SESSION_LIFETIME=120

REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379

MAIL_MAILER=“log”
MAIL_HOST=""
MAIL_PORT=""
MAIL_USERNAME=""
MAIL_PASSWORD=""
MAIL_ENCRYPTION=“tls”
MAIL_FROM_ADDRESS=""
MAIL_FROM_NAME=""

POSTMARK_API_TOKEN=
REQUIRE_HTTPS=“true”

GOOGLE_MAPS_API_KEY=
ERROR_EMAIL=
TRUSTED_PROXIES=

NINJA_ENVIRONMENT=“selfhost”

#options - snappdf / phantom / hosted_ninja
PDF_GENERATOR=hosted_ninja

PHANTOMJS_KEY=’*****’
PHANTOMJS_SECRET=secret

UPDATE_SECRET=secret

COMPOSER_AUTH=’{“github-oauth”: {“github.com”: “${{ secrets.GITHUB_TOKEN }}”}}’
SENTRY_LARAVEL_DSN=https://*****

@david any ideas to debug?

Don’t have ideas. It happens suddenly or when generating a PDF invoice. I’ve asked my sysadmin to search more deeply for any 500 error

You could try using snappdf. Add or change (make sure you don’t declare more than once):

PDF_GENERATOR=snappdf
PHANTOMJS_PDF_GENERATION=false

save, then load

/update?secret=secret

1 Like

@carlosmendiola

Please try @xoos suggestion.

Done, but when I do the /update?secret=secret I get an error 500