invoiceninja / dockerfiles

Docker files for Invoice Ninja
https://hub.docker.com/r/invoiceninja/invoiceninja
GNU General Public License v2.0
411 stars 267 forks source link

InvoiceNinja v5 docker-compose failing PDF preview. Also won't send email invoice. #203

Closed ntenpas-presence closed 3 years ago

ntenpas-presence commented 4 years ago

I am running IN5 with docker-compose (with Caddy). After following the basic setup, I am unable to generate a PDF preview or send emails. During the setup phase, the PDF test fails with "Oops, looks like something isn't correct". I am able to successfully test email functionality during the setup phase.

Once through the setup phase, I am unable to generate a PDF preview of a newly created invoice. When I click on "View PDF" for the invoice, I get a 404 error.

When I try sending an initial email for the invoice, I do not get any email, but also don't get any errors.

I have a support thread open on the form here.

I would expect IN5 to work out-of-the-box with docker-compose. This issue is easy to recreate just running with the default setup. Could I get some support on this issue? Any suggestions on how to enable PDF generation or email sending?

turbo124 commented 3 years ago
 sudo docker-compose exec app php artisan storage:link

I had to link the storage folders with the following to get this working.

turbo124 commented 3 years ago

@ntenpas-presence we've rewritten the dockerfiles for a cleaner setup and installation. Can you try again from a fresh setup using the quickstart in the readme.

tonydm commented 1 year ago

Greetings...

Excited to setup and try, but I too am having an issue with PDF generation and Sending email. I just deployed today (11/17/2022) using docker-compose and the standard env & docker-compose.yml with the relevant changes made. However, I did have to chmod -R 777 the docker/app directory to get past the permissions issue during initial startup (755 did not work). I also provided the user account UID and GID in the docker-compose.yml config. Poking around the open and closed issues but I didn't find any resolution. Thanks again for your efforts!

user UID/GID

~/DockerServices/invoice-ninja master !4 ....................................................................................................... INT 11:44:37 AM
> id 
uid=1001(<user>) gid=1001(<user>) groups=1001(<user>),998(docker)

env file

~/DockerServices/invoice-ninja master !4 ........................................................................................................ 7s 11:34:50 AM
> cat env
# IN application vars
#APP_URL=http://in.localhost:8003
APP_URL=http://<my_domain.com>
APP_KEY=base64:<key>
APP_DEBUG=true
REQUIRE_HTTPS=false
PHANTOMJS_PDF_GENERATION=false
PDF_GENERATOR=snappdf
TRUSTED_PROXIES='*'

QUEUE_CONNECTION=database

# DB connection
DB_HOST=db
DB_PORT=3306
DB_DATABASE=ninja
DB_USERNAME=<db_user>
DB_PASSWORD=<db_pass>

# Create initial user
# Default to these values if empty
# IN_USER_EMAIL=admin@example.com
# IN_PASSWORD=changeme!
IN_USER_EMAIL=<user_email>
IN_PASSWORD=<user_pass>

# Mail options
MAIL_MAILER=log
MAIL_HOST=smtp.gmail.com
MAIL_PORT=587
MAIL_USERNAME=<email_address>
MAIL_PASSWORD=<email_password>
MAIL_ENCRYPTION=tls
MAIL_FROM_ADDRESS=<from_email_address>
MAIL_FROM_NAME='<from_name>'

# MySQL
MYSQL_ROOT_PASSWORD=<db_root_password>
MYSQL_USER=<db_user>
MYSQL_PASSWORD=<db_password>
MYSQL_DATABASE=ninja

docker-compose.yml

~/DockerServices/invoice-ninja master !4 ........................................................................................................... 11:39:57 AM
> cat docker-compose.yml 
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:
      - "80: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
    environment:
      - PUID=1001
      - PGID=1001
    networks:
      - invoiceninja
#    extra_hosts:
#      - "in5.localhost:192.168.0.124 " #host and ip

  db:
    image: mysql:8
#    When running on ARM64 use MariaDB instead of MySQL
#    image: mariadb:10.4
#    For auto DB backups comment out image and use the build block below
#    build:
#      context: ./config/mysql
    ports:
      - "3305:3306"
    restart: always
    env_file: env
    volumes:
      - ./docker/mysql/data:/var/lib/mysql:rw,delegated

      # remove comments for next 4 lines if you want auto sql backups
      #- ./docker/mysql/bak:/backups:rw
      #- ./config/mysql/backup-script:/etc/cron.daily/daily:ro
      #- ./config/mysql/backup-script:/etc/cron.weekly/weekly:ro
      #- ./config/mysql/backup-script:/etc/cron.monthly/monthly:ro
    networks:
      - invoiceninja
#    extra_hosts:
#      - "in5.localhost:192.168.0.124 " #host and ip

networks:
  invoiceninja:

Container environment

