Not send email. Stoped after work fine

After a few days running, I have noticed that clients have stopped sending emails.
Scenery

  • I use a domain hosted with Google for mail.
  • I have activated the debug to true.
  • I’ve reviewed the logs.

No mistake.
Whenever I say to send an email, it says Sent, but the email doesn’t come out, it doesn’t issue an error in the log, and it doesn’t issue an error in the app either.

It’s a silent death that I never thought possible in a Laravel app.

I feel desperate because all the ways I know to do a debug have not served me at all and since it is an external service (google) I cannot see the mail server logs.

Hi,

Are there any errors in the system log on the dashboard in the app or are there unprocessed jobs in the queue.

Sorry…

Thanks for your reply

I always forget that the logs should be looked at in the dashboard. I am used to looking for it in storage/logs7*

But nothing appears either.

When I have reviewed the dates I have seen that the question should be in the queues.

Upgrade to Redis the .env file

But I forgot the supervisor. Now it is installed but something tells me that my configuration must be wrong

When I check the supervisor I see

supervisorctl status
ninja:ninja_00 FATAL Exited too quickly (process log may have details)
ninja:ninja_01 FATAL Exited too quickly (process log may have details)
ninja:ninja_02 FATAL Exited too quickly (process log may have details)
ninja:ninja_03 FATAL Exited too quickly (process log may have details)
ninja:ninja_04 FATAL Exited too quickly (process log may have details)
ninja:ninja_05 FATAL Exited too quickly (process log may have details)
ninja:ninja_06 FATAL Exited too quickly (process log may have details)
ninja:ninja_07 FATAL Exited too quickly (process log may have details)

When I check the log worker.log (I still don’t see anything in my app interface)

 thrown in /home/aichaes/public_html/invoiceninja/vendor/laravel/framework/src/Illuminate/Database/Connection.php on line 1591
PHP Fatal error: Uncaught Error: Class "PDO" not found in /home/aichaes/public_html/invoiceninja/vendor/laravel/framework/src/Illuminate/Database/Connection.php:1591
Stack trace:
#0 /home/aichaes/public_html/invoiceninja/vendor/laravel/framework/src/Illuminate/Database/Connectors/ConnectionFactory.php(265): Illuminate\Database\Connection::getResolver()
#1 /home/aichaes/public_html/invoiceninja/vendor/laravel/framework/src/Illuminate/Database/Connectors/ConnectionFactory.php(76): Illuminate\Database\Connectors\ConnectionFactory->createConnection()
#2 /home/aichaes/public_html/invoiceninja/vendor/laravel/framework/src/Illuminate/Database/Connectors/ConnectionFactory.php(50): Illuminate\Database\Connectors\ConnectionFact

If I go to the supervisor log

2023-06-22 11:24:27,469 INFO Included extra file "/etc/supervisord.d/clientes.aicha.es.conf" during parsing
2023-06-22 11:24:27,469 INFO Set uid to user 0 succeeded
2023-06-22 11:24:27,488 INFO RPC interface 'supervisor' initialized
2023-06-22 11:24:27,488 CRIT Server 'unix_http_server' running without any HTTP authentication checking
2023-06-22 11:24:27,489 INFO daemonizing the supervisord process
2023-06-22 11:24:27,490 INFO supervisord started with pid 3165566
2023-06-22 11:24:28,492 INFO spawned: 'ninja_03' with pid 3165590
2023-06-22 11:24:28,494 INFO spawned: 'ninja_02' with pid 3165591
2023-06-22 11:24:28,496 INFO spawned: 'ninja_01' with pid 3165592
2023-06-22 11:24:28,498 INFO spawned: 'ninja_00' with pid 3165593
2023-06-22 11:24:28,500 INFO spawned: 'ninja_07' with pid 3165594
2023-06-22 11:24:28,502 INFO spawned: 'ninja_06' with pid 3165595
2023-06-22 11:24:28,504 INFO spawned: 'ninja_05' with pid 3165596
2023-06-22 11:24:28,506 INFO spawned: 'ninja_04' with pid 3165597
2023-06-22 11:24:28,543 INFO exited: ninja_06 (exit status 255; not expected)
2023-06-22 11:24:28,544 INFO exited: ninja_03 (exit status 255; not expected)
2023-06-22 11:24:28,554 INFO exited: ninja_01 (exit status 255; not expected)
2023-06-22 11:24:28,555 INFO exited: ninja_05 (exit status 255; not expected)
2023-06-22 11:24:28,556 INFO exited: ninja_04 (exit status 255; not expected)
2023-06-22 11:24:28,559 INFO exited: ninja_02 (exit status 255; not expected)
2023-06-22 11:24:28,561 INFO exited: ninja_00 (exit status 255; not expected)
2023-06-22 11:24:28,565 INFO exited: ninja_07 (exit status 255; not expected)

