{"record":{"id":"7d26d4fff08909bd","repo":"hashicorp/vagrant","slug":"chef-server-provisioning-requires-that-the-config-7d26d4","errorCode":null,"errorMessage":"Chef server provisioning requires that the `config.chef.chef_server_url` be set to the\nURL of your chef server. Examples include \"http://12.12.12.12:4000\" and\n\"http://example.com:4000\" (the port of course can be different, but 4000 is the default)","messagePattern":"Chef server provisioning requires that the `config\\.chef\\.chef_server_url` be set to the\nURL of your chef server\\. Examples include \"http://12\\.12\\.12\\.12:4000\" and\n\"http://example\\.com:4000\" \\(the port of course can be different, but 4000 is the default\\)","errorType":"exception","errorClass":"VagrantPlugins::Chef::Provisioner::Base::ChefError","httpStatus":null,"severity":"error","filePath":"plugins/provisioners/chef/provisioner/chef_client.rb","lineNumber":23,"sourceCode":"\nrequire 'vagrant'\nrequire 'vagrant/util/presence'\nrequire 'vagrant/util/subprocess'\n\nrequire_relative \"base\"\n\nmodule VagrantPlugins\n  module Chef\n    module Provisioner\n      # This class implements provisioning via chef-client, allowing provisioning\n      # with a chef server.\n      class ChefClient < Base\n        include Vagrant::Util::Presence\n\n        def configure(root_config)\n          raise ChefError, :server_validation_key_required if @config.validation_key_path.nil?\n          raise ChefError, :server_validation_key_doesnt_exist if !File.file?(validation_key_path)\n          raise ChefError, :server_url_required if @config.chef_server_url.nil?\n        end\n\n        def provision\n          install_chef\n          verify_binary(chef_binary_path(\"chef-client\"))\n          chown_provisioning_folder\n          create_client_key_folder\n          upload_validation_key\n          upload_encrypted_data_bag_secret\n          setup_json\n          setup_server_config\n          run_chef_client\n          delete_encrypted_data_bag_secret\n        end\n\n        def cleanup\n          if @config.delete_node\n            delete_from_chef_server(\"node\")","sourceCodeStart":5,"sourceCodeEnd":41,"githubUrl":"https://github.com/hashicorp/vagrant/blob/35f3160f4ad6edc3a9f3aa9570adfc1a4d73aaa5/plugins/provisioners/chef/provisioner/chef_client.rb#L5-L41","documentation":"Raised in ChefClient#configure when `config.chef.chef_server_url` is nil. Server-based provisioning writes this URL into the guest's client.rb (setup_server_config), so without it chef-client has no server to register against and converge with. Pure Vagrantfile configuration error, validated before any guest interaction.","triggerScenarios":"Declaring a chef_client provisioner without `chef.chef_server_url`, e.g. after migrating from chef_solo and only keeping cookbooks_path settings.","commonSituations":"Migrating a chef_solo setup to chef-client; typos in the option name (chef_server_url vs server_url); forgetting the organization segment on hosted Chef (`/organizations/<org>`).","solutions":["Set the URL including organization: `chef.chef_server_url = \"https://api.chef.io/organizations/myorg\"`","For self-hosted Infra Server include the port if non-standard, e.g. `https://chef.internal:443/organizations/myorg`","Copy the exact value from your knife.rb / config.rb `chef_server_url` entry"],"exampleFix":"# Vagrantfile - before\nconfig.vm.provision \"chef_client\" do |chef|\n  chef.validation_key_path = \"keys/myorg-validator.pem\"\nend\n\n# Vagrantfile - after\nconfig.vm.provision \"chef_client\" do |chef|\n  chef.validation_key_path = \"keys/myorg-validator.pem\"\n  chef.chef_server_url = \"https://api.chef.io/organizations/myorg\"\nend","handlingStrategy":"validation","validationCode":"# Derive all server settings from one source of truth (knife.rb / config.rb)\nrequire \"chef/config\" if defined?(Chef)\nchef_server = ENV.fetch(\"CHEF_SERVER_URL\") # e.g. https://api.chef.io/organizations/myorg\nabort \"CHEF_SERVER_URL not set\" if chef_server.nil?\n\nconfig.vm.provision \"chef_client\" do |chef|\n  chef.chef_server_url = chef_server\nend","typeGuard":"def chef_client_config_valid?(chef)\n  !chef.chef_server_url.nil? && !chef.validation_key_path.nil?\nend","tryCatchPattern":null,"preventionTips":["Copy chef_server_url verbatim from your knife.rb/config.rb, including the /organizations/<org> segment","Centralize chef server settings in env vars so Vagrantfile and knife stay in sync"],"tags":["chef","chef-client","provisioning","vagrant","configuration"],"backgroundTag":"missing-required-config-option","analyzedSha":"35f3160f4ad6edc3a9f3aa9570adfc1a4d73aaa5","analyzedAt":"2026-08-21T13:34:32.514Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}