SAFE Drive - OSX


#41

Sorry for the delayed response @Stout77, I’ve been away the last week and a bit.

The encoded reponse is the uri on the line line starting renderer.js:34 [15:04:21.755] IPC.js: Successfully encoded auth response. .

So you need to fire up the script (once the inital server is running), with the uri and PID as a flag. This will pass siccessfully trigger the IPC receipt in the main safe-drive script and you can progress from there :+1:

eg:

node ./safenetwork-fuse/bin --uri safe-c2...<that whole uri> --pid <the PID output from the server


#42

Hey, thank you @joshuef !!
@happybeing, doing the above allows the script to continue, with the following output in the console:


**safenetworkjs:web** SafenetworkApi.initialise() +7m

FUSE library version: 2.9.7

nullpath_ok: 0

nopath: 0

utime_omit_ok: 0

unique: 2, opcode: INIT (26), nodeid: 0, insize: 56, pid: 81832

INIT: 7.19

flags=0xf8000008

max_readahead=0x00100000

INIT: 7.19

flags=0x00000010

max_readahead=0x00100000

max_write=0x02000000

max_background=0

congestion_threshold=0

unique: 2, success, outsize: 40

unique: 2, opcode: STATFS (17), nodeid: 1, insize: 40, pid: 0

statfs /

**safe-fuse:vfs:index** Fuse.mount() at /Users/Home/SAFE +0ms

**safe-fuse:bin** Mounted SAFE filesystem on /Users/Home/SAFE +7m

**safe-fuse:ops** statfs('/') +0ms

**safe-fuse:vfs:index** getHandler(/) +3ms

**safe-fuse:vfs:root** getHandlerFor(/) - safePath: /, mountPath: / +0ms

**safe-fuse:vfs:root** RootHandler for / mounted at / statfs('/') +0ms

(node:81801) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'gt' of undefined

at safeVfs.getHandler.statfs.then (/Users/Home/safenetwork-fuse/src/fuse-operations/statfs.js:26:35)

at &lt;anonymous&gt;

at process._tickCallback (internal/process/next_tick.js:189:7)

(node:81801) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)

(node:81801) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

closer but not there yet by the look of it…

ls ~/SAFE

returns:

ls: SAFE: Device not configured

and so does:

ls ~/SAFE/_public


#43

OK, we’re virtually there! It’s tripping over statfs(). A lot has changed recently, so do you mind pulling those changes and trying again?

Just do git pull in each of safenetwork-fuse and safenetworkjs

Assuming you’ve not edited any files that will just work.

Thanks @joshuef, this is looking good :slight_smile:


#44

OK, much longer response this time, I’ll paste the first part:

**safenetworkjs:web** SafenetworkApi.initialise() +48s

**safe-fuse:vfs:index** SafeVfs.mountContainer({ safePath: '/' }) +0ms

FUSE library version: 2.9.7

nullpath_ok: 0

nopath: 0

utime_omit_ok: 0

unique: 2, opcode: INIT (26), nodeid: 0, insize: 56, pid: 82039

INIT: 7.19

flags=0xf8000008

max_readahead=0x00100000

**safe-fuse:stub** TODO: implement fuse operation: init() +0ms

INIT: 7.19

flags=0x00000010

max_readahead=0x00100000

max_write=0x02000000

max_background=0

congestion_threshold=0

unique: 2, success, outsize: 40

unique: 2, opcode: GETATTR (3), nodeid: 1, insize: 56, pid: 81

getattr /

**safe-fuse:vfs:index** Fuse.mount() at /Users/Home/SAFE +37ms

**safe-fuse:vfs:index** SafeVfs.mountContainer({ safePath: '_public' }) +0ms

**safe-fuse:vfs:index** SafeVfs.mountContainer({ safePath: '_publicNames' }) +0ms

**safe-fuse:vfs:root** RootHandler.initContainer({ safePath: '_public', safeUri: undefined }) failed to create SAFE container +0ms

**safe-fuse:vfs:root** RootHandler.initContainer({ safePath: '_publicNames', safeUri: undefined }) failed to create SAFE container +1ms

**safe-fuse:vfs:index** Error: mount rejected: failed to initialise container

**safe-fuse:vfs:index** at SafeVfs.mountContainer (/Users/Home/safenetwork-fuse/src/safe-vfs/index.js:473:15)

**safe-fuse:vfs:index** at &lt;anonymous&gt;

**safe-fuse:vfs:index** at process._tickCallback (internal/process/next_tick.js:189:7) +1ms

**safe-fuse:vfs:index** Error: mount rejected: failed to initialise container

**safe-fuse:vfs:index** at SafeVfs.mountContainer (/Users/Home/safenetwork-fuse/src/safe-vfs/index.js:473:15)

