{"record":{"id":"c29ea91d48bb0d42","repo":"EugenMayer/docker-sync","slug":"no-syncs-defined","errorCode":null,"errorMessage":"no syncs defined","messagePattern":"no syncs defined","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"lib/docker-sync/config/project_config.rb","lineNumber":77,"sourceCode":"      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\n      end","sourceCodeStart":59,"sourceCodeEnd":95,"githubUrl":"https://github.com/EugenMayer/docker-sync/blob/4eab6de164d44c724c739c17bd574efa9008aae1/lib/docker-sync/config/project_config.rb#L59-L95","documentation":"After the version checks pass, validate_config! requires a top-level 'syncs' key and raises ERROR_MISSING_SYNCS ('no syncs defined') when it is absent (lib/docker-sync/config/project_config.rb:77). The check tests key presence only: syncs: {} (present but empty) passes validation and instead yields zero sync processes downstream. So this exact message means the syncs key itself is missing from the parsed config.","triggerScenarios":"ProjectConfig.new with a config that has version: \"2\" but no top-level syncs: key: a file with only the header, entries nested under a misspelled key (sync:, syncs-config:), or sync entries pasted at the wrong indentation level so YAML demoted them.","commonSituations":"Half-finished first-time setup; YAML indentation mistakes that turn syncs into a nested key of something else; renaming the key while refactoring a config.","solutions":["Add a top-level syncs: mapping with at least one named sync carrying a src: entry (src is mandatory per validate_sync_config, project_config.rb:89).","Verify YAML indentation: syncs: must sit at column 0 with its sync entries indented beneath it.","If you intentionally want zero syncs for now, write syncs: {} so the key exists."],"exampleFix":"# before\nversion: \"2\"\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 top-level syncs key' unless raw.key?('syncs')\nwarn 'syncs is empty: no sync processes will run' if raw['syncs'].to_a.empty?\nconfig = DockerSync::ProjectConfig.new","typeGuard":null,"tryCatchPattern":"begin\n  DockerSync::ProjectConfig.new\nrescue RuntimeError => e\n  raise unless e.message == DockerSync::ProjectConfig::ERROR_MISSING_SYNCS\n  # syncs key absent: add a top-level syncs: mapping with at least one entry\nend","preventionTips":["After editing, parse docker-sync.yml to confirm syncs remains a top-level key.","One indentation level off silently nests syncs under another key; use a YAML-aware editor.","Give every sync entry at least src: when you create it, not later."],"tags":["docker-sync","ruby","yaml","configuration"],"backgroundTag":"missing-config-key","analyzedSha":"4eab6de164d44c724c739c17bd574efa9008aae1","analyzedAt":"2026-08-23T10:20:11.101Z","schemaVersion":2},"datasetVersion":"2026-08-23T13:39:53.451Z"}