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

cp: cannot put node in path #673

Closed
MicrowaveDev opened this issue Aug 7, 2023 · 2 comments
Closed

cp: cannot put node in path #673

MicrowaveDev opened this issue Aug 7, 2023 · 2 comments

Comments

@MicrowaveDev
Copy link
Member

MicrowaveDev commented Aug 7, 2023

There was an uncaught error HTTPError: cp: cannot put node in path /bafzbeie7a2hb6utvjrcawnfkokea57liga2krjmxklwxawqadr47mwdj2a-site/content/bafybeidss7s7vj5d7dvsjvgs55z25rv4takxrit7niznsojgtd6m3oah5i.mp4: file does not exist
    at Object.errorHandler [as handleError] (/geesome-node/node_modules/ipfs-http-client/src/lib/core.js:100:15)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Client.fetch (/geesome-node/node_modules/ipfs-utils/src/http.js:145:9)
    at async Object.cp (/geesome-node/node_modules/ipfs-http-client/src/files/cp.js:20:17)
    at async Object.<anonymous> (/geesome-node/app/modules/staticSiteGenerator/index.ts:216:17)
    at async Promise.all (index 0)
    at async Object.exports.forEach (/geesome-node/node_modules/p-iteration/lib/static-methods.js:21:3)
    at async StaticSiteGenerator.postToObj (/geesome-node/app/modules/staticSiteGenerator/index.ts:215:13)
    at async Object.exports.mapSeries (/geesome-node/node_modules/p-iteration/lib/static-methods.js:73:19)
    at async StaticSiteGenerator.generate (/geesome-node/app/modules/staticSiteGenerator/index.ts:177:27) {
  response: Response {
    [Symbol(realm)]: null,
    [Symbol(state)]: {
      aborted: false,
      rangeRequested: false,
      timingAllowPassed: true,
      requestIncludesCredentials: true,
      type: 'default',
      status: 500,
      timingInfo: [Object],
      cacheState: '',
      statusText: 'Internal Server Error',
      headersList: [HeadersList],
      urlList: [Array],
      body: [Object]
    },
    [Symbol(headers)]: HeadersList {
      [Symbol(headers map)]: [Map],
      [Symbol(headers map sorted)]: null
    }
  }
}
/geesome-node/node_modules/node-mediainfo/lib/MediaInfoWasm.js:19
function(a){if(!(a instanceof x))throw a;});c.inspect=function(){return"[Emscripten Module object]"}}else if(ca)c.print||(c.print=print),"undefined"!=typeof printErr&&(c.printErr=printErr),c.read="undefined"!=typeof read?read:function(){throw"no read() available";},c.readBinary=function(a){if("function"===typeof readbuffer)return new Uint8Array(readbuffer(a));a=read(a,"binary");assert("object"===typeof a);return a},"undefined"!=typeof scriptArgs?c.arguments=scriptArgs:"undefined"!=typeof arguments&&
@MicrowaveDev
Copy link
Member Author

I added file to my go-ipfs node using ipfs-http client, but when i'm trying to get it from MFS - it throws error while it can be accessed outside of MFS functions.
Here's a code:

const {create} = require('ipfs-http-client');
const itFirst = require('it-first');

(async () => {
  const {CID, URL} = process.env;
  const client = create({url: URL || 'http://127.0.0.1:5001'});

  await itFirst(client.ls(CID))
      .then(r => console.log('ls r', r))
      .catch(err => console.log('ls err', err));

  await itFirst(client.cat(CID))
      .then(r => console.log('cat r', r))
      .catch(err => console.log('cat err', err));

  await client.pin.add(CID)
      .then(r => console.log('pin r', r))
      .catch(err => console.log('pin err', err));

  await itFirst(client.files.ls('/ipfs/' + CID))
      .then(r => console.log('files ls r', r))
      .catch(err => console.log('files ls err', err));
})();

Here's output:

ls r {
  name: '',
  path: 'bafybeidss7s7vj5d7dvsjvgs55z25rv4takxrit7niznsojgtd6m3oah5i',
  size: 262144,
  cid: CID(bafkreigqgy4xts73i7hvl5nxe7h2ocui6ejz2a2pb2ujet356l3uypgkva),
  type: 'file'
}
cat r Uint8Array(20480) [
    0,   0,   0,  24, 102, 116, 121, 112, 109, 112,  52,  50,
    0,   0,   0,   0, 105, 115, 111, 109, 109, 112,  52,  50,
    0,   0, 247, 194, 109, 111, 111, 118,   0,   0,   0, 108,
  109, 118, 104, 100,   0,   0,   0,   0, 219, 191, 189,  67,
  219, 191, 189,  67,   0,   0,  60,   0,   0,  36, 100,  79,
    0,   1,   0,   0,   1,   0,   0,   0,   0,   0,   0,   0,
    0,   0,   0,   0,   0,   1,   0,   0,   0,   0,   0,   0,
    0,   0,   0,   0,   0,   0,   0,   0,   0,   1,   0,   0,
    0,   0,   0,   0,
  ... 20380 more items
]
pin r CID(bafybeidss7s7vj5d7dvsjvgs55z25rv4takxrit7niznsojgtd6m3oah5i)
files ls err HTTPError: file does not exist
    at Object.errorHandler [as handleError] (/root/geesome-node/node_modules/ipfs-http-client/src/lib/core.js:100:15)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Client.fetch (/root/geesome-node/node_modules/ipfs-utils/src/http.js:145:9)
    at async Object.ls (/root/geesome-node/node_modules/ipfs-http-client/src/files/ls.js:21:17)
    at async first (/root/geesome-node/node_modules/it-first/index.js:11:20)
    at async /root/geesome-node/check/ipfsFileExists.ts:29:3 {
  response: Response {
    [Symbol(realm)]: null,
    [Symbol(state)]: {
      aborted: false,
      rangeRequested: false,
      timingAllowPassed: true,
      requestIncludesCredentials: true,
      type: 'default',
      status: 500,
      timingInfo: [Object],
      cacheState: '',
      statusText: 'Internal Server Error',
      headersList: [HeadersList],
      urlList: [Array],
      body: [Object]
    },
    [Symbol(headers)]: HeadersList {
      [Symbol(headers map)]: [Map],
      [Symbol(headers map sorted)]: null
    }
  }
}

client.files.copy also doesnt work with this cid. What can i do to make it accessible by MFS functions?

go-ipfs version: v0.9.1

@MicrowaveDev
Copy link
Member Author

ipfs/js-ipfs#3914

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

1 participant