~/DockerServices/invoice-ninja master !4 ........................................................................................................... 11:44:41 AM
> docker exec -it invoice-ninja-app-1 ash
~ $ printenv
SNAPPDF_EXECUTABLE_PATH=/usr/bin/chromium-browser
MAIL_USERNAME=<email_username>
APP_DEBUG=true
HOSTNAME=0b86dbc3ebd0
APP_URL=<my_domain>
IN_USER_EMAIL=<user_email>
MAIL_FROM_ADDRESS=<from_email>
DB_PORT=3306
PHP_INI_DIR=/usr/local/etc/php
SHLVL=1
HOME=/var/www/app
PHANTOMJS_PDF_GENERATION=false
MAIL_FROM_NAME=<from_name>
DB_DATABASE=ninja
PDF_GENERATOR=snappdf
MYSQL_ROOT_PASSWORD=<db_root_password>
PHP_LDFLAGS=-Wl,-O1 -pie
REQUIRE_HTTPS=false
PHP_CFLAGS=-fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
PGID=1001
PHP_VERSION=8.1.12
IN_PASSWORD=<user_password>
TRUSTED_PROXIES=*
DB_USERNAME=<db_user>
GPG_KEYS=<key1> <key2> <key3>
PHP_CPPFLAGS=-fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
PHP_ASC_URL=https://www.php.net/distributions/php-8.1.12.tar.xz.asc
INVOICENINJA_VERSION=5.5.40
BAK_PUBLIC_PATH=/var/www/app/docker-backup-public/
PHP_URL=https://www.php.net/distributions/php-8.1.12.tar.xz
TERM=xterm
MAIL_ENCRYPTION=tls
INVOICENINJA_USER=invoiceninja
MYSQL_PASSWORD=<db_password>
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
MAIL_PASSWORD=<email_password>
MYSQL_USER=<db_user>
BAK_STORAGE_PATH=/var/www/app/docker-backup-storage/
MAIL_HOST=smtp.gmail.com
PUID=1001
IS_DOCKER=true
MAIL_PORT=587
MAIL_MAILER=log
DB_PASSWORD=<db_password>
APP_KEY=base64:<key>
PHPIZE_DEPS=autoconf            dpkg-dev dpkg           file            g++             gcc             libc-dev                make            pkgconf         re2c
APP_ENV=production
PWD=/var/www/app
PHP_SHA256=<hash>
QUEUE_CONNECTION=database
MYSQL_DATABASE=ninja
DB_HOST=db
LOG=errorlog

Container /var/www

/var/www $ ll
total 16
drwxr-xr-x    1 root     root          4096 Nov 16 09:00 ./
drwxr-xr-x    1 root     root          4096 Nov 16 09:00 ../
drwxr-sr-x    1 invoicen invoicen      4096 Nov 17 18:47 app/
drwxrwxrwx    2 www-data www-data      4096 Oct  6 23:34 html/
/var/www $ cd app/
~ $ ll
total 1536
drwxr-sr-x    1 invoicen invoicen      4096 Nov 17 18:47 ./
drwxr-xr-x    1 root     root          4096 Nov 16 09:00 ../
-rw-------    1 invoicen invoicen        60 Nov 17 18:53 .ash_history
-rw-rw-r--    1 invoicen invoicen        63 Nov 16 08:52 .babelrc
drwxr-sr-x    3 invoicen invoicen      4096 Nov 16 09:00 .cache/
-rw-rw-r--    1 invoicen invoicen        99 Nov 16 08:52 .codacy.yml
drwxr-sr-x    1 invoicen invoicen      4096 Nov 17 18:34 .config/
-rw-rw-r--    1 invoicen invoicen       213 Nov 16 08:52 .editorconfig
-rw-rw-r--    1 invoicen invoicen      1258 Nov 16 08:52 .env
-rw-rw-r--    1 invoicen invoicen       499 Nov 16 08:52 .env.ci
-rw-rw-r--    1 invoicen invoicen       484 Nov 16 08:52 .env.dusk.example
-rw-rw-r--    1 invoicen invoicen       461 Nov 16 08:52 .env.travis
-rw-rw-r--    1 invoicen invoicen       111 Nov 16 08:52 .gitattributes
drwxrwxr-x    3 invoicen invoicen      4096 Nov 16 08:58 .github/
-rw-rw-r--    1 invoicen invoicen       451 Nov 16 08:52 .gitignore
-rw-rw-r--    1 invoicen invoicen      6067 Nov 16 08:52 .htaccess
drwxr-sr-x    3 invoicen invoicen      4096 Nov 16 09:00 .local/
-rw-rw-r--    1 invoicen invoicen       488 Nov 16 08:52 .php_cs
-rw-rw-r--    1 invoicen invoicen       103 Nov 16 08:52 .prettierrc
-rw-rw-r--    1 invoicen invoicen       358 Nov 16 08:52 CODE_OF_CONDUCT.md
-rw-rw-r--    1 invoicen invoicen      3891 Nov 16 08:52 LICENSE
-rw-rw-r--    1 invoicen invoicen      4223 Nov 16 08:52 README.md
-rw-rw-r--    1 invoicen invoicen         6 Nov 16 08:52 VERSION.txt
drwxrwxr-x   27 invoicen invoicen      4096 Nov 16 08:58 app/
-rw-rw-r--    1 invoicen invoicen      1686 Nov 16 08:52 artisan
drwxrwxr-x    1 invoicen invoicen      4096 Nov 16 08:58 bootstrap/
-rw-rw-r--    1 invoicen invoicen        55 Nov 16 08:52 codecov.yml
-rw-rw-r--    1 invoicen invoicen      5149 Nov 16 08:52 composer.json
-rw-rw-r--    1 invoicen invoicen    612557 Nov 16 08:52 composer.lock
drwxrwxr-x    2 invoicen invoicen      4096 Nov 16 08:58 config/
drwxrwxr-x    6 invoicen invoicen      4096 Nov 16 08:58 database/
-rw-rw-r--    1 invoicen invoicen      1703 Nov 16 08:52 dusk.sh
drwxrwxr-x   40 invoicen invoicen      4096 Nov 16 08:58 lang/
-rw-rw-r--    1 invoicen invoicen        21 Nov 16 08:52 modules_statuses.json
drwxr-xr-x    2 invoicen invoicen      4096 Nov 16 08:58 node_modules/
-rw-rw-r--    1 invoicen invoicen    751950 Nov 16 08:58 package-lock.json
-rw-rw-r--    1 invoicen invoicen      1056 Nov 16 08:52 package.json
-rw-rw-r--    1 invoicen invoicen      1295 Nov 16 08:52 phpunit.xml
-rw-rw-r--    1 invoicen invoicen      2827 Nov 16 08:52 phpunit.yml
-rw-rw-r--    1 invoicen invoicen      3171 Nov 16 08:52 preload.php
-rw-rw-r--    1 invoicen invoicen      2411 Nov 16 08:52 psalm.xml
drwxrwxrwx   13 1001     1001          4096 Nov 17 15:51 public/
drwxrwxr-x    5 invoicen invoicen      4096 Nov 16 08:58 resources/
drwxrwxr-x    2 invoicen invoicen      4096 Nov 16 08:58 routes/
drwxrwxrwx    5 1001     1001          4096 Nov 17 15:37 storage/
-rw-rw-r--    1 invoicen invoicen       632 Nov 16 08:52 tailwind.config.js
drwxr-sr-x   90 invoicen invoicen      4096 Nov 16 09:01 vendor/
-rw-rw-r--    1 invoicen invoicen      5994 Nov 16 08:52 webpack.mix.js
turbo124 commented 1 year ago

