Problem with latest safe-authenticator-cli

OK that worked.
But I’m still getting the ‘bad file descriptor’ error with wget, as before.

1 Like

That’s weird now, so i guess curl or safe_cli doesn’t work either?, we can HO if you want, now or anytime, it should work now if it worked with rust-hello-world

Let me start from scratch, just to make sure I didn’t miss a step.

1 Like

Started from scratch (downloaded zip file from branch GitHub - bochaco/safe-authenticator-cli at fix-windows10, extracted, built with cargo run --features mock-network -- -i fdgfd --daemon 15000 ). Same result.

Ok, that’s confusing now, we’ll have to do a HO eventually (I’m free now), since we don’t have another to reproduce it so far

I’m off to bed now but could do HO tomorrow if you’re free. I’ll try another Windows machine before that though, as I have a lot of crap on this one that may be interfering in some way.

1 Like

Ok, I’ll ping you on a PM if I connect tomorrow

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 GitHub - maidsafe-archive/safe-authenticator-cli: This crate implements a CLI for the safe_authenticator crate. , or by providing them with the envs vars GitHub - maidsafe-archive/safe-authenticator-cli: This crate implements a CLI for the safe_authenticator crate. 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
https://github.com/maidsafe/safe-cli/pull/205

2 Likes