Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

b2sdk._internal.exception.BadRequest: No active upload for: .... #1050

Open
program-the-brain-not-the-heartbeat opened this issue Oct 15, 2024 · 2 comments
Labels
more-information-needed More information is needed

Comments

@program-the-brain-not-the-heartbeat
Copy link

program-the-brain-not-the-heartbeat commented Oct 15, 2024

I have a script that backups 2 files (a file backup and a MariaDB SQL backup) in multiple /home folders (about 100) which succeeds in most of the cases but maybe like 25% of them fail with the following error. I believe this only started recently.

I will update to 4.x branch if necessary but I also wouldn't mind staying on 3.19.1 for now.

Versions:
Ubuntu 20.04.6 LTS
b2 command line tool, version 3.19.1

Command:

 /usr/local/bin/b2 sync ${LOCAL_BACKUP_FOLDER}/ b2://${DIRECTORY_B2}/${USER_NAME}/ --keep-days=186 --replace-newer

Output:
I've obscured some of the personal information like file IDs and file names.

hide   *******.sql.tar.gz                               
upload *******.sql.tar.gz.enc
ERROR:b2sdk._internal.sync.action:an exception occurred in a sync action
Traceback (most recent call last):
  File "b2sdk/_internal/sync/action.py", line 55, in run
  File "b2sdk/_internal/sync/action.py", line 167, in do_action
  File "logfury/_logfury/trace_call.py", line 86, in wrapper
  File "b2sdk/_internal/bucket.py", line 1216, in concatenate
  File "logfury/_logfury/trace_call.py", line 86, in wrapper
  File "b2sdk/_internal/bucket.py", line 989, in create_file
  File "b2sdk/_internal/bucket.py", line 1136, in _create_file
  File "logfury/_logfury/trace_call.py", line 86, in wrapper
  File "b2sdk/_internal/transfer/emerge/emerger.py", line 173, in emerge
  File "b2sdk/_internal/transfer/emerge/emerger.py", line 115, in _emerge
  File "b2sdk/_internal/transfer/emerge/executor.py", line 82, in execute_emerge_plan
  File "b2sdk/_internal/transfer/emerge/executor.py", line 231, in execute_plan
  File "concurrent/futures/_base.py", line 456, in result
  File "concurrent/futures/_base.py", line 401, in __get_result
  File "concurrent/futures/thread.py", line 58, in run
  File "b2sdk/_internal/transfer/outbound/upload_manager.py", line 170, in _upload_part
  File "b2sdk/_internal/session.py", line 382, in upload_part
  File "b2sdk/_internal/session.py", line 456, in _wrap_token
  File "b2sdk/_internal/session.py", line 471, in _reauthorization_loop
  File "b2sdk/_internal/session.py", line 544, in _upload_part
  File "b2sdk/_internal/raw_api.py", line 1070, in upload_part
  File "b2sdk/_internal/b2http.py", line 356, in post_content_return_json
  File "b2sdk/_internal/b2http.py", line 309, in request_content_return_json
  File "b2sdk/_internal/b2http.py", line 279, in request
  File "b2sdk/_internal/b2http.py", line 588, in _translate_and_retry
  File "b2sdk/_internal/b2http.py", line 520, in _translate_errors
b2sdk._internal.exception.BadRequest: No active upload for: ***** (bad_request)
b2_upload(/home/*****/private/backups/******.tar.gz.enc, **/****.tar.gz.enc, 1728979337700): BadRequest() No active upload for: ***** (bad_request)
ERROR: Incomplete sync: sync is incomplete
@ppolewicz
Copy link
Collaborator

Is it possible that a large file upload session has been cancelled when the sync was uploading parts?

@ppolewicz ppolewicz added the more-information-needed More information is needed label Oct 17, 2024
@program-the-brain-not-the-heartbeat

I'm not entirely sure as the scripts run through cronjob every night.

After looping through all directories, it does issue a b2 cancel-all-unfinished-large-files <BUCKET> command.

I've also executed that cancel-all-unfinished-large-files command and attempted to manually run the script, and it failed again with same error.

b2 list-unfinished-large-files <BUCKET> returns empty.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
more-information-needed More information is needed
Projects
None yet
Development

No branches or pull requests

2 participants