The correct uid is 1500 i think this is the issue you've run up against.

chmod 755 docker/app/public sudo chown -R 1500:1500 docker/app

tonydm commented 1 year ago

Thanks @turbo124 ... Should not the PUID/PGID equal that of the host system user executing the docker runtime? 1500 does not match any user/group on the host

turbo124 commented 1 year ago

@tonydm the exact reason for this escapes me currently.

@lwj5 can you recall the reason why we use this uid?

tonydm commented 1 year ago

I made the recommend changes... but still no love. A spinning icon just spins indefinitely when clicking "View PDF". Also, interesting, clicking the "Send Email" at the bottom right of the Quote and then the green "Send" button at the top right returns a message at the bottom of the screen "Successfully queued message to be sent", but the queued email never gets picked up by the backend process. I've included a portion of the docker log below.

from the host

~/DockerServices/invoice-ninja master !4 ........................................................................................................... 01:45:41 PM
> ll docker/app/public 
total 106M
drwxr-xr-x 13 1500 1500 4.0K 2022-11-17 08:51 ./
drwxrwxrwx  4 1500 1500 4.0K 2022-11-17 08:31 ../
-rwxr-xr-x  1 1500 1500    1 2022-11-17 08:31 .keep*
drwxr-xr-x  7 1500 1500 4.0K 2022-11-16 01:58 assets/
drwxr-xr-x  3 1500 1500 4.0K 2022-11-16 01:58 canvaskit/
drwxr-xr-x  2 1500 1500 4.0K 2022-11-16 01:59 css/
-rwxr-xr-x  1 1500 1500  15K 2022-11-16 01:52 favicon.ico*
-rwxr-xr-x  1 1500 1500 2.7K 2022-11-16 01:52 favicon.png*
-rwxr-xr-x  1 1500 1500 6.4K 2022-11-16 01:52 flutter.js*
-rwxr-xr-x  1 1500 1500  32K 2022-11-16 01:52 flutter_service_worker.js*
drwxr-xr-x  2 1500 1500 4.0K 2022-11-16 01:58 icons/
drwxr-xr-x  6 1500 1500 4.0K 2022-11-16 01:58 images/
-rwxr-xr-x  1 1500 1500 1.9K 2022-11-16 01:52 index.php*
drwxr-xr-x  5 1500 1500 4.0K 2022-11-16 01:58 js/
drwxr-xr-x  2 1500 1500 4.0K 2022-11-16 01:58 logo/
-rwxr-xr-x  1 1500 1500  11M 2022-11-16 01:52 main.dart.js*
-rwxr-xr-x  1 1500 1500 7.5M 2022-11-16 01:52 main.dart.js.map*
-rwxr-xr-x  1 1500 1500  11M 2022-11-16 01:52 main.foss.dart.js*
-rwxr-xr-x  1 1500 1500 7.5M 2022-11-16 01:52 main.foss.dart.js.map*
-rwxr-xr-x  1 1500 1500 8.2M 2022-11-16 01:52 main.foss.wasm.dart.js*
-rwxr-xr-x  1 1500 1500 9.0M 2022-11-16 01:52 main.html.dart.js*
-rwxr-xr-x  1 1500 1500 8.4M 2022-11-16 01:52 main.last.dart.js*
-rwxr-xr-x  1 1500 1500 9.2M 2022-11-16 01:52 main.next.dart.js*
-rwxr-xr-x  1 1500 1500  28M 2022-11-16 01:52 main.profile.dart.js*
-rwxr-xr-x  1 1500 1500 8.3M 2022-11-16 01:52 main.wasm.dart.js*
-rwxr-xr-x  1 1500 1500  721 2022-11-16 01:52 manifest.json*
-rwxr-xr-x  1 1500 1500 5.5K 2022-11-16 01:59 mix-manifest.json*
drwxr-xr-x  2 1500 1500 4.0K 2022-11-16 01:58 react/
-rwxr-xr-x  1 1500 1500   26 2022-11-16 01:52 robots.txt*
drwxr-xr-x  3 1500 1500 4.0K 2022-11-17 09:09 storage/
drwxr-xr-x  2 1500 1500 4.0K 2022-11-16 01:58 svg/
drwxr-xr-x  7 1500 1500 4.0K 2022-11-16 01:59 vendor/
-rwxr-xr-x  1 1500 1500    7 2022-11-17 08:37 version*
-rwxr-xr-x  1 1500 1500  114 2022-11-16 01:52 version.json*

