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

OperationError: The operation failed for an operation-specific reason on IPFS.create() (iOS 14.7.1) #3878

Closed
joe-p opened this issue Sep 18, 2021 · 6 comments
Labels
need/triage Needs initial labeling and prioritization

Comments

@joe-p
Copy link

joe-p commented Sep 18, 2021

  • Version: 0.10.8
  • Platform: iPhone 11 running iOS 14.7.1
  • Subsystem: libp2p-crypto (I think...)

Seems to be a problem stemming from SubtleCrypto since the exception is from SubtleCrypto.decrypt() or SubtleCrypto.encrypt(), so I assume it's somewhere in libp2p-crypto

https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/decrypt#exceptions
https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/encrypt#exceptions

Severity: High - iOS 14 functionality broken

Description:

When trying to use ipfs-core on iOS 14.7.1, IPFS.create() fails to run with the following exception shown in the console:

[Error] Unhandled Promise Rejection: OperationError: The operation failed for an operation-specific reason
	(anonymous function) (main.chunk.js:55:82)
	asyncFunctionResume
	(anonymous function)
	promiseReactionJobWithoutPromise
	promiseReactionJob

The console log shows the error is from App.js:8 but that isn't reflect when copy/pasting for some reason:

Screen Shot 2021-09-18 at 6 06 43 PM

Steps to reproduce the error:

  1. npx create-react-app ipfs-test && cd ipfs-test
  2. npm i ipfs-core
  3. Modified contents of App.js
import { useEffect } from "react";
import IPFS from 'ipfs-core';

function App() {

  useEffect(() => {
    (async () => {    
      const ipfs = await IPFS.create()
      const { cid } = await ipfs.add('Hello world')
      const { version } = await ipfs.version()
      console.info(cid)
      document.getElementById('cid').innerText = version + ' ' + cid
    })();
  })

  return (
    <div className="App">
      <div id="cid">Waiting for IPFS...</div>
    </div>
  );
}

export default App;
  1. npm start
  2. Verify page works on desktop (I'm using Firefox on Mac OS and it works)
  3. Attempt to visit page on iOS
  4. Look at console log to see the aforementioned exception

package-lock.json
package.json

Note: I am running this on the node:14 docker image behind traefik so I am accessing the site via HTTPS

@joe-p joe-p added the need/triage Needs initial labeling and prioritization label Sep 18, 2021
@welcome
Copy link

welcome bot commented Sep 18, 2021

Thank you for submitting your first issue to this repository! A maintainer will be here shortly to triage and review.
In the meantime, please double-check that you have provided all the necessary information to make this process easy! Any information that can help save additional round trips is useful! We currently aim to give initial feedback within two business days. If this does not happen, feel free to leave a comment.
Please keep an eye on how this issue will be labeled, as labels give an overview of priorities, assignments and additional actions requested by the maintainers:

  • "Priority" labels will show how urgent this is for the team.
  • "Status" labels will show if this is ready to be worked on, blocked, or in progress.
  • "Need" labels will indicate if additional input or analysis is required.

Finally, remember to use https://discuss.ipfs.io if you just need general support.

@joe-p
Copy link
Author

joe-p commented Sep 21, 2021

I just updated to iOS 15. which includes a significant update to Safari, and IPFS works as expected with the exact same source code. This bug seems to be specific to iOS/Safari 14.7.1. More testing would be needed to determine if it affects all older iOS versions or just 14.7.1.

@BigLep
Copy link
Contributor

BigLep commented Sep 24, 2021

Thanks for reporting. Given new iOS addresses this issue, maintainers aren't going to dig into this issue for 14.7.

@BigLep BigLep closed this as completed Sep 24, 2021
@sebastiendan
Copy link

Hi! I just noticed the same problem on iOS 14.[6|8]. Is there any one working on a solution? It does work on iOS 15, but according to figures from last month (here), only ~60% of iPhone users have upgraded to iOS 15, with still 36% of them on iOS 14.

It seems difficult to me to consider that a critical bug like this one shouldn't be fixed for such a large user base considering the notoriety IPFS has gained over the years.

@matheus23
Copy link
Contributor

We're starting to hit these issues at fission as well. Has someone made progress on figuring out where this issue is coming from yet?

In case we can figure out a fix for this, would you be open to merging a fix for this @BigLep?

@icidasset
Copy link
Contributor

Workaround, change the crypto algorithm for the peer id keypair:

IPFS.create({
  init: { algorithm: isSafari ? "RSA" : "Ed25519" }
})

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
need/triage Needs initial labeling and prioritization
Projects
None yet
Development

No branches or pull requests

5 participants