chef / chef/chef-server

LDAP 504 failed to connect

Open
#812 16 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Aspect: Testing Component: ldap Status: Consider for next release Triage: Try Reproducing Type: Bug
Dominant language
Erlang
Stars
303
Forks
211
Avg merge
1d 8h
Merged PRs (30d)
5

Description

following the guide to install chef-server standalone on ubuntu 14.04 https://docs.chef.io/install_server.html

When configuring the chef-server.rb

ldap['host'] = "ldap.foxpass.com"
ldap['port'] = 636
ldap['ssl_enabled'] = true
ldap['tls_enabled'] = false
ldap['base_dn'] = "DC=company,DC=com"
ldap['bind_dn'] = "CN=chefPOC,DC=company,DC=com"
ldap['bind_password'] = "***********"
ldap['login_attribute'] = "uid"
ldap['timeout'] = 60

If I execute ldap search from the same box as chef-server is running on everything works properly. however when I attempt to log in to chef the following appears in the logs.

==> /var/log/opscode/opscode-erchef/erchef.log <==
2016-04-19 21:10:20.844 [error] Failed to connect to ldap host or an error occurred during connection setup. Please check private-chef.rb for correct host, port, and encryption values: "connect failed"

==> /var/log/opscode/nginx/access.log <==
127.0.0.1 - - [19/Apr/2016:21:10:20 -0700]  "POST /authenticate_user HTTP/1.1" 504 "0.023" 51 "-" "Chef Manage/11.16.2 (ruby-2.2.2-p95; ohai-7.4.1; x86_64-linux; +http://opscode.com)" "127.0.0.1:8000" "504" "0.018" "11.16.2" "algorithm=sha1;version=1.0;" "pivotal" "2016-04-20T04:10:20Z" "224ryeoFs87+GoyYKioKCn9f3qE=" 1120
192.168.67.237 - - [19/Apr/2016:21:10:20 -0700]  "POST /login HTTP/1.1" 200 "0.058" 4298 "https://chef.daqri.com/login" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.112 Safari/537.36" "127.0.0.1:9462" "200" "0.058" "-" "-" "-" "-" "-" 945

==> /var/log/opscode/opscode-erchef/crash.log <==
2016-04-19 21:10:20 =ERROR REPORT====
{<<"method=POST; path=/authenticate_user; status=504; ">>,"Gateway Timeout"}

==> /var/log/opscode/opscode-erchef/erchef.log <==
2016-04-19 21:10:20.844 [error] {<<"method=POST; path=/authenticate_user; status=504; ">>,"Gateway Timeout"}

==> /var/log/opscode/opscode-erchef/current <==
2016-04-20_04:10:20.90990 [error] Failed to connect to ldap host or an error occurred during connection setup. Please check private-chef.rb for correct host, port, and encryption values: "connect failed"
2016-04-20_04:10:20.94065 [error] {<<"method=POST; path=/authenticate_user; status=504; ">>,"Gateway Timeout"}

these errors show up in the chef logs milliseconds after clicking login through the management console so a 504 seems like an improper error code.

I have spoken with foxpath and there is no inbound connection to their ldap service, something in chef server is failing to connect to ldap and is throwing the error.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the LDAP settings in chef-server.rb and private-chef.rb, then trace the failed /authenticate_user request through the opscode-erchef erchef.log and crash.log entries. Compare the configured host, port, and encryption values with the connection path used by erchef; done means LDAP authentication succeeds without the 504 and the logs no longer report "connect failed".

Written by the indexing model from the issue text.

Assessment

Tech stack
erlang
Domain
authentication, backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.