[GH-ISSUE #107] Restore command raise a exception with mailbox bigger than 2GB #84

Closed
opened 2026-02-27 08:14:16 +03:00 by kerem · 5 comments
Owner

Originally created by @ibirisol on GitHub (Jul 11, 2018).
Original GitHub issue: https://github.com/lucascbeyeler/zmbackup/issues/107

Originally assigned to: @lucascbeyeler on GitHub.

ISSUE TYPE
  • Bug Report
ENVIRONMENT VERSION
  • Zmbackup Version: 1.2.2
  • Zimbra Version: 8.8.8.GA.2009
  • Linux Distribution & Version: Ubuntu 16.04.4 LTS
SUMMARY

When I try to restore a mailbox bigger than 2GB with zmbackup the httpie raises:

http: error: OverflowError: string longer than 2147483647 bytes

I found a similar bug in [1-2]. A workaround made by [1] changed httpie by curl.

[1] gitlab.esss.lu.se/ics-infrastructure/ics-shared-gitlab-ci-functions@bb283ec700
[2] https://github.com/requests/requests/issues/2717

STEPS TO REPRODUCE
$ zmbackup --restore <session> <account>
ACTUAL RESULTS
http: error: OverflowError: string longer than 2147483647 bytes
Originally created by @ibirisol on GitHub (Jul 11, 2018). Original GitHub issue: https://github.com/lucascbeyeler/zmbackup/issues/107 Originally assigned to: @lucascbeyeler on GitHub. <!-- Before open an issue, please remember to check our Google Group (link in README.md) and the other issues. Maybe what you want is already answered. You don't need to answer all the questions below, just answer what is pertinent to what you want (You don't need to explain the steps to reproduce and the results if your issue is about the documentation) --> <!-- ISSUE TYPE: Inform what kind of issue we are talking about. Choose only one option. --> ##### ISSUE TYPE - Bug Report <!-- ENVIRONMENT VERSION: Describe the environment you are using the Zmbackup and its version. --> ##### ENVIRONMENT VERSION - Zmbackup Version: 1.2.2 - Zimbra Version: 8.8.8.GA.2009 - Linux Distribution & Version: Ubuntu 16.04.4 LTS <!-- SUMMARY: Describe your issue in this field. The more detailed you gave us, more easy and fast will be for us to debug and fix the software. --> ##### SUMMARY <!--- SUMMARY:For bugs, show exactly how to reproduce the problem, using a minimal test-case. For new features, show how the feature would be used. --> When I try to restore a mailbox bigger than 2GB with zmbackup the httpie raises: ``` http: error: OverflowError: string longer than 2147483647 bytes ``` I found a similar bug in [1-2]. A workaround made by [1] changed httpie by curl. [1] https://gitlab.esss.lu.se/ics-infrastructure/ics-shared-gitlab-ci-functions/commit/bb283ec7003f8380756141059c8e9b06c7903443?view=parallel [2] https://github.com/requests/requests/issues/2717 ##### STEPS TO REPRODUCE ``` $ zmbackup --restore <session> <account> ``` <!-- ACTUAL RESULTS: What happened when you did the steps before. --> ##### ACTUAL RESULTS ``` http: error: OverflowError: string longer than 2147483647 bytes ```
kerem 2026-02-27 08:14:16 +03:00
Author
Owner

@ibirisol commented on GitHub (Jul 13, 2018):

In pull request #108 I send a modification suggestion.

<!-- gh-comment-id:404840788 --> @ibirisol commented on GitHub (Jul 13, 2018): In pull request #108 I send a modification suggestion.
Author
Owner

@ibirisol commented on GitHub (Jul 13, 2018):

Hi Lucas, how could I help you with this bug? Are You with a tool name in your mind? Or you will fix HTTPie?

<!-- gh-comment-id:404937212 --> @ibirisol commented on GitHub (Jul 13, 2018): Hi Lucas, how could I help you with this bug? Are You with a tool name in your mind? Or you will fix HTTPie?
Author
Owner

@vladT0 commented on GitHub (Sep 24, 2019):

@ibirisol : Hi ! I have made myself changes in scripts. Now zmbackup tool is working with "curl" and I have no this 2GB limitation. The big second advantage, tool is working for old ubuntu versions, such as 12.04 (where httpie was not presented ) and I have managed to backup mail server on it and restore to latest version. I can share my changes.

<!-- gh-comment-id:534443154 --> @vladT0 commented on GitHub (Sep 24, 2019): @ibirisol : Hi ! I have made myself changes in scripts. Now zmbackup tool is working with "curl" and I have no this 2GB limitation. The big second advantage, tool is working for old ubuntu versions, such as 12.04 (where httpie was not presented ) and I have managed to backup mail server on it and restore to latest version. I can share my changes.
Author
Owner

@cleitonrnovotni commented on GitHub (Sep 25, 2019):

Hello, good night, could you share your code with me? I am encountering the same problem when trying to restore mailbox backups here, thanks.

<!-- gh-comment-id:534811642 --> @cleitonrnovotni commented on GitHub (Sep 25, 2019): Hello, good night, could you share your code with me? I am encountering the same problem when trying to restore mailbox backups here, thanks.
Author
Owner

@vladT0 commented on GitHub (Sep 25, 2019):

Hi !
File ParallelAction.sh:

function mailbox_restore()
{
  ERR=$(curl --insecure -X POST -u "$ADMINUSER:$ADMINPASS" -T "$WORKDIR/$1/$2.tgz" "$WEBPROTO://$MAILHOST:7071/home/$2/?fmt=tgz")
  if ! [[ $? -eq 0 ]]; then
    printf "Error during the restore process for account $2. Error message below:"
    printf "$2: $ERR"
  elif [[ "$ERR"  == *"No such file or directory" ]]; then
    printf "Account $2 has nothing to restore - skipping..."
  fi
}

File RestoreAction.sh:

function restore_main_mailbox()
{
  if [[ $SESSION_TYPE == 'TXT' ]]; then
    SESSION=$(egrep ": $1 started" $WORKDIR/sessions.txt | egrep 'started' | \
                  awk '{print $2}' | sort | uniq)
  elif [[ $SESSION_TYPE == "SQLITE3" ]]; then
    SESSION=$(sqlite3 $WORKDIR/sessions.sqlite3 "select * from backup_session where sessionID='$1'")
  fi
  if ! [ -z "$SESSION" ]; then
    printf "Restore mail process with session $1 started at $(date)"
    if [[ ! -z $3 && $2 == *"@"* ]]; then
      ERR=$(curl --insecure -X POST -u "$ADMINUSER:$ADMINPASS" -T "$WORKDIR/$1/$2.tgz" "$WEBPROTO://$MAILHOST:7071/home/$3/?fmt=tgz")
      if [[ $? -eq 0 ]]; then
        printf "Account $2 restored with success"
      else
        printf "Error during the restore process for account $2. Error message below:"
        printf $ERR
      fi
    else
      build_listRST $1 $2
      cat $TEMPACCOUNT | parallel --jobs $MAX_PARALLEL_PROCESS \
               "mailbox_restore $1 {}"
    fi
    printf "\nRestore mail process with session $1 completed at $(date)\n"
  else
    echo "Nothing to do. Closing..."
    rm -rf $PID
  fi
}

<!-- gh-comment-id:534908723 --> @vladT0 commented on GitHub (Sep 25, 2019): Hi ! File ParallelAction.sh: ``` function mailbox_restore() { ERR=$(curl --insecure -X POST -u "$ADMINUSER:$ADMINPASS" -T "$WORKDIR/$1/$2.tgz" "$WEBPROTO://$MAILHOST:7071/home/$2/?fmt=tgz") if ! [[ $? -eq 0 ]]; then printf "Error during the restore process for account $2. Error message below:" printf "$2: $ERR" elif [[ "$ERR" == *"No such file or directory" ]]; then printf "Account $2 has nothing to restore - skipping..." fi } ``` File RestoreAction.sh: ``` function restore_main_mailbox() { if [[ $SESSION_TYPE == 'TXT' ]]; then SESSION=$(egrep ": $1 started" $WORKDIR/sessions.txt | egrep 'started' | \ awk '{print $2}' | sort | uniq) elif [[ $SESSION_TYPE == "SQLITE3" ]]; then SESSION=$(sqlite3 $WORKDIR/sessions.sqlite3 "select * from backup_session where sessionID='$1'") fi if ! [ -z "$SESSION" ]; then printf "Restore mail process with session $1 started at $(date)" if [[ ! -z $3 && $2 == *"@"* ]]; then ERR=$(curl --insecure -X POST -u "$ADMINUSER:$ADMINPASS" -T "$WORKDIR/$1/$2.tgz" "$WEBPROTO://$MAILHOST:7071/home/$3/?fmt=tgz") if [[ $? -eq 0 ]]; then printf "Account $2 restored with success" else printf "Error during the restore process for account $2. Error message below:" printf $ERR fi else build_listRST $1 $2 cat $TEMPACCOUNT | parallel --jobs $MAX_PARALLEL_PROCESS \ "mailbox_restore $1 {}" fi printf "\nRestore mail process with session $1 completed at $(date)\n" else echo "Nothing to do. Closing..." rm -rf $PID fi } ```
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/zmbackup#84
No description provided.