I have tried two approaches on my server

Using the full php path for that user which returns an error below

#19 [internal function]: Illuminate\Foundation\Bootstrap\HandleExceptions->Illuminate\Foundation\Bootstrap\{closure}()
#20 {main}
   thrown in /home/aichaes/public_html/invoiceninja/vendor/laravel/framework/src/Illuminate/Database/Connection.php on line 1591
PHP Fatal error: Uncaught Error: Class "PDO" not found in /home/aichaes/public_html/invoiceninja/vendor/laravel/framework/src/Illuminate/Database/Connection.php:1591
Stack trace:
#0 /home/aichaes/public_html/invoiceninja/vendor/laravel/framework/src/Illuminate/Database/

and the other using the system path

Your Composer dependencies require a PHP version ">= 8.1.2".

Status: 500 Internal Server Error
Content-type: text/html; charset=UTF-8

Composer detected issues in your platform:

Your Composer dependencies require a PHP version ">= 8.1.2".
[program:ninja]
process_name=%(program_name)s_%(process_num)02d
command=/opt/alt/php81/usr/bin/php -d register_argc_argv=On /home/aichaes/public_html/invoiceninja/artisan queue:work --sleep=3 --tries=3
;command=/usr/bin/php -d register_argc_argv=On /home/aichaes/public_html/invoiceninja/artisan queue:work --sleep=3 --tries=3
autostart=true
autorestart=true
user=aichaes
numprocs=8
redirect_stderr=true
stdout_logfile=/home/aichaes/public_html/invoiceninja/storage/logs/worker.log
stopwaitsecs=3600

I’m sorry for the delay but I’m traveling in Morocco and I had no coverage

Thanks.

These look like two different errors.

Class "PDO" not found usually means the needed PHP extensions, in this case for pdo/mysql haven’t been enabled, You can setup a phpinfo page to check your server’s config.

Composer dependencies require a PHP version means your using a lower version of PHP than needed. You can run php -v to check the server version.

I forget put shell information

cron

* * * * * cd /home/aichaes/public_html/invoiceninja && /usr/bin/php -d register_argc_argv=On artisan schedule:run >> /dev/null 2>&1

Result on shell

cd /home/aichaes/public_html/invoiceninja && /usr/bin/php -d register_argc_argv=On artisan schedule:run

cd /home/aichaes/public_html/invoiceninja && /usr/bin/php -d register_argc_argv=On artisan schedule:run

   INFO  No scheduled commands are ready to run.

X-Powered-By: PHP/8.1.18
Content-type: text/html; charset=UTF-8


  0   0  * * *  App\Jobs\Util\VersionCheck ...................................................................................................................................................................................... Next Due: 17 hours from now
  10  2  * * *  Closure at: vendor/laravel/framework/src/Illuminate/Console/Scheduling/Schedule.php:150 ......................................................................................................................... Next Due: 19 hours from now
  0   *  * * *  Closure at: vendor/laravel/framework/src/Illuminate/Console/Scheduling/Schedule.php:150 ....................................................................................................................... Next Due: 19 minutes from now
  */5 *  * * *  Closure at: vendor/laravel/framework/src/Illuminate/Console/Scheduling/Schedule.php:150 ........................................................................................................................ Next Due: 4 minutes from now
  20  23 * * *  Closure at: vendor/laravel/framework/src/Illuminate/Console/Scheduling/Schedule.php:150 ......................................................................................................................... Next Due: 16 hours from now
  30  23 * * *  Closure at: vendor/laravel/framework/src/Illuminate/Console/Scheduling/Schedule.php:150 ......................................................................................................................... Next Due: 16 hours from now
  1   0  * * *  Closure at: vendor/laravel/framework/src/Illuminate/Console/Scheduling/Schedule.php:150 ......................................................................................................................... Next Due: 17 hours from now
  0   *  * * *  Closure at: vendor/laravel/framework/src/Illuminate/Console/Scheduling/Schedule.php:150 ....................................................................................................................... Next Due: 19 minutes from now
  30  *  * * *  Closure at: vendor/laravel/framework/src/Illuminate/Console/Scheduling/Schedule.php:150 ....................................................................................................................... Next Due: 49 minutes from now
  10  0  * * *  Closure at: vendor/laravel/framework/src/Illuminate/Console/Scheduling/Schedule.php:150 ......................................................................................................................... Next Due: 17 hours from now
  10  5  * * *  Closure at: vendor/laravel/framework/src/Illuminate/Console/Scheduling/Schedule.php:150 ......................................................................................................................... Next Due: 22 hours from now
  0   7  * * *  Closure at: vendor/laravel/framework/src/Illuminate/Console/Scheduling/Schedule.php:150 ....................................................................................................................... Next Due: 19 minutes from now
  20  6  * * *  Closure at: vendor/laravel/framework/src/Illuminate/Console/Scheduling/Schedule.php:150 ......................................................................................................................... Next Due: 23 hours from now
  10  1  * * *  App\Jobs\Util\SchedulerCheck .................................................................................................................................................................................... Next Due: 18 hours from now
  10  *  * * *  Closure at: vendor/laravel/framework/src/Illuminate/Console/Scheduling/Schedule.php:150 ....................................................................................................................... Next Due: 29 minutes from now
  30  2  * * 0  Closure at: vendor/laravel/framework/src/Illuminate/Console/Scheduling/Schedule.php:150 ............................................................................................................................ Next Due: 1 day from now
  */5 *  * * *  Closure at: app/Console/Kernel.php:97 .......................................................................................................................................................................... Next Due: 4 minutes from now

