# PHP/Openssl issue with Backup kicking off

**URL:** <https://help.nextcloud.com/t/php-openssl-issue-with-backup-kicking-off/138618>\
**Category:** ℹ️ Support\
**Tags:** backup-app\
**Created:** [May 5, 2022, 12:05pm UTC](https://help.nextcloud.com/t/php-openssl-issue-with-backup-kicking-off/138618 "2022-05-05T12:05:19Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jet438](https://help.nextcloud.com/user_avatar/help.nextcloud.com/jet438/32/64844_2.png) [@jet438](https://help.nextcloud.com/u/jet438)\
**Post date:** [May 5, 2022, 12:05pm UTC](https://help.nextcloud.com/t/php-openssl-issue-with-backup-kicking-off/138618/1 "2022-05-05T12:05:19Z")

</div>

I downloaded and setup Backup. it ran once but now I’m getting an error message in the log.  
Error: openssl\_encrypt(): IV passed is only 12 bytes long, cipher expects an IV of precisely 16 bytes, padding with \0 at /var/www/nextcloud/apps/backup/lib/Service/EncryptService.php#210

So the simple question is: What is the error and how do I correct it?  
Thanks for the help in advance

---

<div class="post-metadata">

**Author:** ![anon75456558](https://help.nextcloud.com/letter_avatar/anon75456558/32/5_5575768a8748004e209b776fc1b2916d.png) [@anon75456558](https://help.nextcloud.com/u/anon75456558)\
**Post date:** [May 5, 2022, 2:17pm UTC](https://help.nextcloud.com/t/php-openssl-issue-with-backup-kicking-off/138618/2 "2022-05-05T14:17:50Z")

</div>

Here is the bug report

> <https://github.com/nextcloud/backup/issues/169>
>
> Hi there,
> while packing the first pass of a backup the this error occured:
> \`SQ…LSTATE\[HY000\]: General error: 2006 MySQL server has gone away\`
> 
> Here is the output:
> \`\`\`Packing Restoring Point 20220118081516-full-QfaWrKt6yed4yez
> \> lock and set status to processing
> \> Browsing RestoringData data
> \> Packing RestoringChunk data-bf2cdafb-eae0-4cf0-b1e6-a69f5d4d4779: proceeding
> \* copying chunk to temp file /tmp/php9gg35M: ok
> \* compressing /tmp/php9gg35M: /tmp/phpMLuaPP
> \* spliting /tmp/phpMLuaPP in parts: 32 part(s)
> \* encrypting each part
> . encrypting /tmp/phpi8mBuO: /tmp/phpiG1hRM, aes-256-cbc
> . encrypting /tmp/php6u0maQ: /tmp/phpB2E8hO, aes-256-cbc
> . encrypting /tmp/phpGKmVlM: /tmp/php39ZUfO, aes-256-cbc
> . encrypting /tmp/phpf7rE8P: /tmp/phpSkemtP, aes-256-cbc
> . encrypting /tmp/php8jYzsN: /tmp/php3fXmnM, aes-256-cbc
> . encrypting /tmp/php7w7bUM: /tmp/phpVU7AoP, aes-256-cbc
> . encrypting /tmp/php06qpFO: /tmp/phpZqtStP, aes-256-cbc
> . encrypting /tmp/phplzYEfP: /tmp/phpaLDYSO, aes-256-cbc
> . encrypting /tmp/phpJRY3xM: /tmp/phpY1xOlN, aes-256-cbc
> . encrypting /tmp/phpj9yKNP: /tmp/phptla2lP, aes-256-cbc
> . encrypting /tmp/phpQBpiJL: /tmp/phpEO10QM, aes-256-cbc
> . encrypting /tmp/php0t3kVP: /tmp/phpYQsfCL, aes-256-cbc
> . encrypting /tmp/phpsVsEBP: /tmp/phpKBKW7P, aes-256-cbc
> . encrypting /tmp/php4pXWjM: /tmp/phpTY6qwL, aes-256-cbc
> . encrypting /tmp/phpt22WAL: /tmp/phpiy6oVO, aes-256-cbc
> . encrypting /tmp/phpjGvpYO: /tmp/phprc9L9O, aes-256-cbc
> . encrypting /tmp/php0Fw5xL: /tmp/phpCDxVEP, aes-256-cbc
> . encrypting /tmp/phpSl1uMM: /tmp/phpF9ZFfP, aes-256-cbc
> . encrypting /tmp/phpsg1rtM: /tmp/phpkSgxYN, aes-256-cbc
> . encrypting /tmp/phpktmRBO: /tmp/phpZk0K0O, aes-256-cbc
> . encrypting /tmp/phpWRDpzL: /tmp/php0twgnP, aes-256-cbc
> . encrypting /tmp/phpIzU2IN: /tmp/phpJqT6GL, aes-256-cbc
> . encrypting /tmp/phphYsfLO: /tmp/phpN1u94L, aes-256-cbc
> . encrypting /tmp/phpOEmhWN: /tmp/phpUbpnPP, aes-256-cbc
> . encrypting /tmp/phpoCtptM: /tmp/phpKohG0L, aes-256-cbc
> . encrypting /tmp/phpil2hJL: /tmp/phpyP8GrO, aes-256-cbc
> . encrypting /tmp/phpq0IzEN: /tmp/phpg5HczM, aes-256-cbc
> . encrypting /tmp/phpa3DksN: /tmp/php26W6wM, aes-256-cbc
> . encrypting /tmp/phpDuq2hO: /tmp/phpYAE3WP, aes-256-cbc
> . encrypting /tmp/phpbf54xP: /tmp/phpEUb2pN, aes-256-cbc
> . encrypting /tmp/php5HrT5N: /tmp/phpzLxYnM, aes-256-cbc
> . encrypting /tmp/phpZvrgeM: /tmp/phpMCzXsO, aes-256-cbc
> - storing parts in appdata .fail An exception occurred while executing a query: SQLSTATE\[HY000\]: General error: 2006 MySQL server has gone away
> 
> In PackService.php line 210:
> 
> issue on chunk data-bf2cdafb-eae0-4cf0-b1e6-a69f5d4d4779 - An exception occurred while executing a query: SQLSTATE\[HY000\]: General error: 2006 MySQL server has gone away
> 
> 
> backup:point:pack \[--output \[OUTPUT\]\] \[--generate-log\] \[--\] \<pointId\>
> \`\`\`
> 
> The creation was successfully.
> Using NC 23.0.0.10 and Backup 1.0.4
> 
> \*\*EDIT:\*\*
> the generted log:
> 
> \`\`\[PHP\] Fehler: openssl\_encrypt(): IV passed is only 12 bytes long, cipher expects an IV of precisely 16 bytes, padding with \\0 at nextcloud/apps/backup/lib/Service/EncryptService.php#211
> \`\`
> This Error occures several times

Seems that is a bug report. Found this.

> <https://stackoverflow.com/questions/37439981/openssl-encrypt-randomly-fails-iv-passed-is-only-x-bytes-long-cipher-exp>

---

<div class="post-metadata">

**Author:** ![jet438](https://help.nextcloud.com/user_avatar/help.nextcloud.com/jet438/32/64844_2.png) [@jet438](https://help.nextcloud.com/u/jet438)\
**Post date:** [May 5, 2022, 3:14pm UTC](https://help.nextcloud.com/t/php-openssl-issue-with-backup-kicking-off/138618/3 "2022-05-05T15:14:22Z")

</div>

Ok. So it sounds like a bug that the author of the app needs to work out. Certainly doesn’t look like anything I can fix.  
Thanks for the quick reply.

---

<div class="post-metadata">

**Author:** ![wwe](https://help.nextcloud.com/user_avatar/help.nextcloud.com/wwe/32/72963_2.png) [@wwe](https://help.nextcloud.com/u/wwe)\
**Post date:** [December 13, 2024, 2:12pm UTC](https://help.nextcloud.com/t/php-openssl-issue-with-backup-kicking-off/138618/4 "2024-12-13T14:12:26Z")

</div>


