Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

401 Unauthorized on GGR #297

Open
upenbendre opened this issue Nov 20, 2019 · 12 comments
Open

401 Unauthorized on GGR #297

upenbendre opened this issue Nov 20, 2019 · 12 comments
Labels

Comments

@upenbendre
Copy link

I am facing the exact same issue as #176, but it could not be resolved using the same fix.
I get a 401 Unauthorized, when running the test:
"http://test:testpassword@<ip_address>:4444/wd/hub"
as you can see my password does not contain any special characters.

if I enter http://test:testpassword@10.222.26.74:4444/quota on the browser , it still prompts me for a username and password. If I enter the same credentials, it still gives me a '401 Unauthorized"

there are no messages in the ggr container log. All I have is:
2019/11/20 12:37:56 [-] [-] [INIT] [-] [-] [-] [-] [-] [-] [Users file is "/etc/grid-router/users.htpasswd"]
2019/11/20 12:37:56 [-] [-] [INIT] [-] [-] [-] [-] [-] [-] [Loading configuration files from "/etc/grid-router/quota"]

My quota file is /etc/grid-router/quota/test.xml

The UI URL at port 8080 correctly shows this ggr linked to all the selenoid hosts, and the total quota count.

I have also set up the user and password correctly using htpasswd

@vania-pooh
Copy link
Member

@upenbendre could you show the command used to create users.htpasswd file?

@jsa34
Copy link

jsa34 commented Jan 8, 2020

Hello,

Getting the same issues here.

If I send tests to an individual grid, it's fine.

Using GGR I get the following response in test suite:
org.openqa.selenium.WebDriverException:
Unable to parse remote response: 401 Unauthorized

Caused by: org.openqa.selenium.json.JsonException:
Expected to read a START_MAP but instead have: NUMBER. Last 0 characters read:
Build info: version: '4.0.0-alpha-3', revision: '8c567de6dc'
System info: host: 'xxx', ip: '10.0.32.174', os.name: 'Linux', os.arch: 'amd64', os.version: '3.10.0-1062.9.1.el7.x86_64', java.version: '1.8.0_232'
Driver info: driver.version: RemoteWebDriver

@jsa34
Copy link

jsa34 commented Jan 8, 2020

If it is any help, the issues appeared after the VM was updated, which included updating the docker API version from 1.39 to 1.40

@jsa34
Copy link

jsa34 commented Jan 8, 2020

Same logs for GGR node as reported in original post:
2020/01/08 18:12:44 [-] [-] [INIT] [-] [-] [-] [-] [-] [-] [Users file is "/etc/grid-router/users.htpasswd"]
2020/01/08 18:12:44 [-] [-] [INIT] [-] [-] [-] [-] [-] [-] [Loading configuration files from "/etc/grid-router/quota"]

@jsa34
Copy link

jsa34 commented Jan 8, 2020

Fixed.... just updated the username and password in the file and it seems happy again... not sure why it suddenly needed that, but hey ho, fixed!

@jsa34
Copy link

jsa34 commented Jan 21, 2020

Argh- the issue returned suddenly, and I tried resetting the password to no avail.

Sending tests to the individual grids works fine, and I even tried starting a manual session through GGR-UI, but this no longer works. I am at a loss as to what is happening because I can't see any errors logged anywhere...

@jsa34
Copy link

jsa34 commented Jan 21, 2020

I have even tried removing the GGR container, creating a new one and no luck.

I have tried deleting the .htpasswd file and recreating it, and then doing the above, but no luck

@vania-pooh
Copy link
Member

vania-pooh commented Jan 21, 2020

@jsa34 yes, we do not log 401 errors. Could your password file be corrupted by some external tools (like security or antivirus software)?

@jsa34
Copy link

jsa34 commented Jan 21, 2020

I can't see anything wrong with the password file itself, and the logs for ggr container suggest that it is picking up the correct file for username/pwd

@jsa34
Copy link

jsa34 commented Jan 21, 2020

I checked htpasswd -bv users.htpasswd test password, and the username/password is returned as valid

@jsa34
Copy link

jsa34 commented Jan 22, 2020

This fixed itself, it seems, again.

I tried deleting and removing the ggr container, and then pulled and started it again, and suddenly it started working. The only difference between this and this other 5 or 6 times I tried before was I added the guest quota (docker run -d --name ggr -v /etc/grid-router/:/etc/grid-router:ro --net host aerokube/ggr:latest-release -guests-allowed -guests-quota test), but I am unconvinced that this was the cause of the solution... Mystery until it, probably, happens again!

@jsa34
Copy link

jsa34 commented Feb 3, 2020

As an update:
It looks as though the -guests-allowed -guests-quota test flags are what is causing the tests to successfully be authorised (i.e. it is ignoring the username and password passed in the request). When I remove these, it continues to fail. When I try and create a manual container through selenoid-ui (via ggr-ui), upon clicking the desired browser, the button label turns red. Not sure what is happening, and tried everything I can think of RE: htpasswd file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants