I was able to publish it and load it now.
When I load the page, before hitting “Initialise Storage”, I see the following errors in the dev console which seems you are not passing the handle/s properly to your functions:
browser.js:133 safe:web getServiceForUri(safe://gplumetest1/config.json) FAILED: Error: Invalid handle: null
This is the complete log:
safe:plume initPlume()
browser.js:133 safe:web SafenetworkWebApi.fetch(safe://gplumetest1/config.json,undefined)... +30ms
browser.js:133 safe:web SafenetworkWebApi._fetch(safe://gplumetest1/config.json,undefined) +1ms
browser.js:133 safe:web getServiceForUri(safe://gplumetest1/config.json)... +0ms
browser.js:133 safe:web URI has profile '' and publicName 'gplumetest1' +1ms
browser.js:133 safe:web getServicesMdFor(gplumetest1) +1ms
browser.js:133 safe:web host 'gplumetest1' has publicName 'gplumetest1' +0ms
browser.js:133 safe:web makeServicesMdName(gplumetest1) +0ms
browser.js:133 safe:web makeServicesMdName(gplumetest1) +11ms
browser.js:133 safe:web getServiceForUri(safe://gplumetest1/config.json) FAILED: Error: Invalid handle: null
at /home/bochaco/work/bochaco-safe_browser/dist/safe-browser-v0.10.2-linux-x64/resources/app/node_modules/beaker-plugin-safe-app/dist/api.js:130:19
at Promise (<anonymous>)
at getObj (/home/bochaco/work/bochaco-safe_browser/dist/safe-browser-v0.10.2-linux-x64/resources/app/node_modules/beaker-plugin-safe-app/dist/api.js:121:10)
at Object.module.exports.module.exports.sha3Hash (/home/bochaco/work/bochaco-safe_browser/dist/safe-browser-v0.10.2-linux-x64/resources/app/node_modules/beaker-plugin-safe-app/dist/api.js:1170:10)
at EventEmitter.<anonymous> (/home/bochaco/work/bochaco-safe_browser/dist/safe-browser-v0.10.2-linux-x64/resources/app/node_modules/pauls-electron-rpc/lib/export-api.js:73:20)
at emitMany (events.js:146:13)
at EventEmitter.emit (events.js:223:7)
at WebContents.<anonymous> (/home/bochaco/work/bochaco-safe_browser/dist/safe-browser-v0.10.2-linux-x64/resources/electron.asar/browser/api/web-contents.js:266:13)
at emitTwo (events.js:125:13)
at WebContents.emit (events.js:213:7) +4ms
browser.js:133 safe:web SafenetworkWebApi._fetch() - no service available, defaulting to webFetch()... +2ms
browser.js:133 safe:web SafenetworkWebApi._fetch() error: Error: Invalid handle: null
at /home/bochaco/work/bochaco-safe_browser/dist/safe-browser-v0.10.2-linux-x64/resources/app/node_modules/beaker-plugin-safe-app/dist/api.js:130:19
at Promise (<anonymous>)
at getObj (/home/bochaco/work/bochaco-safe_browser/dist/safe-browser-v0.10.2-linux-x64/resources/app/node_modules/beaker-plugin-safe-app/dist/api.js:121:10)
at Object.module.exports.module.exports.webFetch (/home/bochaco/work/bochaco-safe_browser/dist/safe-browser-v0.10.2-linux-x64/resources/app/node_modules/beaker-plugin-safe-app/dist/api.js:613:10)
at EventEmitter.<anonymous> (/home/bochaco/work/bochaco-safe_browser/dist/safe-browser-v0.10.2-linux-x64/resources/app/node_modules/pauls-electron-rpc/lib/export-api.js:73:20)
at emitMany (events.js:146:13)
at EventEmitter.emit (events.js:223:7)
at WebContents.<anonymous> (/home/bochaco/work/bochaco-safe_browser/dist/safe-browser-v0.10.2-linux-x64/resources/electron.asar/browser/api/web-contents.js:266:13)
at emitTwo (events.js:125:13)
at WebContents.emit (events.js:213:7) +1ms
app.js:2059 FAILED to load config from file 'safe://gplumetest1/config.json' - response: 404
app.js:2066 safe:plume jsonConfig: Object {title: "SAFE Plume Blog (dev hardConfig)", tagline: "Safe as houses, light as a feather", picture: "safe-quill.png", fadeText: true, showSources: true…}
app.js:1947 safe:plume init()...
app.js:1833 safe:plume applyConfig()...
app.js:371 safe:plume showBlog()
browser.js:133 safe:web SafenetworkWebApi.fetch(safe://gplumetest1/posts/,Object)... +6ms
browser.js:133 safe:web SafenetworkWebApi._fetch(safe://gplumetest1/posts/,Object) +0ms
browser.js:133 safe:web getServiceForUri(safe://gplumetest1/posts/)... +1ms
app.js:404 safe:plume DEBUG URLf: safe://gplumetest1/
browser.js:133 safe:web URI has profile '' and publicName 'gplumetest1' +0ms
browser.js:133 safe:web getServicesMdFor(gplumetest1) +1ms
browser.js:133 safe:web host 'gplumetest1' has publicName 'gplumetest1' +0ms
browser.js:133 safe:web makeServicesMdName(gplumetest1) +0ms
app.js:2074 safe:plume DEBUG initPlume() completed!
app.js:2108 safe:plume DEBUG Plume init done!
app.js:2109 Plume result: Object {user: Object, posts: Object, notify: function, login: function, logout: function…}
app.js:2110 safe:plume DEBUG URL: safe://gplumetest1/
browser.js:133 safe:web makeServicesMdName(gplumetest1) +10ms
browser.js:133 safe:web getServiceForUri(safe://gplumetest1/posts/) FAILED: Error: Invalid handle: null
at /home/bochaco/work/bochaco-safe_browser/dist/safe-browser-v0.10.2-linux-x64/resources/app/node_modules/beaker-plugin-safe-app/dist/api.js:130:19
at Promise (<anonymous>)
at getObj (/home/bochaco/work/bochaco-safe_browser/dist/safe-browser-v0.10.2-linux-x64/resources/app/node_modules/beaker-plugin-safe-app/dist/api.js:121:10)
at Object.module.exports.module.exports.sha3Hash (/home/bochaco/work/bochaco-safe_browser/dist/safe-browser-v0.10.2-linux-x64/resources/app/node_modules/beaker-plugin-safe-app/dist/api.js:1170:10)
at EventEmitter.<anonymous> (/home/bochaco/work/bochaco-safe_browser/dist/safe-browser-v0.10.2-linux-x64/resources/app/node_modules/pauls-electron-rpc/lib/export-api.js:73:20)
at emitMany (events.js:146:13)
at EventEmitter.emit (events.js:223:7)
at WebContents.<anonymous> (/home/bochaco/work/bochaco-safe_browser/dist/safe-browser-v0.10.2-linux-x64/resources/electron.asar/browser/api/web-contents.js:266:13)
at emitTwo (events.js:125:13)
at WebContents.emit (events.js:213:7) +1ms
browser.js:133 safe:web SafenetworkWebApi._fetch() - no service available, defaulting to webFetch()... +1ms
browser.js:133 safe:web SafenetworkWebApi._fetch() error: Error: Invalid handle: null
at /home/bochaco/work/bochaco-safe_browser/dist/safe-browser-v0.10.2-linux-x64/resources/app/node_modules/beaker-plugin-safe-app/dist/api.js:130:19
at Promise (<anonymous>)
at getObj (/home/bochaco/work/bochaco-safe_browser/dist/safe-browser-v0.10.2-linux-x64/resources/app/node_modules/beaker-plugin-safe-app/dist/api.js:121:10)
at Object.module.exports.module.exports.webFetch (/home/bochaco/work/bochaco-safe_browser/dist/safe-browser-v0.10.2-linux-x64/resources/app/node_modules/beaker-plugin-safe-app/dist/api.js:613:10)
at EventEmitter.<anonymous> (/home/bochaco/work/bochaco-safe_browser/dist/safe-browser-v0.10.2-linux-x64/resources/app/node_modules/pauls-electron-rpc/lib/export-api.js:73:20)
at emitMany (events.js:146:13)
at EventEmitter.emit (events.js:223:7)
at WebContents.<anonymous> (/home/bochaco/work/bochaco-safe_browser/dist/safe-browser-v0.10.2-linux-x64/resources/electron.asar/browser/api/web-contents.js:266:13)
at emitTwo (events.js:125:13)
at WebContents.emit (events.js:213:7) +1ms
app.js:374 HEAD response: Response
app.js:392 safe:plume DEBUG URLc: safe://gplumetest1/
app.js:1613 safe:plume DEBUG URL resetAll() START: safe://gplumetest1/
app.js:193 safe:plume DEBUG authorParam( ? )
app.js:194 safe:plume DEBUG - user.authenticated: undefined
app.js:195 safe:plume DEBUG - user.webid: undefined
app.js:1638 safe:plume DEBUG URL resetAll() DONE: safe://gplumetest1/
app.js:394 safe:plume DEBUG URLd: safe://gplumetest1/
app.js:396 safe:plume DEBUG URLe: safe://gplumetest1/
Then after hitting “Initialise Storage”, I get the app authorised, and I see a SAFEApp instance is created.
But after a moment I see the page is refreshed and the app requests to get authorised again and a second SAFEApp instance is created, and the first one is not being freed, so that one is being leaked. At this point I don’t think I’m getting any errors and I get the page to create the posts.
Then I tried creating a post but it fails, I see the following errors on the dev console which seems related to incorrect permissions on an NFS container:
safe:ldp Unable to create file 'safe://gplumetest1/posts/1525171711077-test-leakage-2.ttl' : Error: Core error: Routing client error -> Access denied
This is the complete log:
safe:ldp SafeServiceLDP._getFolder('safe://gplumetest1/posts/', ...) response 200 body:
@prefix : <#>.
@prefix ldp: <http://www.w3.org/ns/ldp#>.
<> a ldp:BasicContainer, ldp:Container.
+1ms
solid.js:417 HEAD response: OK Response
app.js:849 plume:safe DEBUG user.name: happybeing
app.js:850 plume:safe DEBUG user.picture: mugshot-hb.jpg
app.js:915 safe:plume savePost(post, undefined)
solid.js:527 safe:plume PUT safe://gplumetest1/posts/1525170216699-test-leakage-1.ttl
browser.js:133 safe:web SafenetworkWebApi.fetch(safe://gplumetest1/posts/1525170216699-test-leakage-1.ttl,Object)... +39s
browser.js:133 safe:web SafenetworkWebApi._fetch(safe://gplumetest1/posts/1525170216699-test-leakage-1.ttl,Object) +1ms
browser.js:133 safe:web getServiceForUri(safe://gplumetest1/posts/1525170216699-test-leakage-1.ttl)... +2ms
browser.js:133 safe:ldp SafeServiceLDP.put(safe://gplumetest1/posts/1525170216699-test-leakage-1.ttl,Object) +39s
browser.js:133 safe:ldp SafeServiceLDP._getFileInfo(/posts/1525170216699-test-leakage-1.ttl) +2ms
browser.js:133 safe:ldp storageNfs() +111ms
browser.js:133 safe:ldp _getFileInfo(/posts/1525170216699-test-leakage-1.ttl) file does not exist, no fileInfo available +103ms
browser.js:133 safe:ldp SafeServiceLDP._createFile('safe://gplumetest1/posts/1525170216699-test-leakage-1.ttl',@prefix n: <http://rdfs.org/sioc/ns#>.
@prefix terms: <http://purl.org/dc/terms/>.
@prefix XML: <http://www.w3.org/2001/XMLSchema#>.
@prefix n0: <safe://gplumetest1/posts/1525170216699-test-leakage-1.ttl#>.
@prefix c: <safe://gplumetest1/card#>.
@prefix n1: <http://xmlns.com/foaf/0.1/>.
<safe://gplumetest1/posts/1525170216699-test-leakage-1.ttl>
a n:Post;
terms:created "2018-05-01T10:23:36+00:00"^^XML:dateTime;
terms:modified "2018-05-01T10:23:36+00:00"^^XML:dateTime;
terms:title "test leakage 1";
n:content "test leakage 1 text";
n:has_creator n0:author.
n0:author
a n:UserAccount;
n:account_of c:me;
n:avatar <safe://gplumetest1/mugshot-hb.jpg>;
n1:name "happybeing".
,undefined,Object) +0ms
browser.js:133 safe:ldp DEBUG: window.safeNfs.create()... +1ms
browser.js:133 safe:ldp DEBUG: window.safeNfs.insert(nfsHandle,fileHandle,posts/1525170216699-test-leakage-1.ttl)... +197ms
browser.js:133 safe:ldp Unable to create file 'safe://gplumetest1/posts/1525170216699-test-leakage-1.ttl' : Error: Core error: Routing client error -> Access denied
at module.exports (/home/bochaco/work/bochaco-safe_browser/dist/safe-browser-v0.10.2-linux-x64/resources/app/node_modules/@maidsafe/safe-node-app/src/native/_error.js:19:10)
at args.push.ffi.Callback.restArgs (/home/bochaco/work/bochaco-safe_browser/dist/safe-browser-v0.10.2-linux-x64/resources/app/node_modules/@maidsafe/safe-node-app/src/native/_base.js:92:27)
at /home/bochaco/work/bochaco-safe_browser/dist/safe-browser-v0.10.2-linux-x64/resources/app/node_modules/ffi/lib/callback.js:66:25 +195ms
browser.js:133 safe:ldp SafeServiceLDP.put putDone(status: 500) for path: safe://gplumetest1/posts/1525170216699-test-leakage-1.ttl +2ms
browser.js:133 safe:ldp putDone() failed: Error: PUT failed with status 500 (500 Internal Server Error (-100: Core error: Routing client error -> Access denied)) +1ms
browser.js:133 safe:web SafenetworkWebApi._fetch() error: Error: PUT failed with status 500 (500 Internal Server Error (-100: Core error: Routing client error -> Access denied))
at putDone (safe://gplumetest1/js/safenetwork-webapi.js:50029:17)
at SafeServiceLDP.put (safe://gplumetest1/js/safenetwork-webapi.js:50046:16)
at <anonymous> +613ms
browser.js:133 safe:web SafenetworkWebApi._fetch() - no service available, defaulting to webFetch()... +1ms
browser.js:133 safe:web SafenetworkWebApi._fetch() error: Error: NFS error: File not found
at module.exports (/home/bochaco/work/bochaco-safe_browser/dist/safe-browser-v0.10.2-linux-x64/resources/app/node_modules/@maidsafe/safe-node-app/src/native/_error.js:19:10)
at args.push.ffi.Callback.restArgs (/home/bochaco/work/bochaco-safe_browser/dist/safe-browser-v0.10.2-linux-x64/resources/app/node_modules/@maidsafe/safe-node-app/src/native/_base.js:92:27)
at /home/bochaco/work/bochaco-safe_browser/dist/safe-browser-v0.10.2-linux-x64/resources/app/node_modules/ffi/lib/callback.js:66:25 +578ms
solid.js:534 PUT response: 404 Not Found Response
app.js:962 Could not create post!
app.js:963 TypeError: Cannot read property 'url' of undefined
at app.js:953
at <anonymous>
app.js:1613 safe:plume DEBUG URL resetAll() START: safe://gplumetest1/?author=safe%3A%2F%2Fgplumetest1%2Fcard%23me#
app.js:193 safe:plume DEBUG authorParam( ? )
app.js:194 safe:plume DEBUG - user.authenticated: true
app.js:195 safe:plume DEBUG - user.webid: safe://gplumetest1/card#me
app.js:1638 safe:plume DEBUG URL resetAll() DONE: safe://gplumetest1/?author=safe%3A%2F%2Fgplumetest1%2Fcard%23me
I don’t know if it’s related to the fact that happybeing
seems to be set as the user, which seems to be hard-coded somewhere as I don’t see that in the config.json
I tried closing the tab at that point, and the only 2 SAFEApp instances that were created are freed automatically, in fact I was able to tried this flow 4+ times and none of them gave me the error about network connection but the problems I just described.
How do I get it to allow me to create posts?