NextcloudPi HPB service keeps going down

NextcloudPi version: 1.52.4
Nextcloud version: 27.0.1.2
Operating system and version: Debian GNU/Linux 11. 6.1.21-v8+ (aarch64)
Apache or nginx version: Apache 2.4.56
PHP version: 8.1.21

Hey guys,

two months ago I got the redis servrer on my Raspberry Pi 3 with NextcloudPi to work properly with a lot of help from the forum (see related thread).
Since then I had to deal with power and memory issues but redis and HPB service were always running great.

A few days ago though (possibly after an update of NCP and NC) I ran nc-info through ncp-config and noticed that the HPB service was down.
I tried the re-installing the Client Push app through the Nextcloud web interface and restarting the redis service but nothing helped. Actually the redis server was running great and was able to receive connections all the while.
Only after a restart the HPB service was shown a up again.

I kept checking throughout the day and it seemed to stay that way but this morning it was listed as down again.

On my search so far I could not find anyone else who had an issue with HPB after a recent update. A few years ago there was a bug where you had to restart redis after an update but for me HPB seems to go down during normal operation.

Does anyone have an idea what the problem might be?

Thank you for your time!
Mark

Small update:
When I uploaded a file to my Nextcloud from my phone today, I noticed that it was synced to my desktop PC instantly.

Doesn’t that suggest that the HPB service is running as intended although it still showes up as down in nc-info?

Alright, apparently there are no ideas about this problem so I will just keep reporting my findings.

Two days ago, I switched my hardware from a Pi 3 to a Pi 4 with 4 GB RAM. Since then, the HPB service has stopped going down.
My guess is that the HPB service had an issue with the low RAM, the disk based swap or the zram swap on the old Pi.
Anyway, for me this problem seems to be solved now.

Since the hardware switch, I am getting a few redis errors in the Nextcloud log on bootup, though.

[nextcloudpi] Fatal: RedisException: read error on connection to /var/run/redis/redis.sock:0 at <<closure>>

0. /var/www/nextcloud/lib/private/Memcache/Redis.php line 72
   Redis->get()
1. /var/www/nextcloud/lib/autoloader.php line 154
   OC\Memcache\Redis->get()
2. <<closure>>
   OC\Autoloader->load()
3. /var/www/nextcloud/lib/private/AppFramework/Bootstrap/Coordinator.php line 217
   class_exists()
4. /var/www/nextcloud/lib/private/App/AppManager.php line 400
   OC\AppFramework\Bootstrap\Coordinator->isBootable()
5. /var/www/nextcloud/lib/private/App/AppManager.php line 216
   OC\App\AppManager->loadApp()
6. /var/www/nextcloud/lib/private/legacy/OC_App.php line 126
   OC\App\AppManager->loadApps()
7. /var/www/nextcloud/lib/private/Console/Application.php line 121
   OC_App::loadApps()
8. /var/www/nextcloud/console.php line 99
   OC\Console\Application->loadCommands()
9. /var/www/nextcloud/occ line 11
   require_once("/var/www/nextcloud/console.php")

at 2023-09-25T15:17:36+00:00

[no app in context] Fatal: RedisException: No such file or directory at <<closure>>

 0. /var/www/nextcloud/lib/private/RedisFactory.php line 137
    Redis->pconnect()
 1. /var/www/nextcloud/lib/private/RedisFactory.php line 178
    OC\RedisFactory->create("*** sensitive parameters replaced ***")
 2. /var/www/nextcloud/apps/notify_push/lib/AppInfo/Application.php line 62
    OC\RedisFactory->getInstance()
 3. /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php line 171
    OCA\NotifyPush\AppInfo\Application->OCA\NotifyPush\AppInfo\{closure}("*** sensitive parameters replaced ***")
 4. /var/www/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php line 122
    OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}("*** sensitive parameters replaced ***")
 5. /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php line 138
    Pimple\Container->offsetGet()
 6. /var/www/nextcloud/lib/private/AppFramework/DependencyInjection/DIContainer.php line 488
    OC\AppFramework\Utility\SimpleContainer->query()
 7. /var/www/nextcloud/lib/private/AppFramework/DependencyInjection/DIContainer.php line 466
    OC\AppFramework\DependencyInjection\DIContainer->queryNoFallback()
 8. /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php line 97
    OC\AppFramework\DependencyInjection\DIContainer->query()
 9. <<closure>>
    OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}("*** sensitive parameters replaced ***")
10. /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php line 116
    array_map()
11. /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php line 124
    OC\AppFramework\Utility\SimpleContainer->buildClass()
12. /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php line 142
    OC\AppFramework\Utility\SimpleContainer->resolve()
