SAFE Drive - help with testing


#42

God work @lukas. I don’t know about Windows specific stuff, but a couple of observations:

  • I have not been using the mock network, only live, because it didn’t work at all with mock (a while back) so suggests you stop using NODE_ENV at all, and make sure you are using a browser that is connecting to the live network (eg not a ‘-dev’ zip, or with the --live flags when using a Dev build of the browser)
  • if you use the DEBUG=safe-fuse*,safenetworkjs* settings (see safenetwork-fuse README) you will get useful debug to the terminal where you run node bin
  • you can also use the Chrome debugger at the same time, again see the README

How that helps, and @bzee may be able to see what is wrong for Windows.

Well done for figuring out the npm link issue. You have to redo it after any npm install inside safenetwork-fuse. That’s caught me out a few times. :slight_smile:


#43

I only got the drive letter to work with another fuse-bindings example (mafintosh/fuse-bindings#usage).

However, what got me a little further was when not using a drive letter but an absolute path, which is what is used in bin.js when not on Windows (path.join(Os.homedir(), 'SAFE')).


#44

I’m getting the same errors when running the process without the dev environment variable and on the live network.

I changed the mountPath variable to be (path.join(Os.homedir(), 'SAFE')), and when I do that while the command line is running I get a SAFE shortcut in my home directory.

image

I can’t enter it in explorer (which I wasn’t supposed to do anyway, but I had to try :stuck_out_tongue: ), I get an error message like this when I do:

[Window Title]
Location is not available

[Content]
C:\Users\Lukas\SAFE is not accessible.

Incorrect function.


[OK]

I can enter it on the command line, and when I write ls in the directory I get the following error:

PS C:\Users\Lukas> cd SAFE
PS C:\Users\Lukas\SAFE> ls
ls : Incorrect function.
At line:1 char:1
+ ls
+ ~~
    + CategoryInfo          : ReadError: (C:\Users\Lukas\SAFE:String) [Get-ChildItem], IOException
    + FullyQualifiedErrorId : DirIOError,Microsoft.PowerShell.Commands.GetChildItemCommand

I ran it with DEBUG=safe-fuse*,safenetworkjs* to get some more output:

PS E:\Project\program\javascript\safenetwork-fuse> $env:DEBUG = "safe-fuse*,safenetworkjs*"
PS E:\Project\program\javascript\safenetwork-fuse> node bin
  safenetworkjs:web SafenetworkApi() +0ms
  safenetworkjs:web SafenetworkApi.initialise() +0ms
  safe-fuse:bin try bootstrap()... +0ms
  safenetworkjs:cli __dirname: E:\Project\program\javascript\safenetworkjs\src +46ms
  safenetworkjs:cli
  safenetworkjs:cli Safe.bootstrap()
  safenetworkjs:cli   with appInfo: {"id":"safenetwork-fuse","name":"SAFE Network FUSE","vendor":"theWebalyst"}  argv: {"_":[],"version":false,"help":false,"$0":"bin"} +0ms
  safenetworkjs:cli getLibPath() returning:  E:\Project\program\javascript\safenetwork-fuse\node_modules\@maidsafe\safe-node-app\src\native +0ms
  safenetworkjs:cli call Safe.initializeApp()... +0ms
  safenetworkjs:cli call app.auth.genAuthUri()... +16ms
  safenetworkjs:cli bootstrap.authorise() with appInfo: {"id":"safenetwork-fuse","name":"SAFE Network FUSE","vendor":"theWebalyst","customExecPath":["D:\\Program\\nodejs\\node.exe","E:\\Project\\program\\javascript\\safenetwork-fuse\\bin","--pid","4760","--uri"]}appContainers: {"_public":["Read","Insert","Update","Delete"],"_publicNames":["Read","Insert","Update","Delete"]} +0ms
  safenetworkjs:cli wait a mo +62ms
  safenetworkjs:cli ipcReceive(4760) +0ms
  safenetworkjs:cli ipcReceive(4760) +0ms
Server path not specified, so defaulting to ipc.config.socketRoot + ipc.config.appspace + ipc.config.id /tmp/app.4760
starting server on  /tmp/app.4760
starting TLS server false
starting server as Unix || Windows Socket

This instance should quit. Ciao!
## socket connection to server detected ##
received event of :  auth-uri { id: '4760-cli',
  message: 'safe-c2fmzw5ldhdvcmstznvzzq:AQAAAG1lR60AAAAAAAAAACAAAAAAAAAAKPmSmuywj7Mm6MAvdSTGNDszE1Eimrzef63D7nMPz0QgAAAAAAAAAPO8m4zti7Th1Q7_8t-fV9hzBvj15ZZnH-ZdPyG4ymJxIAAAAAAAAADy3r0eJ3ugqNYfJzz88Uhp9HjyHSCSCWfbwD_54J3EzkAAAAAAAAAAzXLNAQsg6ypHQiKMuCKhD0QB5yKgqlwMTv6P-3gUVd_y3r0eJ3ugqNYfJzz88Uhp9HjyHSCSCWfbwD_54J3EziAAAAAAAAAAYd4RrzHkZpkAOfweA8WwHOLD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AAAAAAAAAAAAAQAAAAIAAAADAAAA +3s
socket disconnected 4760-cli
  safenetworkjs:web SafenetworkApi.initialise() +3s
  safe-fuse:vfs:index Fuse.mount() at C:\Users\Lukas\SAFE +0ms
Dokan: debug mode on
Dokan: use stderr
AllocationUnitSize:   safe-fuse:bin Mounted SAFE filesystem on C:\Users\Lukas\SAFE +6s
512 SectorSize: 512
device opened
CreateMountPoint C:\Users\Lukas\SAFE -> \??\Volume{d6cc17c5-173c-4085-bce7-964f1e9f5de9}\ success
mounted: C:\Users\Lukas\SAFE -> \Volume{d6cc17c5-173c-4085-bce7-964f1e9f5de9}
Mounted
###Create 0000
CreateFile: \
        DesiredAccess: SYNCHRONIZE|FILE_READ_ATTRIBUTES
        ShareAccess: FILE_SHARE_WRITE|FILE_SHARE_READ
        Disposition: FILE_OPEN (1)
        Attributes: 0 (0x0)
        Options: 17 (0x11)
  safe-fuse:ops getattr('/') +0ms
  safe-fuse:vfs:index getHandler(/) +1s
  safe-fuse:vfs:root getHandlerFor(/) - safePath: /, mountPath: \/ +0ms
  safe-fuse:vfs:root RootHandler for / mounted at \/ getattr('/') +0ms
  safe-fuse:ops getContainer() - no container object ready for / +0ms
CreateFile status = c0000002
###QueryVolumeInfo -001
GetVolumeInformation
###Create 0001
CreateFile: \
        DesiredAccess: SYNCHRONIZE
        ShareAccess: 0x0
        Disposition: FILE_OPEN (1)
        Attributes: 0 (0x0)
        Options: 8388641 (0x800021)
  safe-fuse:ops getattr('/') +15ms
  safe-fuse:vfs:index getHandler(/) +15ms
  safe-fuse:vfs:root getHandlerFor(/) - safePath: /, mountPath: \/ +15ms
  safe-fuse:vfs:root RootHandler for / mounted at \/ getattr('/') +0ms
  safe-fuse:ops getContainer() - no container object ready for / +0ms
CreateFile status = c0000002
###Create 0002
CreateFile: \desktop.ini
        DesiredAccess: FILE_GENERIC_READ
        ShareAccess: FILE_SHARE_DELETE|FILE_SHARE_WRITE|FILE_SHARE_READ
        Disposition: FILE_OPEN (1)
        Attributes: 0 (0x0)
        Options: 100 (0x64)
  safe-fuse:ops getattr('/desktop.ini') +16ms
  safe-fuse:vfs:index getHandler(/desktop.ini) +16ms
  safe-fuse:vfs:index getHandler(/) +0ms
  safe-fuse:vfs:root getHandlerFor(/) - safePath: /, mountPath: \/ +22ms
  safe-fuse:vfs:root getHandlerFor(/desktop.ini) - safePath: /, mountPath: \/ +0ms
  safe-fuse:vfs:root RootHandler for / mounted at \/ getattr('/desktop.ini') +0ms
  safe-fuse:ops getContainer() - no container object ready for /desktop.ini +7ms
CreateFile status = c0000034
###Create 0003
CreateFile: \
        DesiredAccess: SYNCHRONIZE|FILE_READ_ATTRIBUTES
        ShareAccess: FILE_SHARE_WRITE|FILE_SHARE_READ
        Disposition: FILE_OPEN (1)
        Attributes: 0 (0x0)
        Options: 17 (0x11)
  safe-fuse:ops getattr('/') +7ms
  safe-fuse:vfs:index getHandler(/) +15ms
  safe-fuse:vfs:root getHandlerFor(/) - safePath: /, mountPath: \/ +10ms
  safe-fuse:vfs:root RootHandler for / mounted at \/ getattr('/') +0ms
  safe-fuse:ops getContainer() - no container object ready for / +3ms
CreateFile status = c0000002
###Create 0004
CreateFile: \.sync\ID
        DesiredAccess: FILE_READ_ATTRIBUTES
        ShareAccess: FILE_SHARE_DELETE|FILE_SHARE_WRITE|FILE_SHARE_READ
        Disposition: FILE_OPEN (1)
        Attributes: 0 (0x0)
        Options: 2097152 (0x200000)
  safe-fuse:ops getattr('/.sync/ID') +38ms
  safe-fuse:vfs:index getHandler(/.sync/ID) +41ms
  safe-fuse:vfs:index getHandler(/.sync) +0ms
  safe-fuse:vfs:index getHandler(/) +1ms
  safe-fuse:vfs:root getHandlerFor(/) - safePath: /, mountPath: \/ +41ms
  safe-fuse:vfs:root getHandlerFor(/.sync) - safePath: /, mountPath: \/ +1ms
  safe-fuse:vfs:root getHandlerFor(/.sync/ID) - safePath: /, mountPath: \/ +0ms
  safe-fuse:vfs:root RootHandler for / mounted at \/ getattr('/.sync/ID') +0ms
  safe-fuse:ops getContainer() - no container object ready for /.sync/ID +4ms
CreateFile status = c0000034
###Create 0005
CreateFile: \.sync\ID
        DesiredAccess: FILE_READ_ATTRIBUTES
        ShareAccess: FILE_SHARE_DELETE|FILE_SHARE_WRITE|FILE_SHARE_READ
        Disposition: FILE_OPEN (1)
        Attributes: 0 (0x0)
        Options: 2097152 (0x200000)
  safe-fuse:ops getattr('/.sync/ID') +52ms
  safe-fuse:vfs:index getHandler(/.sync/ID) +55ms
  safe-fuse:vfs:index getHandler(/.sync) +0ms
  safe-fuse:vfs:index getHandler(/) +1ms
  safe-fuse:vfs:root getHandlerFor(/) - safePath: /, mountPath: \/ +55ms
  safe-fuse:vfs:root getHandlerFor(/.sync) - safePath: /, mountPath: \/ +1ms
  safe-fuse:vfs:root getHandlerFor(/.sync/ID) - safePath: /, mountPath: \/ +0ms
  safe-fuse:vfs:root RootHandler for / mounted at \/ getattr('/.sync/ID') +0ms
  safe-fuse:ops getContainer() - no container object ready for /.sync/ID +4ms
CreateFile status = c0000034
###Create 0006
CreateFile: \
        DesiredAccess: SYNCHRONIZE|FILE_READ_DATA
        ShareAccess: FILE_SHARE_DELETE|FILE_SHARE_WRITE|FILE_SHARE_READ
        Disposition: FILE_OPEN (1)
        Attributes: 0 (0x0)
        Options: 33 (0x21)
  safe-fuse:ops getattr('/') +6s
  safe-fuse:vfs:index getHandler(/) +6s
  safe-fuse:vfs:root getHandlerFor(/) - safePath: /, mountPath: \/ +6s
  safe-fuse:vfs:root RootHandler for / mounted at \/ getattr('/') +0ms
  safe-fuse:ops getContainer() - no container object ready for / +0ms
CreateFile status = c0000002

###Create 0006 and below came up when I wrote ls in the directory, which generates the error message shown earlier in that terminal.

It looks to me like it might be working at some level, maybe it just needs some folders to list? How can I make sure I have some data on the network that would be able to show up when I do an ls in the SAFE mount point?


#45

It certainly is working at some level. This is looking good. If you look in bin.js you’ll see that from the following message it appears to have successfully mounted:

 safe-fuse:bin Mounted SAFE filesystem on C:\Users\Lukas\SAFE +6s

The subsequent messages starting with safe-fuse: are from the safenetwork-fuse code. Apart from the messages about authorisation near the start, I don’t see any from safentworkjs yet, but that’s to be expected as you would need to try accessing a path that required access to SAFE API for that.

The rest of the messages are from fuse-bindings itself so I don’t have details of what they all mean but one can usually make some sense of them.

What you should see if you ls [or rather dir on Windows as @drehb just reminded me!] your SAFE folder are two sub-folders: _public and _publicNames. Since you don’t that’s the first thing to look into.

If you can get the debugger working (see README) you could start things up, and let those messages settle down.

Then set a breakpoint in say safenetwork-fuse/fuse-operations/gettattr.js and see why, after the message safe-fuse:ops getattr('/') it doesn’t find a suitable ‘container object ready for /

It is almost certainly because I haven’t got the right path separator so it is failing to find a mount handler or suitable container. The path ‘/’ (or perhaps ‘\’) should be handled by the RootHandler and RootContainer (which are in safenetwork-fuse) and are what cause _public and _publicNames to appear at that path.

Good stuff. Have a poke around and you may well be able to fix this!

You don’t need to do this yet, but once you have dir showing _public and _publicNames use the Maidsafe Web Hosting Manager to create a public name and upload some files (or use the create website from template feature). Details on the main forum somewhere. You should see the results of that when you list the contents of _public and _publicNames


#46

@lukas I think you just need to use ‘dir’ instead of ‘ls’ since you’re using Windows.


#47

P. S.

Rather than:

C:\Users\Lukas\SAFE> dir

I recommend not changing directory to you SAFE Drive. Instead try:

C:\Users\Lukas> dir C:\Users\Lukas\SAFE

I’ve written some code now that should get over that issue (fingers crossed). But it is complex, and I’ve not tried running any of it yet - so don’t hold your breath :wink:


#48

@happybeing I’ll read your responses more closely and try it out tomorrow Friday! :slight_smile:

@drehb PowerShell has ls, probably just an alias for dir, but I’m used to ls.


#49

Ah, didn’t realize that. Microsoft is much more Linux friendly these days indeed :slight_smile:


#50

I got breakpoints working.

Running latest master.

I can’t get it to work though.

And I can’t figure out what’s wrong in the code.

Think I’ve run out of steam on this.

I found that this is where the error message comes from, line 150 in root.js:

    // This handler's container is not mounted yet so attempt to mount it
    if (this._mountPath !== '/') {
      // This RootHandler is for a SAFE root container
      if (this._lazyInitialise) {
        // Make it on demand (lazy)
        return this.initContainer(rootContainerName)
      } else {
        // Either itemPath should not be handled here (so a bug elsewhere)
        // or perhaps the constructor has not finished creating containers
        throw new Error('getContainer() - no container object ready for ' + itemPath)

this._mountPath is "\/"
and this._lazyInitialise is false, making it throw that error.


#51

Excellent, well done. The error you found looks like the kind of thing I was expecting to have messed up, so very useful.

Can you see why the mountPath is “\/” and not “/”?

The code you show is in the RootHandler, which appears not to have this._container set, which should happen here:

That mirrors what you are seeing late in getContainer() so the issue might be that for some reason the RootHandler is being created with mountPath “\/” instead of “/”. This sounds very like a Windows v Linux thing so I reckon you are onto something if you can see where the RootHandler’s this._mountPath and change the code responsible to set it to “/” instead of “\/”. Probably here:

If you fancy having another go, try setting a breakpoint there and watch the creation of the RootHandler’s container, a RootContainer object. Keep an eye on why this._mountPath doesn’t end up as “/”.

Hopefully I’m pointing in the right direction! A bit tricky debugging like this :slight_smile: but I’m sure you are on the right track.

Update:

@lukas I’ve been looking around in safenetwork-fuse/src/safe-vfs/root.js and I have a hunch that you should try replacing every occurrence of path.sep with '/'. I don’t think it should be using path.sep at all.


#52

Status Update

I’ve been testing the ability to create directories and copy files to your SAFE storage mounted as a SAFE Drive and so far it is going well!

  • using mock network, copied a 129M .git directory tree to a SAFE network directory, then did a file by file comparison with no differences

  • then did a commit on the original, repeated the compare, and those changes showed up

Anyone can try this if you pull the development branch.

Note, this works with live or mock networks, but if you want to use mock, you can set an additional environment variable to cause it to create a folder for testing: _public/tests/data1/. This saves you having to create one with WHM. To enable that, use SAFENETWORKJS_TESTS=testing along with NODE_ENV=dev (and a Dev build of SAFE Browser).


#53

@lukas I’ve been looking around in safenetwork-fuse/src/safe-vfs/root.js and I have a hunch that you should try replacing every occurrence of path.sep with '/'. I don’t think it should be using path.sep at all.


#54

UPDATE: new features available to test

I’ve just pushed some working [ahem] new features to the development branch, so if anyone would like to test them by running from node (ie not the packaged version) by all means give it a try.

You should git pull && git checkout development branch and use the instructions from the README to run under node. I’ll be working on a packaged version for release next week, but it would be good to get some more testing to run these new things through their paces.

New (buggy) features:

  • Speed. Things are now much faster, and you can use the file manager to browse your SAFE files without it appearing to hang.

  • Create and Update Files.

    • You can create/update files into an existing folder (created using Web Hosting Manager) from the command line and piping into a file (e.g. echo Hello world > ~/SAFE/_public/mydomain/www-root/index.html).
    • Copy file, make directory, recursive copy should also work so you should be able to copy websites too and from your SAFE Drive.
    • Create a file and/or update its modification time using (Linux) touch
    • You can also create/update files from some apps, but many don’t work properly yet (e.g. failing to save changes). I think vim works, but maybe doesn’t clean up temp files.
  • File Sharing via SAFE Web Mounts. Since all websites are public files, you can share files by saving them on a website domain, and others can access the files of any website from their SAFE drive by mounting its folder.
    For example, to mount the websites at safe://heaven and safe://cat.ashi:

    ls ~/SAFE/_webMounts/heaven
    ls ~/SAFE/_webMounts/cat.ashi
    ls ~/SAFE/_webMounts
    tree ~/SAFE/_webMounts
    # etc
    

    No cats were harmed in the making of this feature

    This feature also illustrates automount (see next bullet).

  • Automount Default Containers. Only _public and _publicNames are supported by SAFE Network just now, but later you will have _documents, _videos and so on. If these are not already mounted, you can force them to mount just by accessing them. You can test this by commenting out the default mount for _publicNames in bin.js and then trying:

    ls ~/SAFE # shows _publicNames is not yet mounted
    ls ~/SAFE/_publicNames # mounts and lists directory
    ls ~/SAFE # show _publicNames is now mounted
    

If you do any testing please reply to this post to let me know, and if you find any issues please file them on github, mentioning the development branch.

See the OP for help if you are not sure where to start

Things I haven’t tested but if they are feasible for you to have a go:

  • Decentralised Git. Create a ‘headless’ (possibly the wrong term) git repository on your SAFE drive, set it as remote for your local git repo, and push changes to it, have others clone it and pull changes etc
  • Backup/Sync. Would be great if somebody would try using rsync to keep a public share of files updated, and to show that it can be used for backup. Also other apps than rsync but that’s one I know is awesome and will prioritise.

@lukas I made the changes I think might help get this to work on Windows so if you are still available, feel free to give it a go.


#55

Will try now! Just to preempt the inevitable, does it need a particular version of node?


#56

Well reasonably up to date I guess, but should be no different to the other things like SAFE Browser. I’m not at my PC now so can’t check what I’m using. Sorry!

Thanks for checking it out again.


#57

Can you spell this out pls?

You should git pull && git checkout development branch

I downloaded the zip from the dev branch but ran into permissions issues with linking. I presume that’s a different problem but just checking.

Also the readme talks about SAFE Browser

NODE_ENV=dev safe-browser

I take it Peruse will also work (although that command failed when replacing safe-browser with peruse) ?


#58

@JPL If you download from the development branch, you are good, otherwise you should go into the directory and issue:

git pull
git checkout development

And you may also need:

git checkout . 

Normally, starting from scratch, I would do this:

git clone https://github.com/theWebalyst/safenetwork-fuse 
cd safenetwork-fuse 
git checkout development
git checkout . 

And then the same for safenetworkjs

The linking issue looks like your system, so not sure about that.

Any recent SAFE/Peruse browser should do, with the proviso…

…be careful with NODE_ENV=dev. That is only to be used when you want to use the mock network, so requires a mock browser setup.

Unless you want to try saving quite a bit of data I suggest people use the live network, then you will be able to access other people’s website files too.

If anyone wants to try the git or rsync tests, I suggest starting with mock to see if there are obvious problems, and then switching to live.

Thanks a lot f your trying this out John! :slight_smile:


#59

No probs it’s fun! Apart from this which I’m getting consistently in Debian and Fedora when issuing npm link from safenetworkjs folder:

user@user1:~/safe-fuse-test/safenetworkjs$ npm link
npm ERR! path /usr/lib/node_modules/safenetworkjs
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall unlink
npm ERR! Error: EACCES: permission denied, unlink '/usr/lib/node_modules/safenetworkjs'
npm ERR!  { Error: EACCES: permission denied, unlink '/usr/lib/node_modules/safenetworkjs'
npm ERR!   stack: 'Error: EACCES: permission denied, unlink \'/usr/lib/node_modules/safenetworkjs\'',
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   syscall: 'unlink',
npm ERR!   path: '/usr/lib/node_modules/safenetworkjs' }
npm ERR! 
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR! 
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator (though this is not recommended).

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/user/.npm/_logs/2018-10-27T16_34_11_808Z-debug.log

Using sudo works although I then run into (possibly related) issues running npm run build-mock from the safenetwork-fuse folder.


> safenetwork-fuse@0.1.0 build-mock /home/user/safe-fuse-test/safenetwork-fuse
> mkdir -p ./dist/mock/node_modules/@maidsafe/safe-node-app/src/native/mock/ && cp -R node_modules/@maidsafe/safe-node-app/src/native/mock/*.* ./dist/mock/node_modules/@maidsafe/safe-node-app/src/native/mock/ && pkg . -t host -o ./dist/mock/mount-safe

cp: cannot stat 'node_modules/@maidsafe/safe-node-app/src/native/mock/*.*': No such file or directory
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! safenetwork-fuse@0.1.0 build-mock: `mkdir -p ./dist/mock/node_modules/@maidsafe/safe-node-app/src/native/mock/ && cp -R node_modules/@maidsafe/safe-node-app/src/native/mock/*.* ./dist/mock/node_modules/@maidsafe/safe-node-app/src/native/mock/ && pkg . -t host -o ./dist/mock/mount-safe`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the safenetwork-fuse@0.1.0 build-mock script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/user/.npm/_logs/2018-10-27T16_45_49_947Z-debug.log

#60

Firstly, you don’t need to build anything to try this, so skip that unless you want to try testing the build too.

You can instead just run using node bin.js in the safenetwork-fuse directory.

If you do want to build-mock, then it looks like you may have done the npm install step without NODE_ENV=dev because it isn’t finding the Maidsafe mock libraries. I think they plan to install them regardless, may do already in fact, but I’m still using the old versions for now.

PS I’m on Ubuntu now, but don’t recall having permissions problems with Debian, so not sure why you do there. A Web search should help you get those set correctly though, and would be preferable to using sudo


#61

Ah OK I’ll try again. Just checked and I did set NODE_ENV=dev so it’s not that. I probably missed some step but I had the same issues with Fedora too.