from inside the app container

~ $ pwd
/var/www/app
~ $ ll
total 1536
drwxr-sr-x    1 invoicen invoicen      4096 Nov 17 20:46 ./
drwxr-xr-x    1 root     root          4096 Nov 16 09:00 ../
-rw-------    1 invoicen invoicen       106 Nov 17 20:48 .ash_history
-rw-rw-r--    1 invoicen invoicen        63 Nov 16 08:52 .babelrc
drwxr-sr-x    3 invoicen invoicen      4096 Nov 16 09:00 .cache/
-rw-rw-r--    1 invoicen invoicen        99 Nov 16 08:52 .codacy.yml
drwxr-sr-x    1 invoicen invoicen      4096 Nov 17 20:44 .config/
-rw-rw-r--    1 invoicen invoicen       213 Nov 16 08:52 .editorconfig
-rw-rw-r--    1 invoicen invoicen      1258 Nov 16 08:52 .env
-rw-rw-r--    1 invoicen invoicen       499 Nov 16 08:52 .env.ci
-rw-rw-r--    1 invoicen invoicen       484 Nov 16 08:52 .env.dusk.example
-rw-rw-r--    1 invoicen invoicen       461 Nov 16 08:52 .env.travis
-rw-rw-r--    1 invoicen invoicen       111 Nov 16 08:52 .gitattributes
drwxrwxr-x    3 invoicen invoicen      4096 Nov 16 08:58 .github/
-rw-rw-r--    1 invoicen invoicen       451 Nov 16 08:52 .gitignore
-rw-rw-r--    1 invoicen invoicen      6067 Nov 16 08:52 .htaccess
drwxr-sr-x    3 invoicen invoicen      4096 Nov 16 09:00 .local/
-rw-rw-r--    1 invoicen invoicen       488 Nov 16 08:52 .php_cs
-rw-rw-r--    1 invoicen invoicen       103 Nov 16 08:52 .prettierrc
-rw-rw-r--    1 invoicen invoicen       358 Nov 16 08:52 CODE_OF_CONDUCT.md
-rw-rw-r--    1 invoicen invoicen      3891 Nov 16 08:52 LICENSE
-rw-rw-r--    1 invoicen invoicen      4223 Nov 16 08:52 README.md
-rw-rw-r--    1 invoicen invoicen         6 Nov 16 08:52 VERSION.txt
drwxrwxr-x   27 invoicen invoicen      4096 Nov 16 08:58 app/
-rw-rw-r--    1 invoicen invoicen      1686 Nov 16 08:52 artisan
drwxrwxr-x    1 invoicen invoicen      4096 Nov 16 08:58 bootstrap/
-rw-rw-r--    1 invoicen invoicen        55 Nov 16 08:52 codecov.yml
-rw-rw-r--    1 invoicen invoicen      5149 Nov 16 08:52 composer.json
-rw-rw-r--    1 invoicen invoicen    612557 Nov 16 08:52 composer.lock
drwxrwxr-x    2 invoicen invoicen      4096 Nov 16 08:58 config/
drwxrwxr-x    6 invoicen invoicen      4096 Nov 16 08:58 database/
-rw-rw-r--    1 invoicen invoicen      1703 Nov 16 08:52 dusk.sh
drwxrwxr-x   40 invoicen invoicen      4096 Nov 16 08:58 lang/
-rw-rw-r--    1 invoicen invoicen        21 Nov 16 08:52 modules_statuses.json
drwxr-xr-x    2 invoicen invoicen      4096 Nov 16 08:58 node_modules/
-rw-rw-r--    1 invoicen invoicen    751950 Nov 16 08:58 package-lock.json
-rw-rw-r--    1 invoicen invoicen      1056 Nov 16 08:52 package.json
-rw-rw-r--    1 invoicen invoicen      1295 Nov 16 08:52 phpunit.xml
-rw-rw-r--    1 invoicen invoicen      2827 Nov 16 08:52 phpunit.yml
-rw-rw-r--    1 invoicen invoicen      3171 Nov 16 08:52 preload.php
-rw-rw-r--    1 invoicen invoicen      2411 Nov 16 08:52 psalm.xml
drwxr-xr-x   13 invoicen invoicen      4096 Nov 17 15:51 public/
drwxrwxr-x    5 invoicen invoicen      4096 Nov 16 08:58 resources/
drwxrwxr-x    2 invoicen invoicen      4096 Nov 16 08:58 routes/
drwxrwxrwx    5 invoicen invoicen      4096 Nov 17 15:37 storage/
-rw-rw-r--    1 invoicen invoicen       632 Nov 16 08:52 tailwind.config.js
drwxr-sr-x   90 invoicen invoicen      4096 Nov 16 09:01 vendor/
-rw-rw-r--    1 invoicen invoicen      5994 Nov 16 08:52 webpack.mix.js
~ $ 
~ $ 
~ $ 
~ $ ll public/
total 108080
drwxr-xr-x   13 invoicen invoicen      4096 Nov 17 15:51 ./
drwxr-sr-x    1 invoicen invoicen      4096 Nov 17 20:46 ../
-rwxr-xr-x    1 invoicen invoicen         1 Nov 17 15:31 .keep*
drwxr-xr-x    7 invoicen invoicen      4096 Nov 16 08:58 assets/
drwxr-xr-x    3 invoicen invoicen      4096 Nov 16 08:58 canvaskit/
drwxr-xr-x    2 invoicen invoicen      4096 Nov 16 08:59 css/
-rwxr-xr-x    1 invoicen invoicen     15086 Nov 16 08:52 favicon.ico*
-rwxr-xr-x    1 invoicen invoicen      2700 Nov 16 08:52 favicon.png*
-rwxr-xr-x    1 invoicen invoicen      6458 Nov 16 08:52 flutter.js*
-rwxr-xr-x    1 invoicen invoicen     32767 Nov 16 08:52 flutter_service_worker.js*
drwxr-xr-x    2 invoicen invoicen      4096 Nov 16 08:58 icons/
drwxr-xr-x    6 invoicen invoicen      4096 Nov 16 08:58 images/
-rwxr-xr-x    1 invoicen invoicen      1850 Nov 16 08:52 index.php*
drwxr-xr-x    5 invoicen invoicen      4096 Nov 16 08:58 js/
drwxr-xr-x    2 invoicen invoicen      4096 Nov 16 08:58 logo/
-rwxr-xr-x    1 invoicen invoicen  10752305 Nov 16 08:52 main.dart.js*
-rwxr-xr-x    1 invoicen invoicen   7807485 Nov 16 08:52 main.dart.js.map*
-rwxr-xr-x    1 invoicen invoicen  10675018 Nov 16 08:52 main.foss.dart.js*
-rwxr-xr-x    1 invoicen invoicen   7807485 Nov 16 08:52 main.foss.dart.js.map*
-rwxr-xr-x    1 invoicen invoicen   8507539 Nov 16 08:52 main.foss.wasm.dart.js*
-rwxr-xr-x    1 invoicen invoicen   9364697 Nov 16 08:52 main.html.dart.js*
-rwxr-xr-x    1 invoicen invoicen   8710504 Nov 16 08:52 main.last.dart.js*
-rwxr-xr-x    1 invoicen invoicen   9594158 Nov 16 08:52 main.next.dart.js*
-rwxr-xr-x    1 invoicen invoicen  28641040 Nov 16 08:52 main.profile.dart.js*
-rwxr-xr-x    1 invoicen invoicen   8635713 Nov 16 08:52 main.wasm.dart.js*
-rwxr-xr-x    1 invoicen invoicen       721 Nov 16 08:52 manifest.json*
-rwxr-xr-x    1 invoicen invoicen      5615 Nov 16 08:59 mix-manifest.json*
drwxr-xr-x    2 invoicen invoicen      4096 Nov 16 08:58 react/
-rwxr-xr-x    1 invoicen invoicen        26 Nov 16 08:52 robots.txt*
drwxr-xr-x    3 invoicen invoicen      4096 Nov 17 16:09 storage/
drwxr-xr-x    2 invoicen invoicen      4096 Nov 16 08:58 svg/
drwxr-xr-x    7 invoicen invoicen      4096 Nov 16 08:59 vendor/
-rwxr-xr-x    1 invoicen invoicen         7 Nov 17 15:37 version*
-rwxr-xr-x    1 invoicen invoicen       114 Nov 16 08:52 version.json*

