Repository navigation
Troubleshooting
Common issues and their solutions when running Anchor LFS.
The server can't find or parse the config file.
- Ensure
config.tomlexists in the working directory, or pass its path with--config(orANCHOR_LFS_CONFIG) - Check for TOML syntax errors (mismatched quotes, missing brackets)
- Run the server from the directory containing
config.toml
When the file loads but its settings are invalid, the log entry's errors field lists every problem found. anchor-lfs check lists the same problems one per line without starting the server. Fix them all before restarting; the entries below explain each message.
The config file contains a key or section the server does not know, usually a typo such as [option] for [options] or visibilty for visibility. The error lists each one by its full name (for example options.data_dir or endpoints.visibilty). Correct the spelling against config.toml.example or the Configuration reference, or remove keys left over from an older version.
At least one [[endpoints]] block is required in the configuration file.
An environment variable override has a value the server cannot use. ANCHOR_LFS_MAX_UPLOAD_SIZE takes a positive number of bytes (1073741824, not 1G), and ANCHOR_LFS_S3_PRESIGNED_URLS and ANCHOR_LFS_S3_FORCE_PATH_STYLE take true or false. Correct or unset the variable.
Every endpoint must have both name and endpoint fields set. An endpoint without a name is identified by its position in the file, such as endpoint #2.
Every endpoint must set visibility ("public" or "private") and authentication ("github" or "none").
The endpoint value is missing its leading slash. Use /org/repo, not org/repo.
The endpoint value has a trailing slash, an empty segment (//), or a dot segment (., ..). The error message suggests the corrected path; for example, /org/repo/ becomes /org/repo.
Two endpoints have the same endpoint path. Each endpoint must have a unique path.
Two endpoints map to the same storage directory, so they would share objects and locks. The directory name is the endpoint path without its leading slash, with / replaced by _, compared ignoring case: /org/repo, /org_repo, and /Org/Repo all collide. Rename one of the endpoints. The registered endpoint log line shows each endpoint's directory.
The endpoint path conflicts with a reserved server path (/health or /ready), or its storage directory would be one the server already uses in the data directory (/locks or /signing.key). Choose a different path.
An endpoint path segment contains a character other than letters, digits, ., _ and -, or the path starts with /. or ends with .. A path that mirrors the Git remote, such as /org/repo.git/info/lfs, is allowed.
When using a non-github.com repository URL with authentication = "github", you must also set github_api_url to the GitHub Enterprise API endpoint.
An endpoint is marked private but uses authentication = "none", which would let anyone read and write it. Either set authentication = "github" to protect it, or set visibility = "public" if it is a local development endpoint that is meant to be open.
The configured signing key is too short. Generate a proper key:
openssl rand -hex 32The server process cannot create files in data_directory. The log line includes the uid and gid the server runs as; give that user ownership of the directory. For the Docker image (uid 100, gid 101):
sudo chown -R 100:101 dataOn Linux this usually means Docker created ./data as root on first start. See Docker for details. For a systemd install, see Running the Server.
When using S3 storage, both s3_bucket and s3_region are required.
- Verify the endpoint's
authenticationsetting is correct - Ensure the GitHub PAT hasn't expired
- Check that the PAT has the required repository permissions
- For private endpoints, both downloads and uploads require authentication
- Uploads need a GitHub PAT with push (write) permission on the repository; downloads from a private endpoint need pull (read)
- The token itself must be allowed to write for uploads and locks, and to read for private downloads, even when your role allows more: a fine-grained token needs Contents: Read and write (or Read-only to download), and a classic token the
reposcope (public_repofor public repositories) - Uploads and locks on an archived repository are refused
- A token that cannot see the repository at all gets this error for uploads and locks, and 404 "repository not found" for downloads. Check the endpoint's
urlnames the right repository and the token has been granted access to it (fine-grained tokens list their repositories explicitly) - If the organisation uses SAML single sign-on, authorise the token for the organisation in your GitHub token settings
- Denials are cached for
auth_cache_ttl, so a permission fix can take that long to apply
A download from a private endpoint whose token cannot read the repository, which Git LFS reports as "Repository or object not found". The causes and fixes are the same as for 403 "insufficient permissions": the token needs pull on the repository, and a fine-grained token needs Contents: Read-only or more.
GitHub is rate limiting the token used to authenticate. Git LFS waits for the Retry-After period and retries. Lower the API traffic by keeping auth_cache_ttl enabled.
The server could not get an answer from the GitHub API (network failure, DNS, firewall, or a GitHub outage). The server log has the underlying error at warn level.
- Check
auth_cache_ttlas cached results may be stale. Try setting it to"0s"temporarily to disable caching - Verify the GitHub API is accessible from the server (check network/firewall rules)
- Ensure
github_api_urlpoints at the instance's REST API, usuallyhttps://github.example.com/api/v3/ - Verify the server can reach the GitHub Enterprise instance
- Check that the PAT was issued by the correct GitHub Enterprise instance
The client's LFS URL does not match any configured endpoint. Check the URL the client is using:
git lfs env | grep EndpointIt must be the server address followed by the endpoint path exactly, for example https://lfs.example.com/org/repo. Without an explicit lfs.url, Git LFS derives one from the Git remote (such as https://github.com/org/repo.git/info/lfs), which is not an Anchor LFS endpoint. See Git LFS Client Setup.
The uploaded file's SHA-256 hash doesn't match the declared OID. With presigned S3 uploads, the storage provider reports this itself as BadDigest. This usually indicates:
- File corruption during transfer
- A proxy or middleware is modifying the request body
- The client computed the hash incorrectly
The file exceeds max_upload_size (default: 5 GiB). Increase the limit in configuration:
[options]
max_upload_size = 10737418240 # 10 GiBAlso check your reverse proxy configuration. Nginx defaults to a 1 MB body size limit:
client_max_body_size 0; # Disable limitWith S3 storage and presigned URLs, objects over 5 GiB are refused with "object exceeds the maximum size for a direct upload to storage", whatever max_upload_size is. Set s3_presigned_urls = false to upload them through the server.
- The signed URL may have expired. Check
url_expiryin your configuration. - The signing key may have changed between when the URL was generated and when it was used (e.g., server restart without persisted key, or different key across instances)
- Without
base_url, a URL only works when the request reaches the server with the same scheme and host as the batch request that issued it. If your proxy changesHostor theX-Forwarded-*headers between requests, setbase_url. Atlog_level = "debug", each rejected URL is logged asrejected signed URLwith thebase_urlthe server checked it against.
If transfers time out, check your reverse proxy timeout settings. Anchor LFS itself has no fixed read/write timeouts, but your proxy might:
Nginx:
proxy_read_timeout 3600s;
proxy_send_timeout 3600s;Apache:
ProxyTimeout 3600The disk is full or has insufficient space. Free up disk space or switch to S3 storage.
A client IP has made more than rate_limit_tokens batch or lock requests in the current window. The response includes a Retry-After header giving the seconds until the window ends, and Git LFS clients wait that long before retrying. Object downloads and uploads are not rate limited.
Many users behind one NAT or proxy share a single IP and budget. If every request is logged with your reverse proxy's address, the proxy is not in trusted_proxies or does not send X-Forwarded-For; see Reverse Proxy. To allow more requests, raise the token count rather than lengthening the window, since a longer window means a longer wait once the budget runs out:
[options]
rate_limit_tokens = 3000
rate_limit_window = "1m"- Verify
s3_bucketands3_regionare set correctly - Check that credentials are valid (either explicit or via the AWS credential chain)
- For custom endpoints, ensure
s3_endpointis a valid URL
The server checks storage before it starts listening. For S3 it sends a HeadBucket request, and the error includes the S3 response:
-
404orNotFound: the bucket does not exist, ors3_bucketis misspelled -
403orForbidden: the credentials are wrong, or lacks3:ListBucketon the bucket -
301or a region error:s3_regiondoes not match the bucket's region -
context deadline exceededorconnection refused:s3_endpointis wrong or unreachable
For local storage, the error means the data directory does not accept new files; see "data directory ... is not writable" above.
- Grant
s3:ListBucketon the bucket (arn:aws:s3:::my-lfs-bucket). The startup and readiness checks use it, and without it S3 answers403instead of404for a missing object. - Grant
s3:GetObject,s3:PutObjectands3:AbortMultipartUploadon its objects (arn:aws:s3:::my-lfs-bucket/*) - Check the bucket policy allows access from the server
- For presigned URLs, the client needs direct network access to the S3 endpoint
If clients can't access presigned URLs:
- Ensure the S3 bucket is accessible from the client network
- Check CORS configuration on the bucket if clients are web-based
- Uploads failing with
SignatureDoesNotMatchmean the client did not send thex-amz-checksum-sha256header from the upload action, or something between the client and the bucket removed it - Try disabling presigned URLs to proxy through the server:
s3_presigned_urls = false - For S3-compatible services, try enabling path-style addressing:
s3_force_path_style = true
Warning
Always set base_url in production. Without it, the server relies on X-Forwarded-* headers to construct transfer URLs, increasing the attack surface. Only peers in trusted_proxies can set those headers, but a misconfigured proxy or a client on a trusted network could still influence the generated URLs. See Security for details.
Set base_url in your configuration for production deployments:
[options]
base_url = "https://lfs.example.com"Without it, the server derives URLs from X-Forwarded-Proto and X-Forwarded-Host headers, which must be set by a reverse proxy listed in trusted_proxies.
If action URLs in batch responses have the wrong scheme (http instead of https) or hostname:
- Set
base_urlin the configuration (recommended) - Or ensure your reverse proxy sets
X-Forwarded-ProtoandX-Forwarded-Hostcorrectly
Some reverse proxies buffer the entire request body before forwarding. For large LFS transfers, disable request buffering:
Nginx:
proxy_request_buffering off;
proxy_buffering off;[options]
log_format = "console"
log_level = "debug"This switches from JSON to human-readable lines and adds debug entries, such as successful health checks. Every request is already logged at the default info level unless access_log = false; failed requests appear at warn (4xx) or error (5xx). The environment variables ANCHOR_LFS_LOG_FORMAT and ANCHOR_LFS_LOG_LEVEL do the same without editing the file.
Every response includes an X-Request-ID header, and error responses repeat it as request_id in the JSON body. The same value appears as request_id on every server log line for that request: the access log entry and anything else logged while handling it. To find them, search the log for the ID:
docker compose logs anchor-lfs | grep a1b2c3d4e5f60718Git LFS prints the response headers when run with GIT_TRACE=1 GIT_CURL_VERBOSE=1. A batch request and the transfers it hands out are separate requests, so each has its own ID. If your reverse proxy sends its own request ID, the server uses that instead; see Reverse Proxy.
/health shows the process is running; /ready also checks the data directory and storage:
curl http://localhost:5420/health
# {"status":"ok","version":"v0.2.0"}
curl http://localhost:5420/ready
# {"status":"ready"}If /ready answers 503, its failed field names the check (data_directory or storage), and the server log has a readiness check failed warning with the cause. In Docker, docker inspect --format '{{json .State.Health}}' <container> shows the latest health check output.
Lock ownership is tied to the GitHub login of the token, not the username Git sends. If using authentication = "none", ownership is the Basic Auth username or "anonymous", and Git LFS sends no username unless lfs.<url>.access is basic (see Endpoints Without Authentication).
If a lock was left behind (e.g., user forgot to unlock), another user can force-unlock:
git lfs unlock --force path/to/file- Configuration: Review all configuration options
- Security: Security features and best practices
- Reverse Proxy: Proxy configuration