**safe-fuse:vfs:index** at &lt;anonymous&gt;

**safe-fuse:vfs:index** at process._tickCallback (internal/process/next_tick.js:189:7) +0ms

**safe-fuse:bin** Mounted SAFE filesystem on /Users/Home/SAFE +48s

**safe-fuse:ops** getattr('/') +0ms

**safe-fuse:vfs-cache** VfsCacheMap.getattr(/) +0ms

**safe-fuse:vfs:index** getHandler(/) +1ms

**safe-fuse:vfs:root** getHandlerFor(/) - containerRef: { safePath: '/', safeUri: undefined }, mountPath: / +1ms

**safe-fuse:vfs:root** RootContainer.itemAttributesResultRef('', undefined) +1ms

**safe-fuse:vfs:root** TypeError: Cannot read property 'defaultContainer' of undefined

**safe-fuse:vfs:root** at RootContainer.itemAttributesResultRef (/Users/Home/safenetwork-fuse/src/safe-vfs/root.js:476:51)

**safe-fuse:vfs:root** at VfsCacheMap.getattr (/Users/Home/safenetwork-fuse/src/safe-vfs/vfs-cache.js:246:38)

**safe-fuse:vfs:root** at &lt;anonymous&gt;

**safe-fuse:vfs:root** at process._tickCallback (internal/process/next_tick.js:189:7) +0ms

**safe-fuse:vfs-cache** TypeError: Cannot read property 'result' of undefined

**safe-fuse:vfs-cache** at VfsCacheMap.getattr (/Users/Home/safenetwork-fuse/src/safe-vfs/vfs-cache.js:249:67)

**safe-fuse:vfs-cache** at &lt;anonymous&gt;

**safe-fuse:vfs-cache** at process._tickCallback (internal/process/next_tick.js:189:7) +1ms

unique: 2, error: -2 (No such file or directory), outsize: 16

unique: 3, opcode: STATFS (17), nodeid: 1, insize: 40, pid: 0

statfs /

**safe-fuse:ops** statfs('/') +0ms

**safe-fuse:vfs:index** getHandler(/) +4ms

**safe-fuse:vfs:root** getHandlerFor(/) - containerRef: { safePath: '/', safeUri: undefined }, mountPath: / +3ms

**safe-fuse:vfs:root** RootHandler for { safePath: '/', safeUri: undefined } mounted at / statfs('/') +0ms

**safe-fuse:ops** { bsize: 1000000,

**safe-fuse:ops** frsize: 1000000,

**safe-fuse:ops** blocks: 1000000,

**safe-fuse:ops** bfree: 1000000,

**safe-fuse:ops** bavail: 1000000,

**safe-fuse:ops** files: 1000000,

**safe-fuse:ops** ffree: 1000000,

**safe-fuse:ops** favail: 1000000,

**safe-fuse:ops** fsid: 1000000,

**safe-fuse:ops** flag: 1000000,

**safe-fuse:ops** namemax: 1000000 } +0ms

but same message following ls:

ls: SAFE: Device not configured

sorry, I wish I could handle this myself without keep posting…:sweat_smile:


#45

No worries, you’ve helped a lot getting us to this point.

It’s not obvious what’s causing the issue here though. I will add to the debug output, but obviously that’s a slow process for each step.

If you feel up to it, I can help you get the debugger running, but if you’ve not done that before that will be a big hill to climb. The advantage would be that you could set breakpoints and step through the code to see exactly severe it fails more quickly.

Don’t feel obliged, this has been a great help and we can still make progress with you posting debug output, albeit slowly!


#46

@stout77 here are some instructions to get you going with the debugger. Don’t worry if they don’t make sense at any point, it helps me to realise what will need explaining better, so please ask if you can’t figure anything out.

To start you will need Chrome browser (or Chromium which I use), and then I suggest you try the instructions at https://github.com/theWebalyst/safenetwork-fuse#development

You don’t need to build because you can just run the source code. If you stick with the live network for now, you will already have the browser, and won’t need to go through the Maidsafe tutorial.

So skip the parts about the tutorial and building for mock.

Make sure you have done all the steps under Get the Source (particularly the npm link bits) and then see the following section on the debugger: https://github.com/theWebalyst/safenetwork-fuse#debugging-with-chromechromium

If you get the debugger going, F8 will start the program running, or you can step through line by line with F10 and F11. F10 steps through the displayed code line by line, and F11 is the same, except it will step into any function calls. Shift-F11 runs until you exit the current function. Those are the most useful commands, but you will need to learn how to set breakpoints (click on the left edge of a line once to set, again to unset). A blue mark on the left shows where a breakpoint is set.

It’s probably worth searching for a “chrome debugger tutorial” once you get to this stage.

But to start with, just hit F8 and see what happens! :slight_smile:

Good luck, and thanks again.