docker log

2022-11-17T20:44:04Z [INFO] [Entrypoint]: Initialising Invoice Ninja...
   INFO  Configuration cached successfully.  
   INFO  Caching the framework bootstrap files.  
  config .......................................................... 137ms DONE
  routes ........................................................... 70ms DONE
   INFO  Nothing to migrate.  
2022-11-17 20:44:07,835 WARN For [program:php-fpm], redirect_stderr=true but stderr_logfile has also been set to a filename, the filename has been ignored
2022-11-17 20:44:07,835 WARN For [program:scheduler], redirect_stderr=true but stderr_logfile has also been set to a filename, the filename has been ignored
2022-11-17 20:44:07,835 WARN For [program:queue-worker], redirect_stderr=true but stderr_logfile has also been set to a filename, the filename has been ignored
2022-11-17 20:44:07,835 WARN For [program:queue-worker], redirect_stderr=true but stderr_logfile has also been set to a filename, the filename has been ignored
2022-11-17 20:44:07,837 INFO supervisord started with pid 1
2022-11-17 20:44:08,840 INFO spawned: 'shutdown' with pid 75
2022-11-17 20:44:08,842 INFO spawned: 'php-fpm' with pid 76
2022-11-17 20:44:08,844 INFO spawned: 'queue-worker_00' with pid 77
2022-11-17 20:44:08,846 INFO spawned: 'queue-worker_01' with pid 78
2022-11-17 20:44:08,848 INFO spawned: 'scheduler' with pid 79
READY
[17-Nov-2022 20:44:08] NOTICE: [pool www] 'user' directive is ignored when FPM is not running as root
[17-Nov-2022 20:44:08] NOTICE: [pool www] 'user' directive is ignored when FPM is not running as root
[17-Nov-2022 20:44:08] NOTICE: [pool www] 'group' directive is ignored when FPM is not running as root
[17-Nov-2022 20:44:08] NOTICE: [pool www] 'group' directive is ignored when FPM is not running as root
[17-Nov-2022 20:44:08] NOTICE: fpm is running, pid 76
[17-Nov-2022 20:44:08] NOTICE: ready to handle connections
   INFO  Processing jobs from the [default] queue.  
   INFO  Processing jobs from the [default] queue.  
   INFO  Running schedule tasks every minute.  
