Problème avec Cron et Paheko

I have searched the forum for similar issues

on

This category is for issues regarding specific apps, NOT general issues with YunoHost.

on

This form is written in English :uk: but feel free to write in French :fr: if you’re more comfortable!

on

What type of hardware are you using

Raspberry Pi 3, 4+

What YunoHost version are you running

11.2.31

What app is this about

paheko

Describe your issue

Bonjour,
Paheko 1.3.12
je peux me connecter en SSH
Ma boite mail est envahie de message et yunohost a plus de 2000 messages en file d’attente, ces messages proviennent de paheko.
Je pense que ce message est apparu lorsque j’ai essayé d’envoyer plusieurs mails avec paheko
Je ne sais pas comment arrêter ces messages. je suis novice en linux.
J’utilise paheko pour mon association
Merci pour votre aide

Share relevant logs or error messages

Cron paheko@cbhome [ -f //home/yunohost.app/paheko/data/association.sqlite] && /var/www/paheko/bin/paheko queue run --quiet

/bin/sh: 1: [: missing ]

The bug is already fixed on testing branch, you can try it out with

sudo yunohost app upgrade paheko -u https://github.com/YunoHost-Apps/paheko_ynh/tree/testing
1 Like

I updated paheko, but yunohost crashed during installation.
I no longer have access to SSH, only to the web page.
Should I reboot yunohost manually ?

I’ve restarted yunohost and it’s ok, I’ve tried the command again with the addition --debug

sudo yunohost app upgrade paheko -u https://github.com/YunoHost-Apps/paheko_ynh/tree/testing --debug

the installation went well through, but I still have the Cron messages which have changed

Cron <paheko@cbhome> [ -f /home/yunohost.app/paheko/data/association.sqlite ] && /var/www/paheko/bin/paheko queue run --quiet
Le module de base de données SQLite3 n'est pas disponible.

I ran the command I found in the paheko docs

sudo phpenmod sqlite3
WARNING: Module sqlite3 ini file doesn't exist under /etc/php/8.3/mods-available
WARNING: Module sqlite3 ini file doesn't exist under /etc/php/8.3/mods-available
WARNING: Module sqlite3 ini file doesn't exist under /etc/php/8.1/mods-available
WARNING: Module sqlite3 ini file doesn't exist under /etc/php/8.0/mods-available
WARNING: Module sqlite3 ini file doesn't exist under /etc/php/7.4/mods-available
WARNING: Module sqlite3 ini file doesn't exist under /etc/php/7.4/mods-available

What should I do next?

Paheko is configured to use PHP 8.2 in YNH setup, I think the command in cron file should be changed to

Cron paheko@cbhome [ -f /home/yunohost.app/paheko/data/association.sqlite] && php8.2 /var/www/paheko/bin/paheko queue run --quiet

But that probably better be patched in package repo :confused:

Yes, Paheko uses PHP 8.2
These messages can’t be stopped ?
The queue (2607 emails) YNH and my mailbox fills up too.
I just have this message problem, Yunohost and Paheko work

Bonjour,
Si je désinstalle et réinstalle paheko, les messages cron s’arrêteront ?
If I uninstall and reinstall paheko, will the cron messages stop?

No, there’s a bug in the package.

I have a speculative fix, if you would be willing to test it you can

sudo yunohost app upgrade paheko -u https://github.com/YunoHost-Apps/paheko_ynh/tree/fix_cron --force

This explicitly forces cron to use PHP 8.2 (or rather, the version specified by the app during installation).

1 Like

Thanks, we haven’t seen it before… I was also surprise when using yunohost app shell paheko and trying use the command

paheko@machine:~$ bin/paheko help sql

to see the error Le module de base de données SQLite3 n'est pas disponible.

now I understood we need the flag php

paheko@machine:~$ php8.2 bin/paheko help sql
Usage: paheko sql OPTIONS… STATEMENT
Run SQL statement and display result.

Options:
  --rw
    Specify this option to allow the statement to modify the database.
    If this is absent, the statement will be executed in read-only
1 Like

This seems like a core bug as yunohost app shell SHOULD have proper PHP available with php and, by extension, with shebang #!/usr/bin/env php :thinking:

perhaps, Bowhaz told us about some fixes in next release… perhaps also because the app is using sqlite3 ?? Or since there is a binary bin/paheko ??

Ok, on a Yuno 12 with a paheko fresh install it works

paheko@machine:~$ bin/paheko help sql
Usage: paheko sql OPTIONS… STATEMENT
Run SQL statement and display result.

Options:
  --rw
    Specify this option to allow the statement to modify the database.
    If this is absent, the statement will be executed in read-only

on another server debian 11 where I have also 2 paheko installed I need add first php8.2

perhaps we should now used php8.3, is supported by paheko…

Also I am discovering something very important and have to adapt the migrations for before v 1.3.0

Attention : la version minimum requise pour cette version est la 1.3.0. Il n’est plus possible de faire une mise à jour/restauration de base de données depuis une version inférieure à la 1.3.0. Si votre version installée est plus ancienne que 1.3.0, merci de faire une mise à jour intermédiaire vers la 1.3.0 en premier, avant celle-ci.

Ok I am planning this here, but also in testing before merging in master will be important !

Bonjour,
I ran the command last night and this morning no Cron message for Paheko in my mailbox.
Your update worked, thank you very much.

yunohost app upgrade paheko -u https://github.com/YunoHost-Apps/paheko_ynh/tree/fix_cron --force
Info: Now upgrading paheko…
Info: Creating a safety backup prior to the upgrade
..
..
Success! paheko upgraded
Success! Upgrade complete

I still have mail in my yunohost queue increasing

Trop d'emails en attente dans la file d'attente (3897 emails)

Is it possible to clean the mail from the yunohost queue ?
Thanks for your help.

Hello you can try this

sudo -u paheko php8.2 /var/www/paheko/bin/paheko  queue --force

This is the help command

sudo -u paheko php8.2 /var/www/paheko/ bin/paheko help queue
Usage: paheko queue SUBCOMMAND ARGS…

paheko queue count
  Display number of messages in e-mail queue.

paheko queue run [--quiet|-q] [--force|-f]
  Deliver messages waiting in the queue.
  Will exit with status code 2 if there are still messages waiting in the queue.
  If the queue is empty, the status code will be 0.
  If --quiet is not specified, will print the number of messages sent, and still in queue.
  If --force is specified, messages which have been marked for sending but failed,
  will be sent now.

paheko queue bounce
  Read received bounce message from STDIN

For mails of the system (not from paheko)

mail -q
mailq

The command returns an error, so I added “run”.
i have a problem with my smtp?

 sudo -u paheko php8.2 /var/www/paheko/bin/paheko  queue run --force
 /!\ KD2\SMTP_Exception
550-From header sender domain not verified (cbhome.hd.free.fr)
550-On your Sending > Verified Senders page
550 verify the sender domain or email to be allowed to send.
#0 .../include/lib/KD2/SMTP.php(302)
#1 .../include/lib/KD2/SMTP.php(423): KD2\SMTP->rawSend(string(24) "paheko@…, array(1) {
  [0]=> …, string(607) "From: …)
#2 .../include/lib/Paheko/Email/Emails.php(698): KD2\SMTP->send(object(KD2\Mail_Mes…)
#3 .../include/lib/Paheko/Email/Emails.php(671): Paheko\Email\Emails::sendMessage(int(0), object(KD2\Mail_Mes…, bool(true))
#4 .../include/lib/Paheko/Email/Emails.php(385): Paheko\Email\Emails::send(int(0), string(40) "e3e809f…, array(3) {
  ["From…, string(193) "Pour v…, NULL, NULL, array(0) {
  }, bool(true))
#5 .../include/lib/Paheko/CLI.php(304)
#6 .../include/lib/Paheko/CLI.php(676): Paheko\CLI->queue(array(1) {
  [0]=> …)
