elkarbackup
elkarbackup copied to clipboard
Error getting diskUsage on API
Describe the bug
When you request to API to get all jobs, the diskUsage value is null always.
We are using the Docker lastest tag image: latest
Steps to reproduce the behavior
- Create a client
- Create a job
- Run job
- Request to an API to get all jobs (http://elkarbackupserver.com/api/jobs.json)
Example response:
[
{
"backupLocation": 1,
"client": 1,
"description": null,
"diskUsage": 0,
"exclude": "*/cache\r\n*/dbcache",
"id": 1,
"include": null,
"isActive": true,
"minNotificationLevel": 400,
"name": "var-www",
"notificationsEmail": null,
"notificationsTo": [
"owner"
],
"path": "/var/www/",
"policy": 1,
"postScripts": [],
"preScripts": [],
"token": null,
"useLocalPermissions": true
},
{
"backupLocation": 1,
"client": 1,
"description": "example",
"diskUsage": 0,
"exclude": null,
"id": 2,
"include": null,
"isActive": true,
"minNotificationLevel": 400,
"name": "etc",
"notificationsEmail": null,
"notificationsTo": [
"owner"
],
"path": "/etc",
"policy": 1,
"postScripts": [],
"preScripts": [],
"token": null,
"useLocalPermissions": true
}
]
But in database the job has diskUsage:
mysql> select id, client_id, name, path, diskUsage from elkarbackup.Job;
+----+-----------+---------+-----------+-----------+
| id | client_id | name | path | diskUsage |
+----+-----------+---------+-----------+-----------+
| 1 | 1 | var-www | /var/www/ | 19250984 |
| 2 | 1 | etc | /etc | 38984 |
+----+-----------+---------+-----------+-----------+
2 rows in set (0,00 sec)
The other data that we checked is updating well