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

put() ack on deep path returns ENAMETOOLONG err from relay peer #1070

Open
nsreed opened this issue Apr 29, 2021 · 3 comments
Open

put() ack on deep path returns ENAMETOOLONG err from relay peer #1070

nsreed opened this issue Apr 29, 2021 · 3 comments

Comments

@nsreed
Copy link
Contributor

nsreed commented Apr 29, 2021

This is the ack.err I'm receiving in the put() callback:

{
code: "ENAMETOOLONG",
errno: -36,
path: "radata/~7BxxPOfsYoxRoS8MZg4ZToXIgkycgv5fAGMIh2uF18Y.oQwKMmhAN8HQZVSIDtHM6HUuL7FE2B4nn9l34kbH4-A%2Flayers%2Fko1u7yo76w~E3FYy4TjDsp5ayc0GtxLxV73ZMUMtj10eJaHKfPPkhw.GulVqv1RxCny-AqwxemFYFVX4xXzKCgf5wLRT-znSVo%2F%2Fchildren%2Fko2agvjf~E3FYy4TjDsp5ayc0GtxLxV73ZMUMtj10eJaHKfPPkhw.GulVqv1RxCny-AqwxemFYFVX4xXzKCgf5wLRT-znSVo%2F%1BstrokeJoin",
syscall: "open"
}

I believe this is due to a 255 character limit for file names in ext4. I'm in the process of rewriting my app to use a shallower graph structure (i.e., using set() for nested objects wherever possible), but figured it might not hurt to submit an issue for it.

@nsreed
Copy link
Contributor Author

nsreed commented May 1, 2021

What's interesting is that every ack.err gives the ENAMETOOLONG error for the same path. Always radata/~7BxxPOfsYoxRoS8MZg4ZToXIgkycgv5fAGMIh2uF18Y.oQwKMmhAN8HQZVSIDtHM6HUuL7FE2B4nn9l34kbH4-A%2Flayers%2Fko1u7yo76w~E3FYy4TjDsp5ayc0GtxLxV73ZMUMtj10eJaHKfPPkhw.GulVqv1RxCny-AqwxemFYFVX4xXzKCgf5wLRT-znSVo%2F%2Fchildren%2Fko2agvjf~E3FYy4TjDsp5ayc0GtxLxV73ZMUMtj10eJaHKfPPkhw.GulVqv1RxCny-AqwxemFYFVX4xXzKCgf5wLRT-znSVo%2F%1BstrokeJoin which might be a useful hint.

I haven't worked on gun internals very much, but I think the error can be traced to radisk.js:20

function ename(t){ return encodeURIComponent(t).replace(/\*/g, '%2A') }
which seems responsible for resolving the filename to write data out to (I could be totally wrong on that, I haven't found a great way to debug the gun library code). I plan on adding a check to this function to see if the filename exceeds 255 characters, but what to do in that case? no idea.

edit: removed parts of this comment that were problems in my code

@sloev
Copy link

sloev commented Sep 19, 2023

i have the same error:

ERROR: [Error: ENAMETOOLONG: name too long, open 'radata/~fcHbrC7D1xZkYihq0G-fmMYw3yjII4rekIxMdzikX34.-bzdl1r7IHZPYFOsjZNw1FO5OQO07iaR5qj0qf-wd0A%2Fusers%2Fee2cbf55012c9bdf69b8324d1907a2fc3467f8cabac683828571213fa5b13f31%2FdU9ybT-uYaJagAtnV-0zblLxHBJbohZYLaCZHRh_i78.I9Um1wQC_okYUi2wi9x0GzUZoGV1q20Jdu1RxNzRPe8%1Busername_hash'] {
  errno: -63,
  code: 'ENAMETOOLONG',
  syscall: 'open',
  path: 'radata/~fcHbrC7D1xZkYihq0G-fmMYw3yjII4rekIxMdzikX34.-bzdl1r7IHZPYFOsjZNw1FO5OQO07iaR5qj0qf-wd0A%2Fusers%2Fee2cbf55012c9bdf69b8324d1907a2fc3467f8cabac683828571213fa5b13f31%2FdU9ybT-uYaJagAtnV-0zblLxHBJbohZYLaCZHRh_i78.I9Um1wQC_okYUi2wi9x0GzUZoGV1q20Jdu1RxNzRPe8%1Busername_hash'
}

@amark
Copy link
Owner

amark commented Nov 8, 2023

Yahhhhh there's a fix in one of the branches from 2 years ago but it breaks all previous data stored so >.< it never got published. Since we're switching from radix to binary search and that'll be a breaking change anyways, It'll get published with that, but that is IDK on the ETA.

meanwhile to fix (if can reset data) just add .slice(0, 255) I think to the line linked earlier.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants