jjjake/internetarchive

`Uploaded content is unacceptable. - error checking archive file` while uploading splitted zip file

Closed this issue · 4 comments

Hello.

I'm trying to upload splitted zip files like .zip, .z01, .z02, .... (which has almost 60GBs total), but while uploading it has errors.

Error traceback

 error uploading ***.z01: Uploaded content is unacceptable. - error checking archive file
Traceback (most recent call last):
  File "/var/packages/py3k/target/usr/local/lib/python3.8/site-packages/internetarchive/item.py", line 1057, in upload_file
    response.raise_for_status()
  File "/var/packages/py3k/target/usr/local/lib/python3.8/site-packages/requests/models.py", line 1021, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 400 Client Error: Bad Data for url: https://s3.us.archive.org/***/***.z01

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "archive.py", line 16, in <module>
    upload("lostark_1320", files=file, verbose=True, checksum=True, delete=False)
  File "/var/packages/py3k/target/usr/local/lib/python3.8/site-packages/internetarchive/api.py", line 280, in upload
    return item.upload(
  File "/var/packages/py3k/target/usr/local/lib/python3.8/site-packages/internetarchive/item.py", line 1224, in upload
    resp = self.upload_file(body,
  File "/var/packages/py3k/target/usr/local/lib/python3.8/site-packages/internetarchive/item.py", line 1082, in upload_file
    raise type(exc)(error_msg, response=exc.response, request=exc.request)
requests.exceptions.HTTPError:  error uploading ***.z01 to ***, Uploaded content is unacceptable. - error checking archive file

It semms there are related issue already (#408), but It seems that zip files are not fixed yet.

My python script

from internetarchive import configure, upload, get_item, get_files
import sys
import os
import os.path

configure("***@gmail.com", "***")

item = get_item("***")
print(item.metadata)

# Get all local files
for file in os.listdir("./"):
    if file.endswith(".py"): continue

    upload("***", files=file, verbose=True, checksum=True, delete=False)
print("done")

My internetarchive version

ash-4.3# python3
iPython 3.8.6 (default, Jan  4 2021, 16:11:49)
[GCC 4.9.3 20150311 (prerelease)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import internetarchive
>>> internetarchive.__version__
'3.3.0'
>>>

Are the individual "split" ZIPs valid ZIP files? If not, I'd suggest splitting the files into multiple valid ZIP files.

@jjjake All of splitted ZIP files are valid and works properly, I've compressed with 7zip.
Am I need to change compression method - like 7z or rar?

@mirusu400 Thanks for the reply. I would recommend writing info@archive.org about this. I'm not sure whether this is something IA-S3 supports. I am guessing it doesn't like the extension (e.g. .z01 vs .zip), and changing that might be a policy decision. Thanks again, and sorry I couldn't be more helpful.

this bug is still a thing FWIW.