# Problème avec Cron et Paheko

**URL:** https://forum.yunohost.org/t/probleme-avec-cron-et-paheko/31551
**Category:** Support apps
**Tags:** paheko, french
**Created:** [October 21, 2024, 9:38am UTC](https://forum.yunohost.org/t/probleme-avec-cron-et-paheko/31551 "2024-10-21T09:38:11Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![beer\_bee](https://forum.yunohost.org/letter_avatar_proxy/v4/letter/b/a9a28c/32.png) [@beer\_bee](https://forum.yunohost.org/u/beer_bee)
#### Post date: [October 21, 2024, 9:38am UTC](https://forum.yunohost.org/t/probleme-avec-cron-et-paheko/31551/1 "2024-10-21T09:38:11Z")

</div>

### 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 🇬🇧 but feel free to write in French 🇫🇷 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](mailto:paheko@cbhome) [-f //home/yunohost.app/paheko/data/association.sqlite] && /var/www/paheko/bin/paheko queue run --quiet

/bin/sh: 1: [: missing]

---

<div class="post-metadata">

### Author: ![orhtej2](https://forum.yunohost.org/user_avatar/forum.yunohost.org/orhtej2/32/8943_2.png) [@orhtej2](https://forum.yunohost.org/u/orhtej2)
#### Post date: [October 21, 2024, 9:50am UTC](https://forum.yunohost.org/t/probleme-avec-cron-et-paheko/31551/2 "2024-10-21T09:50:07Z")

</div>

The bug is already fixed on [testing branch](https://github.com/YunoHost-Apps/paheko_ynh/blob/testing/conf/cron), you can try it out with

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

```

---

<div class="post-metadata">

### Author: ![beer\_bee](https://forum.yunohost.org/letter_avatar_proxy/v4/letter/b/a9a28c/32.png) [@beer\_bee](https://forum.yunohost.org/u/beer_bee)
#### Post date: [October 21, 2024, 10:38am UTC](https://forum.yunohost.org/t/probleme-avec-cron-et-paheko/31551/3 "2024-10-21T10:38:38Z")

</div>

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 ?

---

<div class="post-metadata">

### Author: ![beer\_bee](https://forum.yunohost.org/letter_avatar_proxy/v4/letter/b/a9a28c/32.png) [@beer\_bee](https://forum.yunohost.org/u/beer_bee)
#### Post date: [October 21, 2024, 11:59am UTC](https://forum.yunohost.org/t/probleme-avec-cron-et-paheko/31551/4 "2024-10-21T11:59:48Z")

</div>

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

```auto
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

```auto
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.

```

---

<div class="post-metadata">

### Author: ![beer\_bee](https://forum.yunohost.org/letter_avatar_proxy/v4/letter/b/a9a28c/32.png) [@beer\_bee](https://forum.yunohost.org/u/beer_bee)
#### Post date: [October 21, 2024, 12:12pm UTC](https://forum.yunohost.org/t/probleme-avec-cron-et-paheko/31551/5 "2024-10-21T12:12:27Z")

</div>

I ran the command I found in the paheko docs

```auto
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?

---

<div class="post-metadata">

### Author: ![orhtej2](https://forum.yunohost.org/user_avatar/forum.yunohost.org/orhtej2/32/8943_2.png) [@orhtej2](https://forum.yunohost.org/u/orhtej2)
#### Post date: [October 21, 2024, 12:30pm UTC](https://forum.yunohost.org/t/probleme-avec-cron-et-paheko/31551/6 "2024-10-21T12:30:11Z")

</div>

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

```auto
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 😕

---

<div class="post-metadata">

### Author: ![beer\_bee](https://forum.yunohost.org/letter_avatar_proxy/v4/letter/b/a9a28c/32.png) [@beer\_bee](https://forum.yunohost.org/u/beer_bee)
#### Post date: [October 21, 2024, 1:06pm UTC](https://forum.yunohost.org/t/probleme-avec-cron-et-paheko/31551/7 "2024-10-21T13:06:43Z")

</div>

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

---

<div class="post-metadata">

### Author: ![beer\_bee](https://forum.yunohost.org/letter_avatar_proxy/v4/letter/b/a9a28c/32.png) [@beer\_bee](https://forum.yunohost.org/u/beer_bee)
#### Post date: [October 22, 2024, 9:42am UTC](https://forum.yunohost.org/t/probleme-avec-cron-et-paheko/31551/8 "2024-10-22T09:42:52Z")

</div>

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?

---

<div class="post-metadata">

### Author: ![orhtej2](https://forum.yunohost.org/user_avatar/forum.yunohost.org/orhtej2/32/8943_2.png) [@orhtej2](https://forum.yunohost.org/u/orhtej2)
#### Post date: [October 22, 2024, 11:49am UTC](https://forum.yunohost.org/t/probleme-avec-cron-et-paheko/31551/9 "2024-10-22T11:49:51Z")

</div>

No, there’s a bug in the package.

I have a [speculative fix](https://github.com/YunoHost-Apps/paheko_ynh/pull/79), if you would be willing to test it you can

```auto
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).

---

<div class="post-metadata">

### Author: ![rodinux](https://forum.yunohost.org/user_avatar/forum.yunohost.org/rodinux/32/7029_2.png) [@rodinux](https://forum.yunohost.org/u/rodinux)
#### Post date: [October 22, 2024, 6:17pm UTC](https://forum.yunohost.org/t/probleme-avec-cron-et-paheko/31551/10 "2024-10-22T18:17:43Z")

</div>

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

```bash
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

```bash
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

```

---

<div class="post-metadata">

### Author: ![orhtej2](https://forum.yunohost.org/user_avatar/forum.yunohost.org/orhtej2/32/8943_2.png) [@orhtej2](https://forum.yunohost.org/u/orhtej2)
#### Post date: [October 22, 2024, 9:18pm UTC](https://forum.yunohost.org/t/probleme-avec-cron-et-paheko/31551/11 "2024-10-22T21:18:10Z")

</div>

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` 🤔

---

<div class="post-metadata">

### Author: ![rodinux](https://forum.yunohost.org/user_avatar/forum.yunohost.org/rodinux/32/7029_2.png) [@rodinux](https://forum.yunohost.org/u/rodinux)
#### Post date: [October 22, 2024, 9:24pm UTC](https://forum.yunohost.org/t/probleme-avec-cron-et-paheko/31551/12 "2024-10-22T21:24:40Z")

</div>

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` ??

---

<div class="post-metadata">

### Author: ![rodinux](https://forum.yunohost.org/user_avatar/forum.yunohost.org/rodinux/32/7029_2.png) [@rodinux](https://forum.yunohost.org/u/rodinux)
#### Post date: [October 22, 2024, 9:37pm UTC](https://forum.yunohost.org/t/probleme-avec-cron-et-paheko/31551/13 "2024-10-22T21:37:51Z")

</div>

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

```bash
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

```

---

<div class="post-metadata">

### Author: ![rodinux](https://forum.yunohost.org/user_avatar/forum.yunohost.org/rodinux/32/7029_2.png) [@rodinux](https://forum.yunohost.org/u/rodinux)
#### Post date: [October 22, 2024, 9:39pm UTC](https://forum.yunohost.org/t/probleme-avec-cron-et-paheko/31551/14 "2024-10-22T21:39:49Z")

</div>

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

---

<div class="post-metadata">

### Author: ![rodinux](https://forum.yunohost.org/user_avatar/forum.yunohost.org/rodinux/32/7029_2.png) [@rodinux](https://forum.yunohost.org/u/rodinux)
#### Post date: [October 22, 2024, 9:53pm UTC](https://forum.yunohost.org/t/probleme-avec-cron-et-paheko/31551/15 "2024-10-22T21:53:27Z")

</div>

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

---

<div class="post-metadata">

### Author: ![rodinux](https://forum.yunohost.org/user_avatar/forum.yunohost.org/rodinux/32/7029_2.png) [@rodinux](https://forum.yunohost.org/u/rodinux)
#### Post date: [October 22, 2024, 9:56pm UTC](https://forum.yunohost.org/t/probleme-avec-cron-et-paheko/31551/16 "2024-10-22T21:56:47Z")

</div>

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 !

> <https://github.com/YunoHost-Apps/paheko_ynh/pull/78/files#diff-57aeb84da86cb7420dfedd8e49bc644fb799d5413d01927a0417bde753e8922fR26-R27>
>
> \## Problem
> 
> \- \*The app need a post-install to create Database on first install…\*
> 
> \## Solution
> 
> \- \*add post-install with paheko init on script install\*
> 
> \## PR Status
> 
> \- \[\] Code finished and ready to be reviewed/tested
> \- \[\] The fix/enhancement were manually tested (if applicable)
> 
> \## Automatic tests
> 
> Automatic tests can be triggered on https://ci-apps-dev.yunohost.org/ \*after creating the PR\*, by commenting "!testme", "!gogogadgetoci" or "By the power of systemd, I invoke The Great App CI to test this Pull Request!". (N.B. : for this to work you need to be a member of the Yunohost-Apps organization)

---

<div class="post-metadata">

### Author: ![beer\_bee](https://forum.yunohost.org/letter_avatar_proxy/v4/letter/b/a9a28c/32.png) [@beer\_bee](https://forum.yunohost.org/u/beer_bee)
#### Post date: [October 23, 2024, 8:26am UTC](https://forum.yunohost.org/t/probleme-avec-cron-et-paheko/31551/17 "2024-10-23T08:26:48Z")

</div>

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.

```auto
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

```auto
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.

---

<div class="post-metadata">

### Author: ![rodinux](https://forum.yunohost.org/user_avatar/forum.yunohost.org/rodinux/32/7029_2.png) [@rodinux](https://forum.yunohost.org/u/rodinux)
#### Post date: [October 23, 2024, 9:08am UTC](https://forum.yunohost.org/t/probleme-avec-cron-et-paheko/31551/18 "2024-10-23T09:08:07Z")

</div>

Hello you can try this

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

```

This is the help command

```auto
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)

```auto
mail -q
mailq

```

---

<div class="post-metadata">

### Author: ![beer\_bee](https://forum.yunohost.org/letter_avatar_proxy/v4/letter/b/a9a28c/32.png) [@beer\_bee](https://forum.yunohost.org/u/beer_bee)
#### Post date: [October 23, 2024, 11:45am UTC](https://forum.yunohost.org/t/probleme-avec-cron-et-paheko/31551/19 "2024-10-23T11:45:40Z")

</div>

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

```auto
 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

```auto
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 :((

---

<div class="post-metadata">

### Author: ![rodinux](https://forum.yunohost.org/user_avatar/forum.yunohost.org/rodinux/32/7029_2.png) [@rodinux](https://forum.yunohost.org/u/rodinux)
#### Post date: [October 23, 2024, 11:57am UTC](https://forum.yunohost.org/t/probleme-avec-cron-et-paheko/31551/20 "2024-10-23T11:57:13Z")

</div>

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

```auto
# 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 ?

```auto
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)

```auto
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

```

[Next page](https://forum.yunohost.org/t/probleme-avec-cron-et-paheko/31551.md?page=2)
