Problem with latest safe-authenticator-cli

Spot on
willie@sputnik:~/projects/maidsafe/bochaco/safe-authenticator-cli$ cargo run --features mock-network – -i fdgfd --daemon 15001
Finished dev [unoptimized + debuginfo] target(s) in 0.23s
Running target/debug/safe_auth -i fdgfd --daemon 15001
Secret:
Password:
Exposing service on 127.0.0.1:15001

thank you :slight_smile:

1 Like

It (fix-Win10 branch) also fails on my other Win 10 machine
$ curl localhost:15000 % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 0 0 0 0 0 0 0 0 --:--:-- 0:00:01 --:--:-- 0curl: (7) Failed to connect to localhost port 15000: Connection refused

I’ve also just tried some things:

  • Is only mock supported for now for ‘safe-authenticator-cli’? On my Linux Mint 19.1 with Rust 1.36.0 I get the following error when doing ‘cargo build’:
error[E0432]: unresolved import `routing::Client`
  --> /home/draw/.cargo/git/checkouts/safe_client_libs-78dcb58b240b6e71/1c9e5f3/safe_core/src/client/core_client.rs:12:5
   |
12 | use routing::Client as Routing;
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^ no `Client` in the root
...
  • The ‘cargo build --features mock-network’ works (did test that already a while back).
  • A detail: with an interactive login, you have to first type in the secret, but in the example my.config.json on the README.md I see first the password. Or is it to illustrate that the order of arguments in the json config file doesn’t matter :wink:
  • after ’cargo run --features mock-network -- --daemon 41805 safe auth’ works, but

$ safe keys create --test-coins --preload 32.45
[2019-08-10T15:41:05Z ERROR safe] safe_cli error: ‘–test-coins’ flag is not supported since it’s only available for “mock-network” feature

-> What am I doing wrong here?

  • other commands like ‘safe files’ do work for me :slight_smile:
  • In the output of the ‘safe help cat’-cmd the following typo: …serlialisation…
  • I was expecting that safe cat worked like ls when given a ‘subdir’ as <location>, but that is of course not like that. For example ‘safe cat safe://mywebsite/contact/’ gives an ‘No data found…’-error, although safe://mywebsite/contact/form.html exists. Although that can be solved by introducing ‘safe ls’ (that does the necessary filtering, depending on the subdir).
1 Like

Correct, non-mock-network will be supported soon whenever we finish the integration with new upcoming version of SCL

Test-coins works only when you run safe_cli with --features mock-network so before you run your command $ safe keys create --test-coins --preload 32.45 make sure you are using a binary built with mock-network feature.

Thanks! I’ll fix the typo in next PR. I think what you suggest are very valid suggestions, although I just tried cat on a local folder in my linux and it doesn’t work like that but just says: cat: tests/: Is a directory

3 Likes

The GNU cat commando in Linux indeed doesn’t work for directories.
The confusion is that the main safe site also seems to be a directory for people not familiar with the Safe RDF concepts (Edit: I mean FilesContainer probably). So in that regard it is not consequent -> or
safe cat safe://mywebsite’ and
safe cat safe://mywebsite/subdir
both work or both don’t work.

1 Like

True, totally agree, so yes perhaps as you say we need to have cat to list folders, or not do it for root location. Thanks a lot @draw I’ll bring this for discussions with other folks and also try to see where it fits in with priorities/plans to adjust it.

2 Likes

Not a high priority I think: can be added later, maybe by others. But ‘ls’-functionality (also for subdirectories), be it in the ‘safe cat’ or in a seperate 'safe ls'-commando makes for example auto complete functionality easier when scrolling through a ‘safe://…’-site without the need to downloading the site completely.
And what to do if you want to download a complete Safe site. For now ‘safe cat > .../correct/file’ for each file? And implementation of ‘safe get --recursive ...’ or ‘safe sync --recursive ...’ in the other direction maybe for later?

Ps: the 'safe keys create --test-coins --preload 32.45’ works now. Thank you for the instructions!

2 Likes

For downloading I think we can have files sync to support it, IIRC the normal sync command allows remote locations as the source, so it seems the way to go, and simplest for us I’d believe.

2 Likes

Just for anyone reading this thread, with @JPL we found the root cause of the issue he was having on Windows 10, and the problem is actually the lib we currently use in safe_auth CLI to prompt the user to enter secret/password doesn’t work well in MinGW (which is what JPL was using). Thus, if using other shell like windows cmd, it works just fine.

Another alternative until this is fixed, if using MinGW but providing the secret/password using a config file https://github.com/maidsafe/safe-authenticator-cli#using-a-config-file , or by providing them with the envs vars https://github.com/maidsafe/safe-authenticator-cli#using-environment-variables it also works fine.
Thanks so much @JPL for all your help in troubleshooting this, I’ll raise an issue tomorrow so we can eventually fix it.

6 Likes

It’s almost worth all the frustration when you find the answer, isn’t it? Almost.

6 Likes

Can the CLI be tweaked so it’s authenticated using the safe browser (mock) bundle rather than safe-authenticator-cli or alternatively can the browser read the local files created using safe-cli? Would be nice to be able to view my ‘hello world’ website.

1 Like

Not as yet. The underlying SCL implementation is verrry different. We’ll be moving into POC w/ browser though once we’ve got auth/cli stabilised atop the new libs.

I for one cannot wait to be able to safe files sync ./ safe://mysite and that be deployed. :boom: As soon as feasible we’ll be getting it in :slight_smile:

6 Likes

Hey @draw, I started looking into this, it seems I should be able to finalise it in the next few days :wink: , just some refactoring to be done

2 Likes

Nice!
To be complete: where it will remain different from the ‘ls’ command (not that it is a problem), if I am correct, is that resembles more ‘ls --recursive …’: it also shows the contents of the ‘subdirectories’.

1 Like

Yeah, true, I’m also a bit concerned if this will be ok whenever we swtich to proper RDF, as you see I’m looking at supporting it not only from the cat/CLI but from the fetch API itself, but we’ll see

1 Like

OK more problems with Windows. I’m using the binaries of safe-auth and the cli. I’m unable to PUT files on the mock network. 'Failed to PUT Sequenced Append-only data' It works fine with Linux.

In this image I am first trying to upload a folder, and then a small png file.

1 Like

I’ll give it a try tomorrow on Windows @JPL

1 Like

This seems to be a PowerShell issue - it works with cmd (Windows is annoying :angry:)

3 Likes

Ok, in this case it seems even more confusing as the error you were having is coming from the lower client libs rather than the shell/CLI, it said it was about permissions/accessDenied

1 Like

I’m not reproducing exactly that @JPL but I’m seeing some weird behaviour which I don’t fully understand yet, I’ll need to add debug info to dig deeper.

2 Likes