Error Reference

CLI Error Messages & Fixes

Every error share-env can produce, with exact causes and verified fixes from the official documentation.

FATALFATAL: Your .gitignore does not ignore .env files
When it occurs

Runs on both push and pull. Your project's .gitignore file either does not exist or does not contain rules to ignore .env and .env.* files.

Possible causes
  • .gitignore file does not exist in the project root
  • .gitignore exists but does not contain .env as a rule
  • The .gitignore is in a parent directory but not in the project root where you are running the command
Fix

Add the following lines to your .gitignore in the project root and re-run:

gitignore
.env
.env.*
When it occurs

Runs on push only. One or more lines in your .env file do not follow the required KEY=VALUE format.

Possible causes
  • A line has no = separator (e.g., just a key name with no value)
  • A line starts with whitespace before the key name
  • A line contains an invalid character in the key name
Fix

Open your .env file and ensure every non-empty, non-comment line follows KEY=VALUE format. Comments (starting with #) and blank lines are allowed.

dotenv
# Valid .env format:
DATABASE_URL=postgres://localhost:5432/mydb
API_KEY=your_api_key_here
DEBUG=true

# Comments are fine
# Blank lines are fine

# INVALID — will cause this error:
MY_KEY_WITHOUT_VALUE
   LEADING_WHITESPACE=bad
When it occurs

Runs on pull only. The relay identifier in your share code does not match any active payload on the relay server.

Possible causes
  • The payload was already pulled by someone else (burn-after-reading — it is gone)
  • The 10-minute TTL expired before you ran pull
  • The share code was copied incorrectly or truncated
  • The wrong relay --server URL was used (if self-hosting)
Fix

Ask the sender to run push again and generate a fresh share code. Do not attempt to pull the same code twice.

bash
# Sender runs again:
$ npx share-env push

# New code generated — share the fresh one:
apple-brave-cloud#<new-64-char-key>
When it occurs

Runs on pull only. The AES-256-GCM authentication tag verification failed during decryption.

Possible causes
  • The share code was truncated — the hex key after # must be exactly 64 characters
  • The share code was modified or corrupted in transit
  • Extra characters were added (e.g., trailing newline or space)
Fix

Ask the sender to push again and share the complete, unmodified share code. Verify the key portion (after #) is exactly 64 hex characters.

bash
# Verify the key portion length:
# apple-brave-cloud#<---- must be exactly 64 hex chars ---->
# a3f9b2c1d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2e3f4a5b6c7d8e9f0a1
#                   |<--- count: 64 characters total --->|
When it occurs

The default relay server enforces a rate limit of 10 requests per minute per IP address.

Possible causes
  • Running push or pull too frequently in a short time window
  • Multiple team members pushing from the same network IP
Fix

Wait 60 seconds and try again, or self-host your own relay server with a higher or no rate limit.

typescript
# Increase rate limit on self-hosted relay:
# In server/src/index.ts:
const RATE_LIMIT_MAX = 50; // default is 10

# Or self-host to bypass shared limit entirely:
$ npx share-env push --server https://your-relay.example.com
Still stuck? Open an issue on GitHub or check the FAQ for more answers about share-env errors and .env file sharing problems.