safeNfs.insert(): Error: Core error: Routing client error -> Requested data not found

Any clues what can cause this error message? Might it be permissions on the MD?

I’m assuming the MD handle is fine because safeNfs.create() succeeds immediately prior - code (error is on the safeNfs.insert() call:

// Create file
  // @returns promise which resolves to a Resonse object
  async _createFile (fullPath, body, contentType, options) {
    safeWebLog('%s._createFile(\'%s\',%O,%o,%O)',, fullPath, body, contentType, options)
    try {
      let fileHandle = await window.safeNfs.create(await this.storageNfs(), body)
      fileHandle = await window.safeNfs.insert(await this.storageNfs(), fileHandle, fullPath)
      this._updateFileInfo(fileHandle, fullPath)

      return new Response()
    } catch (err) {
      safeWebLog('Unable to create file \'%s\' : %s', fullPath, err)
      return new Response(null, {}, {status: 500, responseText: '500 Internal Server Error (' + err + ')'})

@happybeing, is the MD behind the NFSHandle returned by this.storageNfs() committed to the network by the time you try to create and insert a file? i.e. did you commit it with either put or quickSetup by then?


Solved: the it was committed, but I wasn’t interpreting the value stored in my service MD entry properly, so it couldn’t find the MD with that name.

I now have files being stored in an LDP service and I can get a directory listing of the LDP for container. Wooooo hooooo :slight_smile:

Thanks for the quick response Gabriel, helpful as always.