Details
-
Bug
-
Resolution: Duplicate
-
Low
-
None
-
HCS 2.2.3
-
None
-
Severity 3 - Minor
Description
Summary
Export archives are not deleted from the file system after running hipchat export -u
Environment
HipChat Server 2.2.3
Steps to Reproduce
- Run one or two exports
- Try to purge these exports the following day by running:
hipchat export -u 1
Expected Results
- The exports will be purged from the output of hipchat export --all or curl -s http://localhost:7777/export/group/1
AND - The export archives will be deleted from /file_store/local/files/1/1/
Actual Results
Although the export are purged from the internal database (output of the commands above), the corresponding archive is not deleted from the file system.
Here's an example with job 3b3dbdbe-768a-4687-a1ad-a0f34f1bb8f7:
root@adridi-haproxy:/home/admin# curl -s http://localhost:7777/export/group/1 | jq '.items[3]' { "user_id": 1, "updated_at": "2017-07-28T10:17:02Z 177048", "status": "completed", "started_at": "2017-07-28T10:16:51Z 931094", "start_date": "2017-07-28T00:00:00+00:00", "stage": "upload", "progress": 1, "errors": [], "end_date": "2017-07-01T00:00:00+00:00", "download_size": 563520, "download_location": "https://adridi-223.lightning.hcsinf.com/files/1/1/mJqlhYTkr1yLXcX/hipchat-2017-07-28_10-16-51.tar.gz.aes", "created_at": "2017-07-28T10:16:51Z 919977", "coral_calls_rate": 42.94079235716355, "coral_calls": 440, "completed_at": "2017-07-28T10:17:02Z 177761", "found_job": true, "group_id": 1, "include_attachments": true, "include_emoticons": false, "include_messages": true, "include_oto": true, "job_duration": 10.246667, "job_id": "3b3dbdbe-768a-4687-a1ad-a0f34f1bb8f7" } root@adridi-haproxy:/home/admin# ll /file_store/local/files/1/1/mJqlhYTkr1yLXcX/hipchat-2017-07-28_10-16-51.tar.gz.aes -rw-r--r-- 1 hipchat hipchat 563520 Jul 28 10:17 /file_store/local/files/1/1/mJqlhYTkr1yLXcX/hipchat-2017-07-28_10-16-51.tar.gz.aes root@adridi-haproxy:/home/admin# hipchat export -u 10 Deleted 3b3dbdbe-768a-4687-a1ad-a0f34f1bb8f7 Deleted 8f97372a-c213-45da-acfc-d89b8a4a9474 Deleted f80a548a-04f8-4253-b3fb-a6e6ebcb50fb Deleted 8fdcec47-f765-4942-9053-2c1f1c49ed99 Deleted 1f5451bc-3888-41bd-9e5b-6472389778dd Deleted d8641375-c656-4473-ace7-1cd14b1ff1a4 Deleted cc1dd26d-58b1-476c-a0fb-86c9cf3b997f Completed root@adridi-haproxy:/home/admin# ll /file_store/local/files/1/1/mJqlhYTkr1yLXcX/hipchat-2017-07-28_10-16-51.tar.gz.aes -rw-r--r-- 1 hipchat hipchat 563520 Jul 28 10:17 /file_store/local/files/1/1/mJqlhYTkr1yLXcX/hipchat-2017-07-28_10-16-51.tar.gz.aes root@adridi-haproxy:/home/admin#
Workaround
- Create a cron job that would delete the export archives older than three days manually:
find /file_store/local/files -name 'hipchat-*.tar.gz.aes' -mtime +3 | xargs rm -v
Be sure to refer to How to schedule a recurring job (cron job) to make the cron job persist over reboots and Chef runs.
OR - Migrate to HipChat Data Center and backup your Postgres database as you wish.
Attachments
Issue Links
- duplicates
-
HCPUB-3031 Exports do not purge on HipChat Server 2.2.3 and newer
- Closed
- is related to
-
HCPUB-3031 Exports do not purge on HipChat Server 2.2.3 and newer
- Closed