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

oss2.exceptions.PositionNotEqualToLength #60

Open
houxiyao opened this issue May 27, 2022 · 6 comments
Open

oss2.exceptions.PositionNotEqualToLength #60

houxiyao opened this issue May 27, 2022 · 6 comments
Labels
bug Something isn't working

Comments

@houxiyao
Copy link

https://github.com/fsspec/filesystem_spec/blob/73de5045f95257af153769984312c1a4875087b4/fsspec/spec.py#L1491-L1495

ossfs/ossfs/core.py

Lines 746 to 748 in d1db90c

self.loc = self.fs.append_object(
self.path, self.loc, self.buffer.getvalue()
)

@houxiyao
Copy link
Author

Pandas通过fsspec上传大文件是触发了PositionNotEqualToLength

@karajan1001
Copy link
Collaborator

karajan1001 commented May 27, 2022

Excuse me, could you please provide some more details? how to reproduce this error? Uploading large files, and what does the Pandas do here?

@karajan1001 karajan1001 added the bug Something isn't working label Apr 5, 2023
@rgtjf
Copy link

rgtjf commented Nov 1, 2023

I use fsspec with zstd compressor, and encounter the same issues when the object size raises to 5M.

python=3.10 and ossfs=2023.6.0

import json
import fsspec
import ossfs
import sys

#import ossfs.base as ob
#ob.DEFAULT_BLOCK_SIZE = 5 * 2 ** 30
import random
import string


N = 2**20
res = ''.join(random.choices(string.ascii_uppercase + string.digits, k=N))
print(sys.getsizeof(res) / 2**20)

with fsspec.open("oss://personal-cn/junfeng/t1.jsonl.zst", mode="wb", compression="zstd", encoding="utf-8") as f: 
    lines = ''
    for i in range(100):
        line = ''.join(random.choices(string.ascii_uppercase + string.digits, k=N))
        lines += line
        f.write(line.encode("utf-8"))
        print(i, sys.getsizeof(lines) / 2**20)

OSError: [Errno 5] {'status': 409, 'x-oss-request-id': '6541DDD3D832763531ABC4C5', 'details': {'Code': 'PositionNotEqualToLength', 'Message': 'Position is not equal to file length', 'RequestId': '6541DDD3D832763531ABC4C5', 'HostId': 'personal-cn.oss-cn-wulanchabu-internal.aliyuncs.com', 'EC': '0026-00000016', 'RecommendDoc': 'https://api.aliyun.com/troubleshoot?q=0026-00000016'}}

Last, the size of the stored file is about 5.1M.

@rgtjf
Copy link

rgtjf commented Nov 1, 2023

When changing self.loc to self.offset it would be ok.

@idling11
Copy link
Collaborator

When changing self.loc to self.offset it would be ok.

it looks like the same error with issue 127

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants