Closed terencejackson8000 closed 3 years ago
This could be a internal dns resolution issue
Have you configured your host resolution in your docker-composer.yml?
extra_hosts:
- "in5.localhost:192.168.0.124 " #host and ip
Thanks for your answer @turbo124. I looked into this and here is the result.
My docker-compose looks like this:
version: '3.7'
services:
server:
image: nginx
restart: always
env_file: env
volumes:
# Vhost configuration
#- ./config/caddy/Caddyfile:/etc/caddy/Caddyfiledocker-com
- ./config/nginx/in-vhost.conf:/etc/nginx/conf.d/in-vhost.conf:ro
- ./docker/app/public:/var/www/app/public:ro
depends_on:
- app
# Run webserver nginx on port 80
# Feel free to modify depending what port is already occupied
ports:
- "81:80"
#- "443:443"
networks:
- invoiceninja
extra_hosts:
- "in5.localhost:192.168.0.124 " #host and ip
app:
image: invoiceninja/invoiceninja:5
env_file: env
restart: always
volumes:
- ./config/hosts:/etc/hosts:ro
- ./docker/app/public:/var/www/app/public:rw,delegated
- ./docker/app/storage:/var/www/app/storage:rw,delegated
depends_on:
- db
networks:
- invoiceninja
extra_hosts:
- "in5.localhost:192.168.0.124 " #host and ip
db:
image: mysql:5
ports:
- "3305:3306"
restart: always
env_file: env
volumes:
- ./docker/mysql/data:/var/lib/mysql:rw,delegated
networks:
- invoiceninja
extra_hosts:
- "in5.localhost:192.168.0.124 " #host and ip
networks:
invoiceninja:
And my /config/hosts looke like this:
192.168.xx.15 localhost
192.168.0.124 in5.test
I have also already tried to exchange in5.localhost:192.168.0.124 with localhost 192.168.xx.15 but it is still not working => I am still getting error 500.
Maybe one other hint: I am running this behind a reverse proxy. The path is: ninja.xxx.xxx -> 192.168.xx.15 (Docker host) -> Port 81 (Invoice Ninja Docker NGINX)
Do you have any other idea what the problem can be?
Can you check the logs in storage/logs/laravel.log
I wonder if the issue is write permissions to the volume?
Here is the content of the laravel.log
#0 [internal function]: Illuminate\\Foundation\\Bootstrap\\HandleExceptions->han dleError()
#1 /var/www/app/app/Models/Presenters/CompanyPresenter.php(58): file_get_content s()
#2 /var/www/app/app/Utils/HtmlEngine.php(334): App\\Models\\Presenters\\CompanyP resenter->logo_base64()
#3 /var/www/app/app/Utils/HtmlEngine.php(448): App\\Utils\\HtmlEngine->buildEnti tyDataArray()
#4 /var/www/app/app/Http/Controllers/PreviewController.php(356): App\\Utils\\Htm lEngine->generateLabelsAndValues()
#5 /var/www/app/app/Http/Controllers/PreviewController.php(165): App\\Http\\Cont rollers\\PreviewController->blankEntity()
#6 /var/www/app/vendor/laravel/framework/src/Illuminate/Routing/Controller.php(5 4): App\\Http\\Controllers\\PreviewController->show()
#7 /var/www/app/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispat cher.php(45): Illuminate\\Routing\\Controller->callAction()
#8 /var/www/app/vendor/laravel/framework/src/Illuminate/Routing/Route.php(254): Illuminate\\Routing\\ControllerDispatcher->dispatch()
#9 /var/www/app/vendor/laravel/framework/src/Illuminate/Routing/Route.php(197): Illuminate\\Routing\\Route->runController()
#10 /var/www/app/vendor/laravel/framework/src/Illuminate/Routing/Router.php(695) : Illuminate\\Routing\\Route->run()
#11 /var/www/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(1 28): Illuminate\\Routing\\Router->Illuminate\\Routing\\{closure}()
#12 /var/www/app/app/Http/Middleware/QueryLogging.php(40): Illuminate\\Pipeline\ \Pipeline->Illuminate\\Pipeline\\{closure}()
#13 /var/www/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(1 67): App\\Http\\Middleware\\QueryLogging->handle()
#14 /var/www/app/vendor/laravel/framework/src/Illuminate/Routing/Middleware/Subs tituteBindings.php(50): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{c losure}()
#15 /var/www/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(1 67): Illuminate\\Routing\\Middleware\\SubstituteBindings->handle()
#16 /var/www/app/app/Http/Middleware/Locale.php(34): Illuminate\\Pipeline\\Pipel ine->Illuminate\\Pipeline\\{closure}()
#17 /var/www/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(1 67): App\\Http\\Middleware\\Locale->handle()
#18 /var/www/app/app/Http/Middleware/TokenAuth.php(80): Illuminate\\Pipeline\\Pi peline->Illuminate\\Pipeline\\{closure}()
#19 /var/www/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(1 67): App\\Http\\Middleware\\TokenAuth->handle()
#20 /var/www/app/app/Http/Middleware/SetDb.php(41): Illuminate\\Pipeline\\Pipeli ne->Illuminate\\Pipeline\\{closure}()
#21 /var/www/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(1 67): App\\Http\\Middleware\\SetDb->handle()
#22 /var/www/app/vendor/laravel/framework/src/Illuminate/Routing/Middleware/Thro ttleRequests.php(127): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{cl osure}()
#23 /var/www/app/vendor/laravel/framework/src/Illuminate/Routing/Middleware/Thro ttleRequests.php(63): Illuminate\\Routing\\Middleware\\ThrottleRequests->handleR equest()
#24 /var/www/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(1 67): Illuminate\\Routing\\Middleware\\ThrottleRequests->handle()
#25 /var/www/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(1 03): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#26 /var/www/app/vendor/laravel/framework/src/Illuminate/Routing/Router.php(697) : Illuminate\\Pipeline\\Pipeline->then()
#27 /var/www/app/vendor/laravel/framework/src/Illuminate/Routing/Router.php(672) : Illuminate\\Routing\\Router->runRouteWithinStack()
#28 /var/www/app/vendor/laravel/framework/src/Illuminate/Routing/Router.php(636) : Illuminate\\Routing\\Router->runRoute()
#29 /var/www/app/vendor/laravel/framework/src/Illuminate/Routing/Router.php(625) : Illuminate\\Routing\\Router->dispatchToRoute()
#30 /var/www/app/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel. php(166): Illuminate\\Routing\\Router->dispatch()
#31 /var/www/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(1 28): Illuminate\\Foundation\\Http\\Kernel->Illuminate\\Foundation\\Http\\{closur e}()
#32 /var/www/app/vendor/sentry/sentry-laravel/src/Sentry/Laravel/Http/SetRequest IpMiddleware.php(55): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{clo sure}()
#33 /var/www/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(1 67): Sentry\\Laravel\\Http\\SetRequestIpMiddleware->handle()
#34 /var/www/app/vendor/sentry/sentry-laravel/src/Sentry/Laravel/Http/SetRequest Middleware.php(52): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closu re}()
#35 /var/www/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(1 67): Sentry\\Laravel\\Http\\SetRequestMiddleware->handle()
#36 /var/www/app/app/Http/Middleware/Cors.php(25): Illuminate\\Pipeline\\Pipelin e->Illuminate\\Pipeline\\{closure}()
#37 /var/www/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(1 67): App\\Http\\Middleware\\Cors->handle()
#38 /var/www/app/vendor/fideloper/proxy/src/TrustProxies.php(57): Illuminate\\Pi peline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#39 /var/www/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(1 67): Fideloper\\Proxy\\TrustProxies->handle()
#40 /var/www/app/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middlew are/TransformsRequest.php(21): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipel ine\\{closure}()
#41 /var/www/app/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middlew are/ConvertEmptyStringsToNull.php(31): Illuminate\\Foundation\\Http\\Middleware\ \TransformsRequest->handle()
#42 /var/www/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(1 67): Illuminate\\Foundation\\Http\\Middleware\\ConvertEmptyStringsToNull->handle ()
#43 /var/www/app/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middlew are/TransformsRequest.php(21): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipel ine\\{closure}()
#44 /var/www/app/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middlew are/TrimStrings.php(40): Illuminate\\Foundation\\Http\\Middleware\\TransformsReq uest->handle()
#45 /var/www/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(1 67): Illuminate\\Foundation\\Http\\Middleware\\TrimStrings->handle()
#46 /var/www/app/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middlew are/ValidatePostSize.php(27): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeli ne\\{closure}()
#47 /var/www/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(1 67): Illuminate\\Foundation\\Http\\Middleware\\ValidatePostSize->handle()
#48 /var/www/app/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middlew are/PreventRequestsDuringMaintenance.php(86): Illuminate\\Pipeline\\Pipeline->Il luminate\\Pipeline\\{closure}()
#49 /var/www/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(1 67): Illuminate\\Foundation\\Http\\Middleware\\PreventRequestsDuringMaintenance- >handle()
#50 /var/www/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(1 03): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#51 /var/www/app/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel. php(141): Illuminate\\Pipeline\\Pipeline->then()
#52 /var/www/app/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel. php(110): Illuminate\\Foundation\\Http\\Kernel->sendRequestThroughRouter()
#53 /var/www/app/public/index.php(57): Illuminate\\Foundation\\Http\\Kernel->han dle()
#54 {main}
"}
The storage folders are owned by 1500:1500.
I have also set the permissions to 777 for testing and still are getting an error 500.
I'm making a small change to help docker users on this. The issue is DNS resolution inside the container. This will be available in the next release.
@terencejackson8000
could you try changing the line
./config/nginx/in-vhost.conf:/etc/nginx/conf.d/in-vhost.conf:ro
to
./config/nginx/in-vhost.conf:/etc/nginx/conf.d/default.conf:ro
And let me know whether the issue persist?
Thanks @lwj5 and @turbo124, I appreciate your help.
I changed the docker-compose.yml to:
version: '3.7'
services:
server:
image: nginx
restart: always
env_file: env
volumes:
# Vhost configuration
#- ./config/caddy/Caddyfile:/etc/caddy/Caddyfiledocker-com
#- ./config/nginx/in-vhost.conf:/etc/nginx/conf.d/in-vhost.conf:ro
- ./config/nginx/in-vhost.conf:/etc/nginx/conf.d/default.conf:ro
- ./docker/app/public:/var/www/app/public:ro
depends_on:
- app
# Run webserver nginx on port 80
# Feel free to modify depending what port is already occupied
ports:
- "81:80"
#- "443:443"
networks:
- invoiceninja
extra_hosts:
- "ninja.xxx.xx:192.168.2.15 " #host and ip
Unfortunately still the same result. Is there any way to get more detailed logs?
@turbo124, @lwj5: I have now set it up on a complete new database and now it works. In the first try I had used a database which was already running succesfully as a non-docker environment. So maybe this was caused by a version conflict or similar.
I also did not mention this in my first post (somehow I thought it was not relevant as everything else was working). Sorry about that.
In the current installation it is still version v5.2.15-C56.
What version of Invoice Ninja are you running? ie v4.5.25 / v5.0.30 v5.2.15-C56 What environment are you running? Docker -> Docker compose
Have you checked log files (storage/logs/) Please provide redacted output server_1 | 192.168.xx.xx - - [29/Jul/2021:19:55:52 +0000] "POST /api/v1/preview? HTTP/1.1" 500 14937 "https://ninja.xxx.xxx/" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:90.0) Gecko/20100101 Firefox/90.0" "xx.xx.xx.xx"
Describe the bug I have installed InvoiceNinja with Docker Compose and it is running nicely. The only thing not working is the PDF generation. When I look at the logs I only see the above error. Even when I put it in debug mode I do not get more. On the UI I only see an error 500. My env looks like this: PHANTOMJS_PDF_GENERATION=false PDF_GENERATOR=snappdf
The system health check in InvoiceNinja looks like this:
Where can I get more information to figure out where the issue is?