2022-11-17 20:44:10,437 INFO success: shutdown entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2022-11-17 20:44:10,437 INFO success: php-fpm entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2022-11-17 20:44:10,438 INFO success: queue-worker_00 entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2022-11-17 20:44:10,438 INFO success: queue-worker_01 entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2022-11-17 20:44:10,438 INFO success: scheduler entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
172.25.0.4 -  17/Nov/2022:20:44:19 +0000 "GET /index.php" 200
172.25.0.4 -  17/Nov/2022:20:44:22 +0000 "POST /index.php" 200
172.25.0.4 -  17/Nov/2022:20:44:52 +0000 "GET /index.php" 200
172.25.0.4 -  17/Nov/2022:20:44:52 +0000 "POST /index.php" 200
  2022-11-17 20:45:00 Running [App\Jobs\Ninja\QueueSize] ........... 34ms DONE
  2022-11-17 20:45:00 Running [Callback] ........................... 26ms DONE
172.25.0.4 -  17/Nov/2022:20:45:01 +0000 "POST /index.php" 200
  2022-11-17 20:45:03 App\Jobs\Ninja\QueueSize .................. 13.39ms DONE
172.25.0.4 -  17/Nov/2022:20:45:18 +0000 "POST /index.php" 200
  2022-11-17 20:45:21 App\Jobs\Entity\EmailEntity .............. 393.63ms DONE
  2022-11-17 20:45:21 App\Listeners\Mail\MailSentListener ....... 10.45ms DONE
  2022-11-17 20:45:24 App\Listeners\Quote\QuoteEmailActivity .... 31.78ms DONE
  2022-11-17 20:45:24 App\Listeners\Quote\QuoteEmailedNotification  59.30ms DONE
   INFO  No scheduled commands are ready to run.  
172.25.0.4 -  17/Nov/2022:20:46:27 +0000 "POST /index.php" 200
   INFO  No scheduled commands are ready to run.  
   INFO  No scheduled commands are ready to run.  
   INFO  No scheduled commands are ready to run.  
  2022-11-17 20:50:00 Running [App\Jobs\Ninja\QueueSize] ........... 27ms DONE
  2022-11-17 20:50:00 Running [Callback] ........................... 10ms DONE
  2022-11-17 20:50:00 App\Jobs\Ninja\QueueSize ................... 6.97ms DONE
172.25.0.4 -  17/Nov/2022:20:50:42 +0000 "POST /index.php" 200
172.25.0.4 -  17/Nov/2022:20:50:46 +0000 "POST /index.php" 200
  2022-11-17 20:50:48 App\Jobs\Entity\EmailEntity .............. 389.58ms DONE
  2022-11-17 20:50:49 App\Listeners\Mail\MailSentListener ........ 9.10ms DONE
  2022-11-17 20:50:52 App\Listeners\Quote\QuoteEmailActivity .... 18.97ms DONE
  2022-11-17 20:50:52 App\Listeners\Quote\QuoteEmailedNotification  51.98ms DONE
   INFO  No scheduled commands are ready to run.  
172.25.0.4 -  17/Nov/2022:20:51:13 +0000 "POST /index.php" 200
172.25.0.4 -  17/Nov/2022:20:51:14 +0000 "POST /index.php" 200
  2022-11-17 20:51:16 App\Jobs\Entity\EmailEntity .............. 280.10ms DONE
  2022-11-17 20:51:16 App\Listeners\Mail\MailSentListener ....... 10.64ms DONE
  2022-11-17 20:51:19 App\Listeners\Quote\QuoteEmailActivity .... 18.85ms DONE
  2022-11-17 20:51:19 App\Listeners\Quote\QuoteEmailedNotification  45.32ms DONE
172.25.0.4 -  17/Nov/2022:20:51:34 +0000 "POST /index.php" 200
172.25.0.4 -  17/Nov/2022:20:51:35 +0000 "POST /index.php" 200
  2022-11-17 20:51:37 App\Jobs\Entity\EmailEntity .............. 308.38ms DONE
  2022-11-17 20:51:37 App\Listeners\Mail\MailSentListener ........ 9.03ms DONE
  2022-11-17 20:51:40 App\Listeners\Quote\QuoteEmailActivity .... 19.40ms DONE
  2022-11-17 20:51:40 App\Listeners\Quote\QuoteEmailedNotification  53.36ms DONE
   INFO  No scheduled commands are ready to run.  
   INFO  No scheduled commands are ready to run.  
   INFO  No scheduled commands are ready to run.  
