{"record":{"id":"3a2d79adcefb374f","repo":"EugenMayer/docker-sync","slug":"your-docker-sync-yml-file-does-not-include-a-versi","errorCode":null,"errorMessage":"Your docker-sync.yml file does not include a version: \"2\"(Add this if you migrated from docker-sync 0.1.x)","messagePattern":"Your docker-sync\\.yml file does not include a version: \"2\"\\(Add this if you migrated from docker-sync 0\\.1\\.x\\)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"lib/docker-sync/config/project_config.rb","lineNumber":75,"sourceCode":"    def rsync_required?\n      # noinspection RubyUnusedLocalVariable\n      config['syncs'].any? { |name, sync_config|\n        sync_config['sync_strategy'] == 'rsync'\n      }\n    end\n\n    def fswatch_required?\n      # noinspection RubyUnusedLocalVariable\n      config['syncs'].any? { |name, sync_config|\n        sync_config['watch_strategy'] == 'fswatch'\n      }\n    end\n\n    private\n\n      def validate_config!\n        raise error_missing_given_config if config.nil?\n        raise ERROR_MISSING_CONFIG_VERSION unless config.key?('version')\n        raise ERROR_MISMATCH_CONFIG_VERSION unless config['version'].to_s == REQUIRED_CONFIG_VERSION\n        raise ERROR_MISSING_SYNCS unless config.key?('syncs')\n\n        validate_syncs_config!\n      end\n\n      def validate_syncs_config!\n        config['syncs'].each do |name, sync_config|\n          validate_sync_config(name, sync_config)\n        end\n      end\n\n      def validate_sync_config(name, sync_config)\n        config_mandatory = %w[src]\n        #TODO: Implement autodisovery for other strategies\n        config_mandatory.push('sync_host_port') if sync_config['sync_strategy'] == 'rsync'\n        config_mandatory.each do |key|\n          raise (\"#{name} does not have #{key} configuration value set - this is mandatory\") unless sync_config.key?(key)","sourceCodeStart":57,"sourceCodeEnd":93,"githubUrl":"https://github.com/EugenMayer/docker-sync/blob/4eab6de164d44c724c739c17bd574efa9008aae1/lib/docker-sync/config/project_config.rb#L57-L93","documentation":"The v2 config format requires a top-level version key (REQUIRED_CONFIG_VERSION = '2' in lib/docker-sync/config/project_config.rb:11). validate_config! raises ERROR_MISSING_CONFIG_VERSION when the YAML was found and parsed fine but contains no 'version' key at all: the signature of a config written for docker-sync 0.1.x, which the error text calls out explicitly. This is distinct from the neighboring line-76 check, which fires when the key exists but holds the wrong value.","triggerScenarios":"ProjectConfig.new finds and parses docker-sync.yml, but the resulting hash has no 'version' key: for example a file containing only a syncs: block, or a pre-0.2.x config migrated as-is. Applies to both file-loaded configs and configs passed via config_string.","commonSituations":"Migrating from docker-sync 0.1.x; writing a first config from an outdated tutorial that omits the version header; deleting the line as apparent noise while editing.","solutions":["Add version: \"2\" as the first line of docker-sync.yml (the unquoted integer 2 also passes because the check compares value.to_s).","If migrating a 0.1.x config, also move your sync entries under a top-level syncs: key.","When unsure of the file shape, copy example/docker-sync.yml from the docker-sync repository and re-add your syncs."],"exampleFix":"# before (docker-sync.yml)\nsyncs:\n  appcode-sync:\n    src: './src'\n\n# after\nversion: \"2\"\nsyncs:\n  appcode-sync:\n    src: './src'","handlingStrategy":"validation","validationCode":"require 'yaml'\n\nraw = YAML.safe_load(File.read('docker-sync.yml')) || {}\nabort 'docker-sync.yml: missing version key' unless raw.key?('version')\nconfig = DockerSync::ProjectConfig.new","typeGuard":null,"tryCatchPattern":"begin\n  DockerSync::ProjectConfig.new\nrescue RuntimeError => e\n  raise unless e.message == DockerSync::ProjectConfig::ERROR_MISSING_CONFIG_VERSION\n  # parsed fine but no version key: add version: \"2\" and retry\nend","preventionTips":["Start new configs from example/docker-sync.yml in the docker-sync repository.","Treat the version: header as required boilerplate, never optional metadata.","Add a CI lint step that parses docker-sync.yml and checks its top-level keys."],"tags":["docker-sync","ruby","yaml","configuration","schema-validation"],"backgroundTag":"missing-config-key","analyzedSha":"4eab6de164d44c724c739c17bd574efa9008aae1","analyzedAt":"2026-08-23T10:20:11.101Z","schemaVersion":2},"datasetVersion":"2026-08-23T13:39:53.451Z"}