{"record":{"id":"a5c8522d37219840","repo":"EugenMayer/docker-sync","slug":"your-docker-sync-yml-file-does-not-match-the-requi","errorCode":null,"errorMessage":"Your docker-sync.yml file does not match the required version (2).","messagePattern":"Your docker-sync\\.yml file does not match the required version \\(2\\)\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"lib/docker-sync/config/project_config.rb","lineNumber":76,"sourceCode":"      # 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)\n        end","sourceCodeStart":58,"sourceCodeEnd":94,"githubUrl":"https://github.com/EugenMayer/docker-sync/blob/4eab6de164d44c724c739c17bd574efa9008aae1/lib/docker-sync/config/project_config.rb#L58-L94","documentation":"The config has a version key, but its value does not equal the required '2': validate_config! compares config['version'].to_s == REQUIRED_CONFIG_VERSION ('2', defined at lib/docker-sync/config/project_config.rb:11, checked at line 76). docker-sync refuses configs of a different format generation instead of misinterpreting them. Because the comparison goes through to_s, the integer 2 is accepted; '1', '2.0', 3, or 'two' all raise.","triggerScenarios":"ProjectConfig.new with version: \"1\" (a 0.1.x-era config that did carry a version), version: \"2.0\", or any other value, whether loaded from docker-sync.yml or passed via config_string.","commonSituations":"Running an older docker-sync gem against a config written for a newer format (or the reverse); hand-editing the value to '2.0' assuming semver; copying configs between projects pinned to different docker-sync releases.","solutions":["Set the value to exactly version: \"2\" (or the unquoted integer 2).","If the config was authored for a newer docker-sync, upgrade the gem (check gem list docker-sync or the VERSION file) rather than rewriting the config backward.","Keep the version line untouched when copying configs between projects."],"exampleFix":"# before\nversion: \"1\"\n\n# after\nversion: \"2\"   # the unquoted integer 2 also works (compared via to_s)","handlingStrategy":"validation","validationCode":"require 'yaml'\n\nraw = YAML.safe_load(File.read('docker-sync.yml')) || {}\nabort 'docker-sync.yml: version must be \"2\"' unless raw['version'].to_s == '2'\nconfig = DockerSync::ProjectConfig.new","typeGuard":null,"tryCatchPattern":"begin\n  DockerSync::ProjectConfig.new\nrescue RuntimeError => e\n  raise unless e.message == DockerSync::ProjectConfig::ERROR_MISMATCH_CONFIG_VERSION\n  # version key present but wrong: set it to exactly \"2\"\nend","preventionTips":["Pin the docker-sync gem version in the Gemfile so the expected config format stays stable.","Never edit version to anything but the value documented for your installed gem.","After upgrading docker-sync, diff your config against the shipped example."],"tags":["docker-sync","ruby","yaml","configuration","version-mismatch"],"backgroundTag":"config-version-mismatch","analyzedSha":"4eab6de164d44c724c739c17bd574efa9008aae1","analyzedAt":"2026-08-23T10:20:11.101Z","schemaVersion":2},"datasetVersion":"2026-08-23T13:39:53.451Z"}