EugenMayer/docker-sync · error
No docker-sync.yml configuration found in your path ( traver
Error message
No docker-sync.yml configuration found in your path ( traversing up ) Did you define it for your project?
What it means
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.
Source
Thrown at lib/docker-sync/config/config_locator.rb:23
module ConfigLocator
ERROR_MISSING_PROJECT_CONFIG =
'No docker-sync.yml configuration found in your path ( traversing up ) '\
'Did you define it for your project?'.freeze
class << self
attr_accessor :global_config_path
# @return [String] The path to the global config location
def current_global_config_path
path = global_config_path
path = File.expand_path('~/.docker-sync-global.yml') if path.nil?
path
end
# @return [String] the path to the project configuration found
def lookup_project_config_path
files = project_config_find
raise ERROR_MISSING_PROJECT_CONFIG if files.empty?
files.pop
end
private
# this has been ruthlessly stolen from Thor/runner.rb - please do not hunt me for that :)
# returns a list of file paths matching the docker-sync.yml file. The return the first one we find while traversing
# the folder tree up
# @return [Array]
def project_config_find(skip_lookup = false)
# Finds docker-sync.yml by traversing from your current directory down to the root
# directory of your system. If at any time we find a docker-sync.yml file, we stop.
#
#
# ==== Example
#View on GitHub (pinned to 4eab6de164)
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.
Example fix
# before (run from ~/work, no docker-sync.yml anywhere above it) cfg = DockerSync::ProjectConfig.new # => RuntimeError: No docker-sync.yml configuration found in your path... # after (docker-sync.yml exists at the project root): # version: "2" # syncs: # appcode-sync: # src: './src' cfg = DockerSync::ProjectConfig.new
Defensive patterns
Strategy: validation
Validate before calling
require 'pathname'
found = Pathname.pwd.ascend.any? { |dir| File.exist?(dir.join('docker-sync.yml')) }
abort 'no docker-sync.yml in this directory tree' unless found
config = DockerSync::ProjectConfig.new Try / catch
begin
config = DockerSync::ProjectConfig.new
rescue RuntimeError => e
raise unless e.message.start_with?('No docker-sync.yml configuration found')
warn 'docker-sync: create docker-sync.yml at the project root or pass config_path:'
exit 1
end Prevention
- 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.
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- Your docker-sync.yml file does not include a version: "2"(Ad
- Your docker-sync.yml file does not match the required versio
- no syncs defined
- Unknown sync_strategy #{@options['sync_strategy']}
- Unknown watch_strategy #{@options['watch_strategy']}
AI-assisted analysis of EugenMayer/docker-sync@4eab6de164 (2026-08-23).
Data as JSON: /api/errors/1c5e0ae2020d232b.
Report an issue: GitHub.