{"record":{"id":"1c5e0ae2020d232b","repo":"EugenMayer/docker-sync","slug":"no-docker-sync-yml-configuration-found-in-your-pat","errorCode":null,"errorMessage":"No docker-sync.yml configuration found in your path ( traversing up ) Did you define it for your project?","messagePattern":"No docker-sync\\.yml configuration found in your path \\( traversing up \\) Did you define it for your project\\?","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"lib/docker-sync/config/config_locator.rb","lineNumber":23,"sourceCode":"  module ConfigLocator\n    ERROR_MISSING_PROJECT_CONFIG =\n      'No docker-sync.yml configuration found in your path ( traversing up ) '\\\n      'Did you define it for your project?'.freeze\n\n    class << self\n      attr_accessor :global_config_path\n      # @return [String] The path to the global config location\n      def current_global_config_path\n        path = global_config_path\n        path = File.expand_path('~/.docker-sync-global.yml') if path.nil?\n        path\n      end\n\n      # @return [String] the path to the project configuration found\n      def lookup_project_config_path\n        files = project_config_find\n\n        raise ERROR_MISSING_PROJECT_CONFIG if files.empty?\n\n        files.pop\n      end\n\n      private\n\n\n      # this has been ruthlessly stolen from Thor/runner.rb - please do not hunt me for that :)\n      # returns a list of file paths matching the docker-sync.yml file. The return the first one we find while traversing\n      # the folder tree up\n      # @return [Array]\n      def project_config_find(skip_lookup = false)\n        # Finds docker-sync.yml by traversing from your current directory down to the root\n        # directory of your system. If at any time we find a docker-sync.yml file, we stop.\n        #\n        #\n        # ==== Example\n        #","sourceCodeStart":5,"sourceCodeEnd":41,"githubUrl":"https://github.com/EugenMayer/docker-sync/blob/4eab6de164d44c724c739c17bd574efa9008aae1/lib/docker-sync/config/config_locator.rb#L5-L41","documentation":"docker-sync locates its project configuration by searching for a file named exactly docker-sync.yml in the current working directory and then in every parent directory up to the filesystem root (the only glob checked is <path>/docker-sync.yml, see globs_for_project_config in lib/docker-sync/config/config_locator.rb). lookup_project_config_path raises this error when that upward traversal finds no match. It is reached from ProjectConfig#initialize (project_config.rb:31) whenever no config_path or config_string argument is given, so it fires before any other validation for every docker-sync command run in a config-less directory tree.","triggerScenarios":"Running any docker-sync command, or calling DockerSync::ProjectConfig.new with config_path nil/empty, from a working directory where neither it nor any ancestor contains docker-sync.yml. Only the exact filename matches: docker-sync.yaml, docker_sync.yml, or docker-sync.yml.dist are all invisible to the lookup.","commonSituations":"Fresh project where docker-sync.yml was never created; running the CLI from outside the project tree; the file being untracked or gitignored so a fresh clone lacks it; a misspelled filename such as docker-sync.yaml.","solutions":["Create docker-sync.yml in your project root with a version: \"2\" header and a syncs: block.","If the file exists under a different name (for example docker-sync.yaml), rename it to exactly docker-sync.yml.","Run the command from the project root or from any directory below the folder that holds docker-sync.yml; the lookup only ascends from the current directory.","In code, bypass the lookup by passing config_path: 'config/docker-sync.yml' or config_string: to ProjectConfig.new."],"exampleFix":"# before (run from ~/work, no docker-sync.yml anywhere above it)\ncfg = DockerSync::ProjectConfig.new\n# => RuntimeError: No docker-sync.yml configuration found in your path...\n\n# after (docker-sync.yml exists at the project root):\n#   version: \"2\"\n#   syncs:\n#     appcode-sync:\n#       src: './src'\ncfg = DockerSync::ProjectConfig.new","handlingStrategy":"validation","validationCode":"require 'pathname'\n\nfound = Pathname.pwd.ascend.any? { |dir| File.exist?(dir.join('docker-sync.yml')) }\nabort 'no docker-sync.yml in this directory tree' unless found\nconfig = DockerSync::ProjectConfig.new","typeGuard":null,"tryCatchPattern":"begin\n  config = DockerSync::ProjectConfig.new\nrescue RuntimeError => e\n  raise unless e.message.start_with?('No docker-sync.yml configuration found')\n  warn 'docker-sync: create docker-sync.yml at the project root or pass config_path:'\n  exit 1\nend","preventionTips":["Keep docker-sync.yml at the repository root and commit it; do not gitignore it.","Run docker-sync commands from the project root or a subdirectory of it.","Use the exact filename docker-sync.yml; .yaml variants are not matched.","In scripts, pass config_path: explicitly instead of relying on the upward lookup."],"tags":["docker-sync","ruby","configuration","file-not-found"],"backgroundTag":"config-file-not-found","analyzedSha":"4eab6de164d44c724c739c17bd574efa9008aae1","analyzedAt":"2026-08-23T10:20:11.101Z","schemaVersion":2},"datasetVersion":"2026-08-23T13:39:53.451Z"}