turbo124 commented 1 year ago

you may want to inspect the logs in storage/logs/laravel.log

The PDF generation issue may also be effecting the email issue, my guess is that both issues are linked.

The most likely reason for PDF generation failing is a permissions issue writing to disk.

tonydm commented 1 year ago

Thanks @turbo124

I don't see anything in the storage/logs/laravel.log that reveals any kind of error. It appears to be a valid email object.

I looked for any additional logs to review but only find the one you referenced.

~ $ pwd
/var/www/app
~ $ find ./ -type f -name '*log'
./storage/logs/laravel.log
~ $ 
~/storage/logs $ pwd
/var/www/app/storage/logs
~/storage/logs $ 
~/storage/logs $ tail -f laravel.log 
            </table>
        </td>
    </tr>
</table>
</body>
=

</html>
--tmEL_dvr--

[2022-11-17 20:59:59] production.DEBUG: From: Billing <user@email_domain>
To: testemail@my_domain
Reply-To: Billing <user@email_domain>
Subject: New quote 1006 from Untitled Company
X-Tag: vYjebKjrwLVLtVnRZQHQuTK0FCIGC7A2
x-invitation: cktYCymb8CG3kB8vjf3MhS2p9ik6Fou5
MIME-Version: 1.0
Date: Thu, 17 Nov 2022 20:59:59 +0000
Message-ID: <60a3c223e86cc335ec3d819c3af05c4d@gmail.com>
Content-Type: multipart/alternative; boundary=O6KpjR0o

--O6KpjR0o
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

To view your quote for $810.00, click the link below.

http://inv.netal=
d.com/client/quote/cktYCymb8CG3kB8vjf3MhS2p9ik6Fou5
       =20
Created by=
 https://invoiceninja.com | Create. Send. Get Paid.

--O6KpjR0o
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE html
    PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http:=
//www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns=3D"http:=
//www.w3.org/1999/xhtml" lang=3D"en-US">

<head>
    <meta http-equiv=
=3D"Content-Type" content=3D"text/html; charset=3DUTF-8"/>
    <meta name=
=3D"viewport" content=3D"width=3Ddevice-width, initial-scale=3D1.0"/>
   =
 <meta name=3D"color-scheme" content=3D"light dark">
    <meta name=3D"su=
pported-color-schemes" content=3D"light dark">

    <style>
        @=
import url("https://use.typekit.net/zxn7pho.css");
    </style>

    =
<style type=3D"text/css">
        :root {
            color-scheme: lig=
ht dark;
            supported-color-schemes: light dark;
        }
 =
                /** Content-specific styles. **/
        #content .button=
 {
            display: inline-block;
            background-color: #29=
8AAB;
            color: #ffffff;
            text-transform: uppercase=
;
            letter-spacing: 2px;
            text-decoration: none;=

            font-size: 13px;
            padding: 15px 50px;
       =
     font-weight: 600;
            margin-bottom: 30px;
        }
   =
     #content h1 {
            font-family: 'canada-type-gibson', 'roboto=
', Arial, Helvetica, sans-serif;
            font-weight: 600;
        =
    font-size: 32px;
            margin-top: 20px;
            margin-b=
ottom: 30px;
        }
        #content > p {
            font-size: =
16px;
            font-family: 'roboto', Arial, Helvetica, sans-serif;
=
            font-weight: 500;
        }
        #content .center {
  =
          text-align: center;
        }
        #content .left {
    =
        text-align: left !important;
        }
    </style>

    <!=
--[if gte mso 9]>
    <xml>
        <o:OfficeDocumentSettings>
      =
  <o:AllowPNG/>
        <o:PixelsPerInch>96</o:PixelsPerInch>
        <=
/o:OfficeDocumentSettings>
    </xml>
    <![endif]-->
</head>

<=
body
    style=3D"margin: 0; padding: 0; font-family: 'roboto', Arial, He=
lvetica, sans-serif; color: #3b3b3b;-webkit-font-smoothing: antialiased; -m=
oz-osx-font-smoothing: grayscale;">
<table role=3D"presentation" border=
=3D"0" cellpadding=3D"0" cellspacing=3D"0" width=3D"100%">
    <tr>
   =
     <td>
            <table align=3D"center" border=3D"0" cellpadding=3D=
"0" cellspacing=3D"0" width=3D"570"
                   style=3D"border-co=
llapse: collapse;" class=3D"dark-bg-base">
                <tr>
       =
             <div style=3D"text-align: center;margin-top: 25px; margin-bott=
om: 10px;"></div>
                </tr>
                <tr>
        =
            <td align=3D"center" cellpadding=3D"20">
                    =
    <div style=3D"border: 1px solid #c2c2c2; border-bottom: none; padding-b=
ottom: 10px; border-top-left-radius: 3px; border-top-right-radius: 3px;">=

                            <!--[if gte mso 9]>
                   =
         <img src=3D"https://billing.<my_domain>>/storage/vYjebKjrwLVLtVnRZQHQuTK0=
FCIGC7A2/xytCDIRkhN07SiyygkZJ3DurjAJFwnIKRsE4D7xK.png" alt=3D"" width=3D"40=
0" border=3D"0" align=3D"middle" style=3D"display:block;" />
            =
                <div style=3D"mso-hide:all;">
                           =
 <![endif]-->
                            <img src=3D"https://billing.<my_domain>.c=
om/storage/vYjebKjrwLVLtVnRZQHQuTK0FCIGC7A2/xytCDIRkhN07SiyygkZJ3DurjAJFwnI=
KRsE4D7xK.png" alt=3D"" width=3D"400" style=3D"margin-top: 40px; max-width:=
 200px; display: block; margin-left: auto; margin-right: auto;"/>
       =
                     <!--[if gte mso 9]>
                            </di=
v>
                            <![endif]-->

                        =
</div>
                    </td>
                </tr>
              =
  <tr>
                    <td cellpadding=3D"20">
                    =
    <div style=3D"border: 1px solid #c2c2c2; border-top: none; border-botto=
m: none; padding: 20px; text-align: center" id=3D"content">
             =
                   <div style=3D"padding-top: 10px;"></div>

          =
                     =20
                                <p>Contractors Ser=
vices, LLC<br><br>To view your quote for $810.00, click the link below.</p>=
<div class=3D"center"><a class=3D"button" href=3D"https://billing.<my_domain>>/cli=
ent/quote/cktYCymb8CG3kB8vjf3MhS2p9ik6Fou5">View Quote</a></div>

  =
                              <div>
                                    <=
a href=3D"#"
                                        style=3D"display: in=
line-block;background-color: #298AAB; color: #ffffff; text-transform: upper=
case;letter-spacing: 2px; text-decoration: none; font-size: 13px; font-weig=
ht: 600;">
                                    </a>
                   =
             </div>
                           </div>
                 =
   </td>
                </tr> =20
               =20
                <tr=
>
                  <td height=3D"20">
                   <div style=3D=
"border: 1px solid #c2c2c2; border-top: none; border-bottom: none; padding:=
 20px; text-align: center" id=3D"content"> </div>
                 </td>=

                </tr>

                <tr>
                    <t=
d cellpadding=3D"20" bgcolor=3D"#f9f9f9">
                        <div cl=
ass=3D"dark-bg dark-text-white"
                             style=3D"tex=
t-align: center; padding-top: 10px; padding-bottom: 25px; background-color:=
 #f9f9f9; border: 1px solid #c2c2c2; border-top: none; border-bottom-color:=
 #f9f9f9;">
                                                            <=
p style=3D"font-size: 15px; color: #2e2e2e; font-family: 'roboto', Arial, H=
elvetica, sans-serif; font-weight: 400; margin-bottom: 30px;">
          =
                         =20
                                </p>
       =
                    =20
                                                   =
         <p style=3D"font-size: 15px; color: #2e2e2e; font-family: 'roboto'=
, Arial, Helvetica, sans-serif; font-weight: 500; margin-bottom:0;">
    =
                                Untitled Company</p>
                    =
            <p style=3D"font-size: 15px; color: #2e2e2e; font-family: 'robo=
to', Arial, Helvetica, sans-serif; font-weight: 400; margin-top: 5px;">
 =
                                   <span>928-237-0138</span>
            =
                        <span style=3D"font-weight: 500"> </span>
       =
                         </p>
                                           =
         </div>
                    </td>
                </tr>

  =
              <tr>
                    <td bgcolor=3D"#242424"  cellpaddi=
ng=3D"20">
                        <div class=3D"dark-bg-base"
        =
                     style=3D"padding-top: 10px;padding-bottom: 10px; backg=
round-color: #242424; border: 1px solid #c2c2c2; border-top-color: #242424;=
 border-bottom-color: #242424;">
                                        =
                                                        <p style=3D"text-al=
ign: center; color: #ffffff; font-size: 10px; font-family: Verdana, Geneva,=
 Tahoma, sans-serif;">
                                        =C2=A9 202=
2 Invoice Ninja, All Rights Reserved
                                    =
</p>
                                                                    =
                </div>
                    </td>
                </tr>=

            </table>
        </td>
    </tr>
</table>
</body>
=

</html>
--O6KpjR0o--
tonydm commented 1 year ago

gentle nudge

turbo124 commented 1 year ago

@tonydm

is your mail_mailer set to log?

tonydm commented 1 year ago

Looking back at the config I posted it looks like I do... If so, what log filename would I find it? As I indicated, I searched for any file ending in log but found only the laravel.log file

# Mail options
MAIL_MAILER=log
~ $ pwd
/var/www/app
~ $ find ./ -type f -name '*log'
./storage/logs/laravel.log
~ $ 
turbo124 commented 1 year ago

ok, so updating to smtp should resolve this

tonydm commented 1 year ago

I'm sorry, please forgive, but I don't follow... Updating what to smtp? If referring to my invoiceninja env file config, it already has smtp configured. I've obfuscated the sensitive information, but I've tested the credentials against the Google App password I set up for this app.

# Mail options
MAIL_MAILER=log
MAIL_HOST=smtp.gmail.com
MAIL_PORT=587
MAIL_USERNAME=<email_address>
MAIL_PASSWORD=<email_password>
MAIL_ENCRYPTION=tls
MAIL_FROM_ADDRESS=<from_email_address>
MAIL_FROM_NAME='<from_name>'
turbo124 commented 1 year ago

your mail driver is configure to LOG, which is why you are seeing the email output in your log file, you need to change from:

MAIL_MAILER=log

to

MAIL_MAILER=smtp