13. /var/www/nextcloud/lib/private/AppFramework/DependencyInjection/DIContainer.php line 494
    OC\AppFramework\Utility\SimpleContainer->query()
14. /var/www/nextcloud/lib/private/AppFramework/DependencyInjection/DIContainer.php line 466
    OC\AppFramework\DependencyInjection\DIContainer->queryNoFallback()
15. /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php line 65
    OC\AppFramework\DependencyInjection\DIContainer->query()
16. /var/www/nextcloud/lib/private/AppFramework/Bootstrap/FunctionInjector.php line 49
    OC\AppFramework\Utility\SimpleContainer->get()
17. <<closure>>
    OC\AppFramework\Bootstrap\FunctionInjector->OC\AppFramework\Bootstrap\{closure}("*** sensitive parameters replaced ***")
18. /var/www/nextcloud/lib/private/AppFramework/Bootstrap/FunctionInjector.php line 66
    array_map()
19. /var/www/nextcloud/lib/private/AppFramework/Bootstrap/BootContext.php line 50
    OC\AppFramework\Bootstrap\FunctionInjector->injectFn()
20. /var/www/nextcloud/apps/notify_push/lib/AppInfo/Application.php line 70
    OC\AppFramework\Bootstrap\BootContext->injectFn()
21. /var/www/nextcloud/lib/private/AppFramework/Bootstrap/Coordinator.php line 200
    OCA\NotifyPush\AppInfo\Application->boot()
22. /var/www/nextcloud/lib/private/App/AppManager.php line 437
    OC\AppFramework\Bootstrap\Coordinator->bootApp()
23. /var/www/nextcloud/lib/private/App/AppManager.php line 216
    OC\App\AppManager->loadApp()
24. /var/www/nextcloud/lib/private/legacy/OC_App.php line 126
    OC\App\AppManager->loadApps()
25. /var/www/nextcloud/lib/private/Console/Application.php line 121
    OC_App::loadApps()
26. /var/www/nextcloud/console.php line 99
    OC\Console\Application->loadCommands()
27. /var/www/nextcloud/occ line 11
    require_once("/var/www/nextcloud/console.php")

at 2023-09-25T15:17:36+00:00

[oauth2] Fatal: RedisException: Redis server /var/run/redis/redis.sock:0 went away at <<closure>>

0. /var/www/nextcloud/lib/private/Memcache/Redis.php line 72
   Redis->get()
1. /var/www/nextcloud/lib/autoloader.php line 154
   OC\Memcache\Redis->get()
2. <<closure>>
   OC\Autoloader->load()
3. /var/www/nextcloud/lib/private/AppFramework/Bootstrap/Coordinator.php line 217
   class_exists()
4. /var/www/nextcloud/lib/private/App/AppManager.php line 400
   OC\AppFramework\Bootstrap\Coordinator->isBootable()
5. /var/www/nextcloud/lib/private/App/AppManager.php line 216
   OC\App\AppManager->loadApp()
6. /var/www/nextcloud/lib/private/legacy/OC_App.php line 126
   OC\App\AppManager->loadApps()
7. /var/www/nextcloud/lib/private/Console/Application.php line 121
   OC_App::loadApps()
8. /var/www/nextcloud/console.php line 99
   OC\Console\Application->loadCommands()
9. /var/www/nextcloud/occ line 11
   require_once("/var/www/nextcloud/console.php")

at 2023-09-25T15:17:36+00:00

The redis server starts without issue (no errors in /var/log/redis/redis-server.log) and is operating as intended (/var/www/nextcloud/occ notify_push:metrics shows active connections and operation).
So this might just be a timing issue where Nextcloud does not wait for redis to be operational.

Any thoughts on how to fix that?

Bad news: As of this morning, the HPB service is shown as down again.
Everything seems to be working though same as before. :person_shrugging:

A year ago with an old NC and NCP-version I had the HPB issue too. There I have found out, that a bug in NCP deleted in the nextcloud config.php the trusted domain. I know this is fixed now. Or since months…

Exactly today with the newest NCP and NC version on my Raspberry 4, i suddenly get disconnected in the andoird app. After checking: the HPB service is down. I tried restart apache, tried restart the PI, tried something like this:
sudo -u www-data php /var/www/nextcloud/occ notify_push:setup
sudo systemctl start notify_push
sudo systemctl enable notify_push
sudo systemctl restart notify_push
checked the config here:
nano /etc/systemd/system/notify_push.service
everything was ok and nothing helped. And suddenly the HPB service is up again. It is a mistery.

I found this disussion here:

This would be my next try.

But its working now again, and I don’t know why. So better do nothing and start to pray to all gods.