#7 .../bin/paheko(15): Paheko\CLI->run(array(2) {
  [0]=> …)

With the command

sudo -u paheko php8.2 /var/www/paheko/bin/paheko  queue count
18

As I said on my first message, the problems started when I sent paheko mails to test.
Can I delete these messages from the sql database?
My ISP Free (French) very complicated to configure :((

Yes but I think you need do it in the database…

But normally when there is errors paheko keep the messages quiet and then try again send them…

En français une chose que j’ai du faire il y a de cela longtemps…

Dans l’application en admin j’ai pu regarder les tables SQL et trouver les mails bloqués dans la table emails_queue

J’ai du apprendre un peu comment fonctionne sqlite, alors voilà la solution trouvée pour supprimer 3 lignes

# sudo -u paheko sqlite3

sqlite> .open association.sqlite

sqlite> .tables
acc_accounts                        files_search_segments             
acc_accounts_balances               files_search_stat                 
acc_charts                          files_shares                      
acc_projects                        logs                              
acc_transactions                    mailings                          
acc_transactions_files              mailings_recipients               
acc_transactions_lines              modules                           
acc_transactions_links              modules_templates                 
acc_transactions_users              plugins                           
acc_years                           plugins_signals                   
api_credentials                     searches                          
compromised_passwords_cache         services                          
compromised_passwords_cache_ranges  services_fees                     
config                              services_reminders                
config_users_fields                 services_reminders_sent           
emails                              services_users                    
emails_queue                        users                             
emails_queue_attachments            users_categories                  
files                               users_files                       
files_contents                      users_search                      
files_search                        users_sessions                    
files_search_content                users_view                        
files_search_docsize                web_pages                         
files_search_segdir                 web_pages_versions

sqlite> DELETE FROM "emails_queue" WHERE id = 2;
sqlite> DELETE FROM "emails_queue" WHERE id = 1;
sqlite> DELETE FROM "emails_queue" WHERE id = 3;
sqlite> .quit

Par contre j’aimerai résoudre ce qui n’a pas fonctionner… Tu as changer la configuration par défaut de l’envoi des mails ?

Sinon, as-tu bien rajouté les valeurs dns DKIM SPF DMARC du domaine de paheko ?

yunohost domain dns suggest paheko.domain.tld

Est-ce que paheko qui a des soucis avec le mail ??

Qu’est ce que te retournes ces commandes (en cachant les informations sensibles)

cat /var/www/paheko/config.local.php |grep smtp
cat /var/www/paheko/config.local.php |grep mail
cat /home/yunohost.app/paheko/config.local.user.php |grep smtp
cat /home/yunohost.app/paheko/config.local.user.php |grep mail
cat /etc/yunohost/app/paheko/settings.yml | grep smtp
cat /etc/yunohost/app/paheko/settings.yml | grep mail