Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

[ipfs-core] - Exception is raised when attempting to releaseLock #3520

Closed
xmaysonnave opened this issue Feb 3, 2021 · 9 comments
Closed
Assignees
Labels
kind/support A question or request for support kind/wontfix-migration-available

Comments

@xmaysonnave
Copy link

Environment

  • Debian Bullseye, Kernel 5.10.12-xanmod1
  • Chrome Version 88.0.4324.146 (Official Build) (64-bit)
  • ipfs-core 0.5.1

Severity:

Medium, while debugging Chrome always complain even the 'Pause on caught exceptions' is unchecked

Description:

ipfs-http-client dynamically downloaded from jsdelivr
https://cdn.jsdelivr.net/npm/ipfs-http-client@49.0.1/dist/index.min.js

Component

ipfs-core/src/runtime/preload-brower.js

Chrome Developper tools is open.
The following exception is triggered in the finally close while attempting to release the reader lock (line 32)

TypeError: This readable stream reader has been released and cannot be used to monitor the stream's state

Thanks

@achingbrain
Copy link
Member

Do you have a small example project I can use to reproduce this problem?

@xmaysonnave
Copy link
Author

xmaysonnave commented Feb 9, 2021

@achingbrain I will be very happy to provide an example however :
I dynamically load the library from jsdelivr (sri hash enabled) I noticed that no non minified version is available.
https://www.jsdelivr.com/package/npm/ipfs-http-client?path=dist
It would be useful to have a non minified version.
Maybe if you can build a non minified version on github I will able to load it with a minimal impact on my side.
The idea here is to reproduce it on my side and give you something useful.
Let me know.
Thanks

@achingbrain
Copy link
Member

Linking to the minified code in your project is fine, I can always swap it out locally to see if the error still occurs.

@xmaysonnave
Copy link
Author

Chrome Version 88.0.4324.150 (Official Build) (64-bit)
Debian Bullseye, kernel 5.10.14-xanmod1

https://dweb.link/ipfs/bafybeiguy3u45vc2i5ojlhmqfffpvxpfrcs4nq7ov6ez7kj7vbzmfuvx4m

Load IPFS with TiddlyWiki with the previous link.
Open the Developer Tools (ipfs-http-client is not yet loaded).
Select Sources and open the console.
I usually preserve the console log while saving.
The pause on caught exceptions is unchecked.

At the very top:

  • add a tiddler (+ command),
  • save it (green button),
  • the wiki should be dirty (At the very top you should see the save button who turned red)

You are going to save over ipfs.infura.io:5001 and load the new wiki from dweb.link.
The console will output a lot of informations.

While saving the exception is raised multiple times.

Thanks

@achingbrain
Copy link
Member

Do I need to be authenticated at all? I've followed your instructions but get a 403 when it tries to do an ipfs.files.stat:

image

@achingbrain achingbrain added kind/support A question or request for support and removed need/triage Needs initial labeling and prioritization labels Feb 24, 2021
@xmaysonnave
Copy link
Author

xmaysonnave commented Feb 24, 2021 via email

@achingbrain
Copy link
Member

infura do not allow files.stat.

It looks like the application is invoking this here: https://github.com/xmaysonnave/tiddlywiki-ipfs/blob/73038b5b41d1675848a978207f4b53c3f1c2a316/core/modules/library/ipfs-bundle/ipfs-library.js#L372 called from here: https://github.com/xmaysonnave/tiddlywiki-ipfs/blob/73038b5b41d1675848a978207f4b53c3f1c2a316/core/modules/library/ipfs-bundle.js#L426

You may need to refactor your application to only use APIs that infura allow.

Did you get the exception I detailed?

No, only what I pasted above.

@xmaysonnave
Copy link
Author

xmaysonnave commented May 30, 2021

The exception remains in the latest however with Chrome Developer Tools the 'Pause on Exceptions' should be selected (the 'Pause on caught exception' should be unchecked)

ksnip_20210530-121633

This exception is handled by Chrome though and do not seem to cause any trouble if Pause on Exceptions is unchecked.

Here is an updated link of IPFS with TiddlyWiki
https://bafybeicxmapwbfqh6e3z7nyr3turbn4o22mcsxsm3xfhn5nfzoagxcqk6i.ipfs.dweb.link/

Thanks

@SgtPooki
Copy link
Member

js-ipfs is being deprecated in favor of Helia. You can #4336 and read the migration guide.

Please feel to reopen with any comments by 2023-06-02. We will do a final pass on reopened issues afterward (see #4336).

This issue won't be fixed in js-ipfs but there is replacement functionality available in kubo-rpc-client that should work much better.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/support A question or request for support kind/wontfix-migration-available
Projects
No open projects
Status: Done
Development

No branches or pull requests

3 participants