php cli on shell

This php info show that PDO is installed on shell for the user.

 /usr/bin/php -i | grep pdo
<tr><td class="e">Configure Command </td><td class="v"> &#039;./configure&#039;  &#039;--disable-dependency-tracking&#039; &#039;--prefix=/usr&#039; &#039;--exec-prefix=/usr&#039; &#039;--bindir=/usr/bin&#039; &#039;--sbindir=/usr/sbin&#039; &#039;--sysconfdir=/etc&#039; &#039;--datadir=/usr/share&#039; &#039;--includedir=/usr/include&#039; &#039;--libdir=/usr/lib64&#039; &#039;--libexecdir=/usr/libexec&#039; &#039;--sharedstatedir=/var/lib&#039; &#039;--mandir=/usr/share/man&#039; &#039;--infodir=/usr/share/info&#039; &#039;--build=x86_64-redhat-linux-gnu&#039; &#039;--host=x86_64-redhat-linux-gnu&#039; &#039;--target=x86_64-redhat-linux-gnu&#039; &#039;--program-prefix=&#039; &#039;--prefix=/opt/alt/php81&#039; &#039;--exec-prefix=/opt/alt/php81&#039; &#039;--bindir=/opt/alt/php81/usr/bin&#039; &#039;--sbindir=/opt/alt/php81/usr/sbin&#039; &#039;--sysconfdir=/opt/alt/php81/etc&#039; &#039;--datadir=/opt/alt/php81/usr/share&#039; &#039;--includedir=/opt/alt/php81/usr/include&#039; &#039;--libdir=/opt/alt/php81/usr/lib64&#039; &#039;--libexecdir=/opt/alt/php81/usr/libexec&#039; &#039;--localstatedir=/var&#039; &#039;--sharedstatedir=/usr/com&#039; &#039;--mandir=/opt/alt/php81/usr/share/man&#039; &#039;--infodir=/opt/alt/php81/usr/share/info&#039; &#039;--cache-file=../config.cache&#039; &#039;--with-libdir=lib64&#039; &#039;--with-config-file-path=/opt/alt/php81/etc&#039; &#039;--with-config-file-scan-dir=/opt/alt/php81/link/conf&#039; &#039;--disable-debug&#039; &#039;--enable-calendar&#039; &#039;--enable-exif&#039; &#039;--enable-ftp&#039; &#039;--enable-huge-code-pages&#039; &#039;--enable-jit&#039; &#039;--enable-shmop&#039; &#039;--enable-xml&#039; &#039;--with-bz2&#039; &#039;--with-freetype=/usr&#039; &#039;--with-gettext&#039; &#039;--with-gmp=shared&#039; &#039;--with-iconv&#039; &#039;--with-jpeg=/usr&#039; &#039;--with-layout=GNU&#039; &#039;--with-mhash&#039; &#039;--with-password-argon2=/usr&#039; &#039;--with-pcre-jit&#039; &#039;--with-pic&#039; &#039;--with-readline&#039; &#039;--with-webp=/opt/alt/libwebp&#039; &#039;--with-xpm=/usr&#039; &#039;--with-zlib&#039; &#039;--with-zlib-dir=/usr&#039; &#039;--without-gdbm&#039; &#039;--without-pear&#039; &#039;--with-curl=/opt/alt/curlssl11/usr&#039; &#039;--with-openssl-dir=/opt/alt/openssl11&#039; &#039;--with-openssl=/opt/alt/openssl11&#039; &#039;--with-pcre-dir=/opt/alt/pcre2&#039; &#039;--with-kerberos=/opt/alt/krb5/usr&#039; &#039;--enable-bcmath=shared&#039; &#039;--enable-dba=shared&#039; &#039;--with-db4=/usr&#039; &#039;--enable-dom=shared&#039; &#039;--enable-fileinfo=shared&#039; &#039;--enable-gd=shared&#039; &#039;--enable-intl=shared&#039; &#039;--enable-json=shared&#039; &#039;--enable-mbregex&#039; &#039;--enable-mbstring=shared&#039; &#039;--enable-opcache&#039; &#039;--enable-pcntl&#039; &#039;--enable-pdo=shared&#039; &#039;--enable-phar=shared&#039; &#039;--enable-posix=shared&#039; &#039;--enable-soap=shared&#039; &#039;--enable-sockets=shared&#039; &#039;--enable-sysvsem=shared&#039; &#039;--enable-sysvshm=shared&#039; &#039;--enable-sysvmsg=shared&#039; &#039;--enable-xmlreader=shared&#039; &#039;--enable-xmlwriter=shared&#039; &#039;--with-enchant=shared,/usr&#039; &#039;--with-external-gd&#039; &#039;--with-gnu-ld=yes&#039; &#039;--with-pdo-odbc=shared,unixODBC,/usr&#039; &#039;--with-pspell=shared&#039; &#039;--with-tidy=shared,/usr&#039; &#039;--with-unixODBC=shared,/usr&#039; &#039;--with-zip=shared&#039; &#039;--with-pdo-pgsql=shared,/opt/alt/postgresql11/usr&#039; &#039;--with-pgsql=shared,/opt/alt/postgresql11/usr&#039; &#039;--with-imap=shared,/opt/alt/libc-client11&#039; &#039;--with-imap-ssl=/opt/alt/openssl11&#039; &#039;--with-ldap=shared,/opt/alt/openldap11&#039; &#039;--with-ldap-sasl&#039; &#039;--with-pdo-dblib=shared,/opt/alt/freetds11/usr&#039; &#039;--with-pdo-sqlite=shared,/opt/alt/sqlite/usr&#039; &#039;--with-snmp=shared,/opt/alt/net-snmp11/usr&#039; &#039;--with-sqlite3=/opt/alt/sqlite/usr&#039; &#039;--with-pdo-oci=shared,instantclient,/usr/lib/oracle/12.1/client64/lib&#039; &#039;--with-sodium=shared,/usr&#039; &#039;--with-ffi=shared,/usr&#039; &#039;--with-pdo-firebird=shared&#039; &#039;--with-xsl=shared,/usr&#039; &#039;build_alias=x86_64-redhat-linux-gnu&#039; &#039;host_alias=x86_64-redhat-linux-gnu&#039; &#039;target_alias=x86_64-redhat-linux-gnu&#039; &#039;PKG_CONFIG_PATH=/opt/alt/curlssl11/usr/lib64/pkgconfig:/opt/alt/openssl11/lib64/pkgconfig:/opt/alt/libicu/usr/lib64/pkgconfig:/opt/alt/sqlite/usr/lib64/pkgconfig:/opt/alt/pcre2/usr/lib64/pkgconfig:/opt/alt/libzip/usr/lib64/pkgconfig:/opt/alt/libxml2/usr/lib64/pkgconfig:/opt/alt/libgd/lib64/pkgconfig::/usr/lib64/pkgconfig:/usr/share/pkgconfig&#039; &#039;CFLAGS=-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -Dmp_bitcnt_t=long -fno-strict-aliasing -Wno-pointer-sign&#039; &#039;LDFLAGS= -Wl,-rpath=/opt/alt/libxml2/usr/lib64,-rpath=/opt/alt/libwebp/lib64 -L/opt/alt/openssl11/lib64 -L/opt/alt/libicu/usr/lib64 -L/opt/alt/libc-client11/lib64 -L/opt/alt/openldap11/lib64 -L/opt/alt/net-snmp11/usr/lib64 -L/opt/alt/libssh211/usr/lib64 -Wl,-rpath=/opt/alt/curlssl11/usr/lib64,-rpath=/opt/alt/openssl11/lib64,-rpath=/opt/alt/libicu/usr/lib64,-rpath=/opt/alt/t1lib/usr/lib64,-rpath=/opt/alt/sqlite/usr/lib64,-rpath=/opt/alt/pcre2/usr/lib64,-rpath=/opt/alt/openldap11/lib64,-rpath=/opt/alt/freetds11/usr/lib64,-rpath=/opt/alt/net-snmp11/usr/lib64,-rpath=/opt/alt/libssh211/usr/lib64,-rpath=/opt/alt/libc-client11/lib64 -L/opt/alt/nghttp2/lib64 -L/opt/alt/postgresql11/usr/lib64 -Wl,-rpath=/opt/alt/nghttp2/lib64,-rpath=/opt/alt/postgresql11/usr/lib64 -Wl,-rpath=/usr/lib64 &#039; &#039;CXXFLAGS=-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic&#039; &#039;KERBEROS_CFLAGS=-I/usr/include&#039; &#039;KERBEROS_LIBS=-L/usr/lib64&#039; &#039;WEBP_LIBS=-L/opt/alt/libwebp/lib64 -Wl,-rpath=/opt/alt/libwebp/lib64&#039; &#039;SASL_CFLAGS=-I/usr/include&#039; &#039;SASL_LIBS=-L/usr/lib64&#039; </td></tr>
<h2><a name="module_pdo">PDO</a></h2>
<h2><a name="module_pdo_mysql">pdo_mysql</a></h2>
<tr><td class="e">pdo_mysql.default_socket</td><td class="v">/var/lib/mysql/mysql.sock</td><td class="v">/var/lib/mysql/mysql.sock</td></tr>
<h2><a name="module_pdo_sqlite">pdo_sqlite</a></h2>

After this problem, I’ve changed .env QUEUE_CONNECTION from REDIS to sync

As a general rule, in my projects when I make this change, the mail delivery problems no longer go to the redis, horizon or the selected queue logs, since being synced the logs are immediate in the laravel logging system.

Well, we still don’t get any errors, neither in the dashboard nor in the Laravel log.

And of course we still do not send emails.

And of course we still don’t see any error, while the interface after 30 seconds tells us “Budget sent correctly”

On my screen three shells with their respective logs involved.

And of course, the dashbaord log system says 0.

In this state of affairs, it is quite difficult to find a fault in an application, its configuration.


@david do you have any suggestions?

As a general rule, in my projects when I make this change, the mail delivery problems no longer go to the redis, horizon or the selected queue logs, since being synced the logs are immediate in the laravel logging system.

Well, we still don’t get any errors, neither in the dashboard nor in the Laravel log.

And of course we still do not send emails.

And of course we still don’t see any error, while the interface after 30 seconds tells us “Budget sent correctly”

On my screen three shells with their respective logs involved.

And of course, the dashbaord log system says 0.

In this state of affairs, it is quite difficult to find a fault in an application, its configuration.

I have moved the installation to a server with Ubuntu 22.04, nginx, php 8.1 and 8.2 with PHP-FPM.

All requirements verified.

But nothing.

Silent error, no log data, even with debug mode enabled, I get nothing at all to investigate the error

I leave a video on the subject.

Well after a good day, I have installed invoice ninja v5 from scratch using github.

I have executed the migrations and I have started from 0 in the same url, but with a different database.

Same email data, and voila… the tests performed work.

Now thinking. Well, in theory, I have the same thing in both folders, the old one and the new one. And this is where I realize something happened in the original installation. And I think it’s the upgrade that I made from the app.

The question is that if I change to the old database from 2 weeks ago that I did the installation, also from github, where I have my first invoices, already collected, all the recurring invoices, and everything configured, I find that it seems to be something there have been changes to the tables (updates, which I don’t have)

[previous exception] [object] (PDOException(code: 42S22): SQLSTATE[42S22]: Column not found: 1054 Unknown column ‘invoice_task_item_description’ in ‘field list’ at /home/laravel/web/clientes.aicha.es/vendor /laravel/framework/src/Illuminate/Database/Connection.php:566)
[stacktrace]

I guess there is nothing on how to fix this, but it is my last attempt to continue with this software.

The last error looks like a database migration needs to be run, it may help to run php artisan migrate.