I am getting a following error on my Chef server. Please advise.
ubuntu@ip-172-31-44-218:~$ knife client list
ERROR: CONFIGURATION ERROR:chef-admin-server is an invalid chef_server_url. The URL must start with http://, https://, or chefzero://.
ubuntu@ip-172-31-44-218:~$ grep url ~/.chef/config.rb
grep: /home/ubuntu/.chef/config.rb: No such file or directory
ubuntu@ip-172-31-44-218:~$ knife client list -VVV
ERROR: CONFIGURATION ERROR:chef-admin-server is an invalid chef_server_url. The URL must start with http://, https://, or chefzero://.
ubuntu@ip-172-31-44-218:~$
Also, what host are you running the knife command on? Your chef workstation (eg, laptop), a chef node, or something else? If you are running it from your chef workstation, then your "node_name" is your username as it exists on the chef server. If you are running on a chef node, then you can run via sudo or root, and use the node config and authorization (via /etc/chef/client.rb)
If you are on a chef managed node (that runs chef-client), then you can run using root or sudo:
sudo knife client list
(Because it will find the chef_server_url config setting in the /etc/chef/client.rb file)
If you are on your chef workstation (your laptop/desktop or node where you manage cookbook files, etc), then you
need to create a ~/.chef/config.rb config file with your chef username, client key, and chef server URL.
Alternatively, you can specify all the config options on the command line when running the knife command.
Eg, "knife --help" shows that you can pass the chef server URL via the "--server-url URL" option.
Do you know, or have, your chef server URL (including the org name)?
Normally you wouldn't run knife on the chef-server itself. you would want to install chef-workstation on your laptop, From that point you would want to do the following,
make sure you have configured a user and an organization on the chef-server
make sure that user has to correct rights
download the pem file you created for the user to your workstation
create a chef-repo containing a .chef folder which will contain your config.rb and pem file
Please look at the following docs and make sure you've followed all the correct steps. Normally your chef server wouldn't appear as a chef-client when doing a knife client list as you wouldn't usually bootstrap it.
I have setup a Chef server and I am getting this error when run any command. Please advise how to fix it. Much appreciate your help.
ubuntu@ip-172-31-44-218:~$ knife cookbook upload datadog
ERROR: CONFIGURATION ERROR:chef-admin-server is an invalid chef_server_url. The URL must start with http://, https://, or chefzero://.