Knife client list unexpected error

Hi, I've been trying to set up a basic Chef Automate with Chef Infra install, following both the docs on the site and Chef's YouTube videos.
Everything appears to work as expected up until I try to do a 'knife client list' after adding the user .pem file, fetching the server certificate etc which fails with a NoMethodError, apparently sending HTML instead of JSON.
Not sure what else to try, I may attempt a standalone install of Chef Infra rather than the one deployed via Chef Automate if that might make a difference.
I am also attempting this in a cloud provider environment, and it doesn't matter whether I use a workstation VM or my local workstation w VPN access, the result is the same. I may try a local setup with VMs on my local workstation to rule out any provider issues

what version of chef-workstation are you using?

21.10.640 on a linux workstation
23.7.1042 on a Macbook

Also I've noticed among other things I don't have an /etc/opscode/chef-server.rb for example - the directory doesn't even exist. Should it if the Chef Infra install was done via chef-automate deploy?

automate is running habitat under the hood and habitat locates all files into /hab directory as chroot like environment.

make sure you have dns entry and fqdn defined in config. After install in your ~/.chef folder you'll need a config pointing to the chef-server-url with path to org name, your users.pem file, and network conectivity to chef-server/automate. then you'll need to run knife ssl fetch https://fqdn-to-chef-server.com. Then knife status should work.

The ssl fetch and ssl check work, knife status gives 405 Error Not Allowed
knife config show everything looks correct , chef_server_url is https: path to my org name

did you run the command to add the user to the chef-server org? Install Chef Infra Server With Automate

yes and the association user is a user created with the user-create command, the user's .pem file is copied to ~/.chef on the workstation, in the credentials file the client_name is the username

That is all correct then. Otherwise try adding -VVV to knife command to see if it gives more info. Maybe create a different test org and add the user and see if that one works, possibly even a new user and add to both orgs and test. Throwing out Ideas to narrow down possible issue with org or user created.

this is the output of knife status -VVV. It also says it's doing a POST request which seems odd
TRACE: ---- HTTP Response Body ----
TRACE:

405 Not Allowed

405 Not Allowed


nginx

TRACE: ---- End HTTP Response Body -----
TRACE: ---- HTTP Request Body ----
TRACE: {"name":["name"],"ipaddress":["ipaddress"],"ohai_time":["ohai_time"],"cloud":["cloud"],"run_list":["run_list"],"platform":["platform"],"platform_version":["platform_version"],"chef_environment":["chef_environment"]}
TRACE: ---- End HTTP Request Body ----
TRACE: Chef::HTTP calling Chef::HTTP::ValidateContentLength#handle_response
TRACE: Content-Length validated correctly.
TRACE: Chef::HTTP calling Chef::HTTP::APIVersions#handle_response
TRACE: Chef::HTTP calling Chef::HTTP::RemoteRequestID#handle_response
TRACE: Chef::HTTP calling Chef::HTTP::Authenticator#handle_response
TRACE: Chef::HTTP calling Chef::HTTP::Decompressor#handle_response
TRACE: Chef::HTTP calling Chef::HTTP::CookieManager#handle_response
TRACE: Chef::HTTP calling Chef::HTTP::JSONOutput#handle_response
TRACE: Expected JSON response, but got content-type 'text/html'
TRACE: Response body contains:

405 Not Allowed

405 Not Allowed


nginx

TRACE: Initiating POST to https://chef-test.(edited out my domain)

Here's the output from knife client list -VVV

