# Sonata Stats Server Error after upgrade to Vital V4

**URL:** <https://forums.vitalpbx.org/t/sonata-stats-server-error-after-upgrade-to-vital-v4/4080>\
**Category:** Reporting an Issue\
**Created:** [May 12, 2024, 9:10pm UTC](https://forums.vitalpbx.org/t/sonata-stats-server-error-after-upgrade-to-vital-v4/4080 "2024-05-12T21:10:11Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![hlev](https://forums.vitalpbx.org/user_avatar/forums.vitalpbx.org/hlev/32/42_2.png) [@hlev](https://forums.vitalpbx.org/u/hlev)\
**Post date:** [May 12, 2024, 9:10pm UTC](https://forums.vitalpbx.org/t/sonata-stats-server-error-after-upgrade-to-vital-v4/4080/1 "2024-05-12T21:10:11Z")

</div>

VitalPBX: 4.1.0-3  
Installed a new Debian 11 server installed all the basic addons and reinstalled from a backup as I have been doing with other system. During the restore process the following errors showed up:

 ![image](https://forums.vitalpbx.org/uploads/default/original/2X/d/dc82febeb58fedbabe57ff6854fcfdd45dc73ad6.png)

As the image shows, there was a Permission error when recovering the queue-stats backup and trying to run artisan.

Now when try to log into stats, I keep getting a Server Error. I orginally installed the addon and setup the connection settings before restoring the backup.

I have removed the addon and reinstalled, but now no wizard appears as the backup is already there I guess.

The console is showing the sonata stats service is not actually running properly either.

● sonata-stats.service - Sonata Stats  
Loaded: loaded (/lib/systemd/system/sonata-stats.service; enabled; vendor preset: enabled)  
Active: failed (Result: exit-code) since Sat 2024-05-11 22:36:34 PDT; 7min ago  
Process: 12085 ExecStart=/usr/bin/php artisan queue:work --tries=3 --backoff=3 --sleep=300 --timeout=3600 (code\>  
Process: 12086 ExecStartPost=/usr/bin/php artisan crontab:update (code=exited, status=0/SUCCESS)  
Main PID: 12085 (code=exited, status=1/FAILURE)  
CPU: 282ms

May 11 22:36:33 pbx systemd[1]: sonata-stats.service: Main process exited, code=exited, stat\>  
May 11 22:36:33 pbx systemd[1]: sonata-stats.service: Failed with result ‘exit-code’.  
May 11 22:36:34 pbx systemd[1]: sonata-stats.service: Scheduled restart job, restart counter\>  
May 11 22:36:34 pbx systemd[1]: Stopped Sonata Stats.  
May 11 22:36:34 pbx systemd[1]: sonata-stats.service: Start request repeated too quickly.  
May 11 22:36:34 pbx systemd[1]: sonata-stats.service: Failed with result ‘exit-code’.  
May 11 22:36:34 pbx systemd[1]: Failed to start Sonata Stats.

Any idea to get this working again.

---

<div class="post-metadata">

**Author:** ![hlev](https://forums.vitalpbx.org/user_avatar/forums.vitalpbx.org/hlev/32/42_2.png) [@hlev](https://forums.vitalpbx.org/u/hlev)\
**Post date:** [May 13, 2024, 2:51pm UTC](https://forums.vitalpbx.org/t/sonata-stats-server-error-after-upgrade-to-vital-v4/4080/2 "2024-05-13T14:51:07Z")

</div>

I was able to reinstall the addond and I deleted the wizard file and ran php artisan:cache and got to fille out the wizard again. Something failed during the backup recovery, certainly.

---

<div class="post-metadata">

**Author:** ![hlev](https://forums.vitalpbx.org/user_avatar/forums.vitalpbx.org/hlev/32/42_2.png) [@hlev](https://forums.vitalpbx.org/u/hlev)\
**Post date:** [May 28, 2024, 9:10pm UTC](https://forums.vitalpbx.org/t/sonata-stats-server-error-after-upgrade-to-vital-v4/4080/3 "2024-05-28T21:10:52Z")

</div>

@maynor Just had another issue with a different box, this time this is what I get, seems like the install is not working properly. I have uninstalled and reinstalled from the gui and the cli. This is what I get from the CLI:

```auto
Preparing to unpack .../sonata-stats_4.0.3-7_all.deb ...
Unpacking sonata-stats (4.0.3-7) ...
Setting up sonata-stats (4.0.3-7) ...

   INFO Application cache cleared successfully.  

   INFO Clearing cached bootstrap files.  

  events ................................................................................................ 2ms DONE
  views ................................................................................................. 1ms DONE
  cache ................................................................................................. 4ms DONE
  route ................................................................................................. 1ms DONE
  config ................................................................................................ 1ms DONE
  compiled .............................................................................................. 1ms DONE

   INFO Caching the framework bootstrap files.  

  config ............................................................................................... 15ms DONE
  routes ............................................................................................... 15ms DONE

   INFO Routes cached successfully.  

   INFO Configuration cached successfully.  

Failed to restart sonata-stats.service: Unit sonata-stats.service failed to load properly: Device or resource busy.
See system logs and 'systemctl status sonata-stats.service' for details.
root@vmi-lnx-tampavet-pbx:/etc/systemd# systemctl status sonata-stats.service 
● sonata-stats.service - Sonata Stats
     Loaded: error (Reason: Unit sonata-stats.service failed to load properly: Device or resource busy.)
     Active: active (running) since Tue 2024-05-28 16:59:16 EDT; 7min ago
   Main PID: 201593 (php)
        CPU: 440ms
     CGroup: /system.slice/sonata-stats.service
             └─201593 /usr/bin/php artisan queue:work --tries=3 --backoff=3 --sleep=300 --timeout=3600

May 28 16:59:16 vmi-lnx-tampavet-pbx systemd[1]: Starting Sonata Stats...
May 28 16:59:16 vmi-lnx-tampavet-pbx php[201594]: Cron entry already exists in /etc/cron.d/stats
May 28 16:59:16 vmi-lnx-tampavet-pbx systemd[1]: Started Sonata Stats.
May 28 16:59:16 vmi-lnx-tampavet-pbx php[201593]: INFO Processing jobs from the [default] queue.
May 28 17:05:57 vmi-lnx-tampavet-pbx systemd[1]: sonata-stats.service: Current command vanished from the unit file,>

```

There is no folder /usr/share/sonata/queues-stats/backend getting created at all and there seems to be an issue with the unit file from the errors above. Any idea how to fix this?

```auto
cd /usr/share/sonata/queues-stats/backend
-bash: cd: /usr/share/sonata/queues-stats/backend: No such file or directory

```

---

<div class="post-metadata">

**Author:** ![maynor](https://forums.vitalpbx.org/letter_avatar_proxy/v4/letter/m/3e96dc/32.png) [@maynor](https://forums.vitalpbx.org/u/maynor)\
**Post date:** [May 29, 2024, 10:04pm UTC](https://forums.vitalpbx.org/t/sonata-stats-server-error-after-upgrade-to-vital-v4/4080/4 "2024-05-29T22:04:42Z")

</div>

Hello!

Sorry for the delayed response,

The directory for S. Stats is **/usr/share/queues-stats/backend**. Please run the following command to verify the working directory:

`cat /lib/systemd/system/sonata-stats.service | grep "WorkingDirectory"`

Regards!

---

<div class="post-metadata">

**Author:** ![hlev](https://forums.vitalpbx.org/user_avatar/forums.vitalpbx.org/hlev/32/42_2.png) [@hlev](https://forums.vitalpbx.org/u/hlev)\
**Post date:** [May 30, 2024, 4:30am UTC](https://forums.vitalpbx.org/t/sonata-stats-server-error-after-upgrade-to-vital-v4/4080/5 "2024-05-30T04:30:27Z")

</div>

Was the location recently changed, even the wiki has entries for /usr/share/sonata/queues-stats/backend, I got the location from there originally.

 ![image](https://forums.vitalpbx.org/uploads/default/original/2X/6/63d6b779b5800295798c83e385064f5e8998a38a.png)

---

<div class="post-metadata">

**Author:** ![maynor](https://forums.vitalpbx.org/letter_avatar_proxy/v4/letter/m/3e96dc/32.png) [@maynor](https://forums.vitalpbx.org/u/maynor)\
**Post date:** [May 31, 2024, 3:07pm UTC](https://forums.vitalpbx.org/t/sonata-stats-server-error-after-upgrade-to-vital-v4/4080/6 "2024-05-31T15:07:35Z")

</div>

I will report this to the team in charge of the wiki so they can correct it.

Best regards!
