safeNfs.create() - Error: First argument must be a string, Buffer, ArrayBuffer, Array

@happybeing Back at it.

Okay, so the error that I’m seeing seems to be about an attempt to get a container that the Plume doesn’t ask permission for:

listContainer is called on _publicNames but that wasn’t a container asked for during safeApp.authorise, given this default permissions: https://github.com/theWebalyst/solid-plume/blob/safenetwork-poc/app/app.js#L23

UPDATE:
I added _publicNames request and that resolves that error.
I am however running Plume in localhost so I get

[safe-tmp] failFetch([object Object],Request to safe://solidpoc05/ldp/solid-plume01/posts/ timed out,timeout)
fetcher.js:872 @@ Recording failure for <safe://solidpoc05/ldp/solid-plume01/posts/>: timeout

I’ll have to upload or change the requested URI so that posts may be fetched.

I’m still hunting down why this error is occurring:

safe:solid SAFEApp SafeNetwork Initialise Failed: Error: 
    Malformed appInfo.
    Make sure you conform to proper format and that id, name, and vendor are defined:
    {
      id: 'net.maidsafe.example.id',
      name: 'Name of App',
      vendor: 'MaidSafe Ltd.',
      scope: null
    } +17ms

I’ve got logs in all the right places but I can’t sniff it out yet, however I don’t think it’s affecting your app.

Thanks Hunter, I don’t think either of those are a concern for me. The containers I already have listing fine and the “Malformed appInfo” error is not a concern for me - I think it is just Peruse not handling a request for Auth properly when the user is not logged into an account.

It looks like you’ve pulled some other code there, although maybe not my latest code as that lists containers w/o problems. I don’t recall what was in the code in the OP, which causes the error in the title, but what stumped me was the safeNfs.create() error in the OP title, as the params looked fine in the browser debugger.

I have not yet tried it with the latest Peruse tho, so first step would be to repeat this test, as the live code (see below) hasn’t been changed. I shall download latest Peruse and report back…

UPDATE: the safeNfs.create() error of the OP is still present in Peruse 0.4.1. <<- this is the only thing I need help with at the moment. I am going to start re-factoring that code though, so once I’ve done that I’ll be able to test if this problem remains. In the mean time, it seems that the issue might be either an obscure bug, or more likely just not a very helpful error message.

Oh I see now:
I placed a log here just above this line: https://github.com/theWebalyst/solid-safenetwork/blob/wip/src/safenetwork-solid.js#L1032
console.log('createFile arguments: ', arguments);

The second argument of _createFile, body, is a request object and is directly fed to safeNfs.create:
return window.safeNfs.create(self._nfsRoot, body) but it appears that body.body should be provided instead as the contents of the file to be created on the network.

UPDATE: I just change it to body.body and console no longer logs safeNfs.create error.

Unless you do want the fileContents to be the request object, then you can just stringify it.

1 Like

Thanks Hunter, you know I thought I’d tried that but I guess not. I tried a few things along those lines but obviously not that :blush:

I shall have a go myself and confirm all’s well. Thank you again :smile:

1 Like

This topic was automatically closed after 60 days. New replies are no longer allowed.