knife client list -VVV
INFO: Using configuration from /home/testuser/chef-repo/.chef/config.rb
TRACE: Chef::HTTP calling Chef::HTTP::JSONInput#handle_request
TRACE: Chef::HTTP calling Chef::HTTP::JSONOutput#handle_request
TRACE: Chef::HTTP calling Chef::HTTP::CookieManager#handle_request
TRACE: Chef::HTTP calling Chef::HTTP::Decompressor#handle_request
TRACE: Chef::HTTP calling Chef::HTTP::Authenticator#handle_request
TRACE: Signing the request as test_chef
TRACE: Chef::HTTP calling Chef::HTTP::RemoteRequestID#handle_request
TRACE: Chef::HTTP calling Chef::HTTP::APIVersions#handle_request
TRACE: Chef::HTTP calling Chef::HTTP::ValidateContentLength#handle_request
TRACE: Initiating GET to https://chef-test.(my test domain)/clients
TRACE: ---- HTTP Request Header Data: ----
TRACE: Accept: application/json
TRACE: Accept-Encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3
TRACE: X-Ops-Server-API-Version: 1
TRACE: X-OPS-SIGN: algorithm=sha1;version=1.1;
TRACE: X-OPS-USERID: test_chef
TRACE: X-OPS-TIMESTAMP: 2023-10-31T22:06:44Z
TRACE: X-OPS-CONTENT-HASH: 2jmj7l5rSw0yVb/vlWAYkK/YBwk=
TRACE: X-OPS-AUTHORIZATION-1: F1VZBW7Sw204UFXbqMgoErogS5UAHMsz0XjZnpIu9vDkFKphZE+XsCAE0lMX
TRACE: X-OPS-AUTHORIZATION-2: Vq/6v0l08dyJ83BthSgKIz/J6KQAIEzu/rcOgENwUCACqw8whaZ1Y37dmyNo
TRACE: X-OPS-AUTHORIZATION-3: F0zYnipyVktrBxXxZJp0gQ/c13f1oH7sS1y58F/ImgWIwnNfDRGmo3nTaVm5
TRACE: X-OPS-AUTHORIZATION-4: CHqYC7Bv/6/E/8DS2MyGuvtx7Pv1CM1SBEcOWhzD6njzD/SfSy8rVaiifLT1
TRACE: X-OPS-AUTHORIZATION-5: Rs+yu4AbPQRIvrdrJL/51YoSx3R2JOU0TgtT7tBpOKCtOoXaOrU1Pz9b/Us4
TRACE: X-OPS-AUTHORIZATION-6: 6akVSOzPoY/QmFdw4bibAqRWq0NyjqitDolAdoI5Iw==
TRACE: HOST: chef-test.(my test domain):443
TRACE: X-REMOTE-REQUEST-ID: ff8f90c4-391e-48e4-a15d-ace946e99add
TRACE: ---- End HTTP Request Header Data ----
TRACE: ---- HTTP Status and Header Data: ----
TRACE: HTTP 1.1 200 OK
TRACE: date: Tue, 31 Oct 2023 22:06:44 GMT
TRACE: content-type: text/html
TRACE: content-length: 2466
TRACE: connection: close
TRACE: last-modified: Thu, 12 Oct 2023 06:19:46 GMT
TRACE: etag: "65279002-9a2"
TRACE: strict-transport-security: max-age=63072000; includeSubDomains
TRACE: accept-ranges: bytes
TRACE: x-frame-options: sameorigin
TRACE: cache-control: private
TRACE: x-xss-protection: 1; mode=block
TRACE: x-content-type-options: nosniff
TRACE: ---- End HTTP Status/Header Data ----
TRACE: Chef::HTTP calling Chef::HTTP::ValidateContentLength#handle_response
TRACE: Content-Length validated correctly.
TRACE: Chef::HTTP calling Chef::HTTP::APIVersions#handle_response
TRACE: Chef::HTTP calling Chef::HTTP::RemoteRequestID#handle_response
TRACE: Chef::HTTP calling Chef::HTTP::Authenticator#handle_response
TRACE: Chef::HTTP calling Chef::HTTP::Decompressor#handle_response
TRACE: Chef::HTTP calling Chef::HTTP::CookieManager#handle_response
TRACE: Chef::HTTP calling Chef::HTTP::JSONOutput#handle_response
TRACE: Expected JSON response, but got content-type 'text/html'

output from tailing /var/log/messages on the Chef Automate / Infra server when running knife org list from the workstation:

Nov 1 15:42:12 chef-test hab[26420]: automate-ui.default(O): - [01/Nov/2023:15:42:12 +0000] "GET /infrastructure/chef-servers/chef-test/organizations HTTP/1.1" 200 "0.000" 2466 "-" "Chef Infra Client Knife/17.6.18 (ruby-3.0.2-p107; ohai-17.6.0; x86_64-linux; +https://chef.io)" "-" "-" "-" 1041
Nov 1 15:42:12 chef-test hab[26420]: automate-load-balancer.default(O): - [01/Nov/2023:15:42:12 +0000] "GET /infrastructure/chef-servers/chef-test/organizations HTTP/1.1" 200 "0.000" 2466 "-" "Chef Infra Client Knife/17.6.18 (ruby-3.0.2-p107; ohai-17.6.0; x86_64-linux; +https://chef.io)" "127.0.0.1:10161" "200" "0.000" 1105
Nov 1 15:42:13 chef-test hab[26420]: automate-ui.default(O): - [01/Nov/2023:15:42:13 +0000] "HEAD / HTTP/1.1" 200 "0.000" 0 "-" "curl/7.79.1" "-" "-" "-" 82
Nov 1 15:42:16 chef-test hab[26420]: automate-postgresql.default(O): 2023-11-01 15:42:16 GMT [1809994]: [1-1] user=,db=,client= (0:00000)LOG: automatic analyze of table "chef_cereal_service.public.cereal_workflow_instances" system usage: CPU: user: 0.00 s, system: 0.00 s, elapsed: 0.00 s
Nov 1 15:42:21 chef-test hab[26420]: automate-cs-ocid.default(O): I, [2023-11-01T15:42:21.253405 #37720] INFO -- : Started GET "/id/signin" for 127.0.0.1 at 2023-11-01 15:42:21 +0000
Nov 1 15:42:21 chef-test hab[26420]: automate-cs-ocid.default(O): I, [2023-11-01T15:42:21.254200 #37720] INFO -- : Processing by SessionsController#new as /
Nov 1 15:42:21 chef-test hab[26420]: automate-cs-ocid.default(O): I, [2023-11-01T15:42:21.255271 #37720] INFO -- : Rendered sessions/new.html.erb within layouts/application (Duration: 0.5ms | Allocations: 308)
Nov 1 15:42:21 chef-test hab[26420]: automate-cs-ocid.default(O): I, [2023-11-01T15:42:21.256891 #37720] INFO -- : Rendered layout layouts/application.html.erb (Duration: 2.1ms | Allocations: 1651)
Nov 1 15:42:21 chef-test hab[26420]: automate-cs-ocid.default(O): I, [2023-11-01T15:42:21.257052 #37720] INFO -- : Completed 200 OK in 3ms (Views: 2.5ms | Allocations: 1929)

Argh, the problem was just the chef_server_url - I was including the entire path to the org i.e. https://myserver.mydomain/infrastructure/chef-servers/myserver/organizations/myorg and not just https://myserver.mydomain/organizations/myorg
the correct path is shown in the example credentials / config.rb's but I didn't see it until now