Problem with latest safe-authenticator-cli

Yes, it still fails unfortunately.

Edit. I don’t have wget installed but ping and curl both fail.

 $ ping localhost:15000
    Ping request could not find host localhost:15000. Please check the name and try again.


 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

Edit 2: installed wget:

$ wget localhost:15000
--2019-08-09 16:30:49--  http://localhost:15000/
Resolving localhost (localhost)... ::1, 127.0.0.1
Connecting to localhost (localhost)|::1|:15000... failed: Bad file descriptor.
Connecting to localhost (localhost)|127.0.0.1|:15000... failed: Bad file descriptor.
1 Like

right, so it seems it has to do with some firewall or something blocking http reqs to localhost/127.0.0.1, perhaps you can try to disable any firewall you may have for localhost ?

1 Like

Just to be annoying, these commands above work fine here on Ubuntu with the latest updates this afternoon.
I’m leaning towards a firewall problem myself…

1 Like

I can’t see anything obvious blocking it and I have whitelisted safe.exe and the authenticator. Also if I run create-react-app on localhost:3000 wget reaches it fine…

Edit: turned the firewall off - same thing.

It could just be this machine. If you remember I was having problems with WHM hanging and WebIDs (we tried to resolve them over Hangout) which are fine on another Win 10 machine.

1 Like

Yes, that is quite annoying …

1 Like

sorry to be annoying, but I only have a few Core Skills and Annoying is one of them…

1 Like

Yeah I imagined it was that PC again :slight_smile: , I just searched quickly and there are a few people there with similar issues on Windows10. So if you run safe_auth on port 3000 does it work?

Also, wondering if using 127.0.0.1 makes any difference for you, would it if you do wget 127.0.0.1:15000 ? if so then changing this line to use 127.0.0.1 should fix it: https://github.com/maidsafe/safe-cli/blob/master/src/api/auth.rs#L19. From what you mentioned about wget-ing port 3000 it was with localhost so I assume it won’t make any diff, but just double checking

1 Like

Hi @bochaco

Nope.

Also nope. Same error.

Incidentally, should I be able to see anything if I browse to localhost:15000? Currenly I’m getting ‘unable to connect’

Another thing. I have this working (I think) on Ubuntu now, but
cargo run --features mock-network -- -i sdfsd --daemon 15000 is now asking me for a secret and password, which didn’t happen on Windows.

What secret and password do I use by the way?

That’s because of the --invite/-i arg, the safe_auth assumes you wanna create a new account, so you should enter any new secret/pwd you like for that new account. If you omit that arg, it assumes you wanna log in using an existing account and you’ll need to enter the secret/pwd for an existing account.

I’m duck-ing (duck-duck-go-ing :stuck_out_tongue: ) to see if I find some other solution or potential root cause for this, I honestly have no clue. I’m also starting to suspect if the server we use in safe_auth is somehow different from others as you say a react_app server works on port 3000 but safe_auth desn’t

It seems you won’t be able to connect with any client, neither wget, safe_cli or a browser…so…

Let me know if you can think of any others I could try for test purposes.
I’l spark up another Windows machine later see if it has the same issues.

Yes, I figured that was probably the case.

I just created this “hello world!” which listens on port 15000, can you give it a shot by running this and see if you can connect to it with curl or any of the clients on port 15000?

git clone https://github.com/bochaco/rust-hello-world.git
cd rust-hello-world
cargo run

Yes that one works. Hello World in the browser and wget fetches the index.

3 Likes

Nice! ok, give me a sec…

Well…It’ll be a few minutes :slight_smile: I think the problem is the actix-web package we use, the latest version seems to work on windows for you, so presumably they fixed some issue, I’m trying to get a branch and PR for safe_auth to upgrade it and we can give it a try @JPL

2 Likes

Ok, @JPL, whenever you have the chance, can you please give it a try to run my fix-windows10 branch of safe_auth? GitHub - bochaco/safe-authenticator-cli at fix-windows10

You should be able to choose the port as before, I’m just trying to upgrade actix-web which seems to be the issue, we’ll see…

Ah that one wouldn’t build. First error:

   Fresh actix-web v1.0.5
error[E0432]: unresolved import `routing::Client`
  --> C:\Users\John\.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

I think you forgot to set the mock-network feature, make sure you run it with:

cargo run --features mock-network -- -i fdgfd --daemon 15000

For what its worth - this is what I get

willie@sputnik:~/projects/maidsafe/bochaco/safe-authenticator-cli$ cargo build --features mock-network
   Compiling safe_authenticator v0.9.1 (https://github.com/bochaco/safe_client_libs?branch=temp-experimental#b40de6d0)
   Compiling safe_core v0.32.1 (https://github.com/bochaco/safe_client_libs?branch=temp-experimental#b40de6d0)
   Compiling safe_auth v0.0.1 (/home/willie/projects/maidsafe/bochaco/safe-authenticator-cli)
    Finished dev [unoptimized + debuginfo] target(s) in 32.93s
willie@sputnik:~/projects/maidsafe/bochaco/safe-authenticator-cli$ cargo run --features mock-network -- -i fdgfd --daemon 15000
    Finished dev [unoptimized + debuginfo] target(s) in 0.23s
     Running `target/debug/safe_auth -i fdgfd --daemon 15000`
Secret: 
Password: 
Exposing service on 127.0.0.1:15000
thread 'main' panicked at '

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!   unwrap! called on Result::Err                                              !
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
src/authd.rs:37,18 in safe_auth::authd

Err(Os { code: 98, kind: AddrInUse, message: "Address already in use" })

', /home/willie/.cargo/registry/src/github.com-1ecc6299db9ec823/unwrap-1.2.1/src/lib.rs:67:25
note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.

Yes I know its Linux and @JPL problem is with windows. Just if it helps…
And if you want me to butt out, just say so :slight_smile:

I’m keen to see this work cos I need to set up a Win10 VM for another project ( helping a mate with a dissertation on hardware wallets) and it would be good to be able to get some Windows experience with SAFE as well.

1 Like

Oh no. Someone who’s beset by exclamation marks is much less annoying than someone whose build just sails through without a passing remark.

1 Like

@southside the error you are seeing is because port 15000 is already used in your PC, perhaps you have the other safe_auth in another console running? in any case try with a different port and should be ok.

@JPL let me know if you try with the mock-network feature since the build error you saw is just that for sure

1 Like