Export fails with "Couldn't encrypt the file"

Still need help?

The Atlassian Community is here for you.

Ask the community

Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.

Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

Problem

The export from Hipchat Server or Data Center fails when encrypting the archive. The following appears in /var/log/hipchat/hcapp.log:


2018-07-04T15:36:47.246068+00:00 nr-hipchat scissortail-worker:18159:INFO GID: 1 JID: 29f75629-e6f6-4e99-a575-56523745ab9e - Couldn't encrypt the file: Command '['openssl', 'aes-256-cbc', '-in', '/file_store/scissortail/tmpxjpo7dsx/hipchat-2018-07-04_14-42-44.tar.gz', '-out', '/file_store/scissortail/tmpxjpo7dsx/hipchat-2018-07-04_14-42-44.tar.gz.aes', '-pass', 'env:ada18de7e6854a8d93d9f864e58dfa32']' returned non-zero exit status 1

Diagnosis

  • The issue can occur in Server and Data Center environments.
  • The issue is more likely to occur if you include attachments in the export. 

Cause

Scissortail exports the data fine but fails to encrypt the archive. This is due to the lack of disk space in the server/DC node. 

Workaround

Scissortail uses an intermediate directory to encrypt the archive before doing the cleanup. This directory is defined by Chef in /hipchat-scm/chef-repo/cookbooks/scissortail/attributes/default.rb and points to /file_store/scissortail by default:

default[:scissortail][:working_dir] = "/file_store/scissortail"

Server

  • In Server, the folder can be changed to point to a location in another disk. 
  • Alternatively, you can increase disk space.

Data Center

  • In DC, this can be changed to point to /file_store/shared/scissortail which is under the NFS share. 
  • We have a feature to default the work directory to a location under the NFS share. Watch and up-vote  HCPUB-2195 - Getting issue details... STATUS

After the change

  1. Run Chef-Solo as root: 

    /opt/atlassian/hipchat/sbin/cs
  2. Restart Scissortail, it will create the new temp directory automatically: 

    /etc/init.d/scissortail-web-0 restart && /etc/init.d/scissortail-worker-0 restart
Last modified on Nov 2, 2018

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.