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

Return network error when logging in and the network connection fails #3432

Merged
merged 3 commits into from
Sep 20, 2024

Conversation

marktheunissen
Copy link
Contributor

Displays "unable to login due to network error" to the user when a network error is encountered.

  • Works with scenarios where the DNS does not resolve, or the port is closed or there is a timeout, etc.
  • We have InsecureSkipVerify set on the http.Client now, so certificate errors are no longer detected by our http client as errors.

@harshavardhana Up to you, I know MINIO_SERVER_URL is deprecated but it looks like people still use it and get into trouble with DNS.

Fixes: #3427

@harshavardhana
Copy link
Member

=== NAME  Test_PolicyListGroupsAPI
    policy_test.go:740: 
        	Error Trace:	/home/runner/work/console/console/integration/policy_test.go:740
        	Error:      	Not equal: 
        	            	expected: "[\"testgroup12345\"]\n"
        	            	actual  : "[\"testgroup12345\",\"testgroup12345\"]\n"
        	            	
        	            	Diff:
        	            	--- Expected
        	            	+++ Actual
        	            	@@ -1,2 +1,2 @@
        	            	-["testgroup12345"]
        	            	+["testgroup12345","testgroup12345"]
        	            	 
        	Test:       	Test_PolicyListGroupsAPI
=== RUN   Test_PolicyListGroupsAPI/List_Users_for_Policy_-_Invalid
--- FAIL: Test_PolicyListGroupsAPI (0.05s)

This looks like some duplicate groups are being listed @marktheunissen - needs a fix on the minio upstream side.

@marktheunissen marktheunissen force-pushed the neterrorlogin branch 2 times, most recently from ab4ea95 to 56f4c9e Compare September 5, 2024 03:01
@marktheunissen
Copy link
Contributor Author

@harshavardhana I've tracked this error down to a specific location, this integration test is adding groups and then when getting them back, the duplicates are being introduced.

The group name testgroup12345 is appended here: https://github.com/minio/minio/blob/master/cmd/iam-store.go#L995

And then the same group name testgroup12345 is appended again here: https://github.com/minio/minio/blob/master/cmd/iam-store.go#L1005

The function was modified and no longer does if store.getUsersSysType() == LDAPUsersSysType { so I wonder if that would be the issue?

I can keep working on it but I thought you might be able to find the issue faster than me since it's the first time I've looked at this.

@marktheunissen
Copy link
Contributor Author

Made a simpler test that is easy to work with and reached out to a few people here: https://github.com/minio/minio/pull/20388/files

api/errors.go Outdated Show resolved Hide resolved
ramondeklein
ramondeklein previously approved these changes Sep 17, 2024
Copy link
Collaborator

@bexsoft bexsoft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please review my comment

Copy link
Collaborator

@bexsoft bexsoft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@bexsoft bexsoft merged commit 19e6cc8 into minio:master Sep 20, 2024
28 of 33 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants