remotion-dev/remotion · error · RemotionInvalidArgumentException
'access_key' must be provided when 'secret_key' is specified
Error message
'access_key' must be provided when 'secret_key' is specified
What it means
Raised (with a deprecation warning) when the caller provides secret_key but no access_key to the Python RemotionClient. Mirror of the access_key-without-secret_key guard, fired by `if secret_key and not access_key`.
Source
Thrown at packages/lambda-python/remotion_lambda/remotionclient.py:194
raise RemotionInvalidArgumentException(
"Cannot specify both 'session' and explicit credentials "
"('access_key'/'secret_key'). Please use only 'session'."
)
# Handle deprecated credential parameters
if access_key is not None or secret_key is not None:
warnings.warn(
"Parameters 'access_key' and 'secret_key' are deprecated "
"as of version 4.0.376 and will be removed in version 5.0.0. "
"Please migrate to using 'session' for improved security. ",
DeprecationWarning,
stacklevel=2,
)
# Validate both keys are provided together
if access_key and not secret_key:
raise RemotionInvalidArgumentException("'secret_key' must be provided when 'access_key' is specified")
if secret_key and not access_key:
raise RemotionInvalidArgumentException("'access_key' must be provided when 'secret_key' is specified")
# Create session from deprecated credentials
self.session = Session(
aws_access_key_id=access_key,
aws_secret_access_key=secret_key,
region_name=region,
)
elif session:
# Use provided session
self.session = session
else:
# Create default session (uses credential chain)
self.session = Session(region_name=region)
# Store configuration
self.region = region.strip()
self.serve_url = serve_url.strip().rstrip('/')
self.function_name = function_name.strip()View on GitHub (pinned to 78fe4bb3fd)
Solutions
- Provide BOTH access_key and secret_key, or migrate to a boto3 Session (preferred).
- Confirm both AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY are present in the environment before launch.
- Use `aws configure list` to verify the active profile has both credentials.
Example fix
// before
client = RemotionClient(
region=region,
serve_url=serve_url,
function_name=fn,
secret_key=os.environ['AWS_SECRET_ACCESS_KEY'],
)
# after
session = boto3.Session(profile_name='remotion')
client = RemotionClient(
region=region,
serve_url=serve_url,
function_name=fn,
session=session,
) Defensive patterns
Strategy: validation
Validate before calling
def validate_paired_credentials(access_key, secret_key):
if secret_key and not access_key:
raise ValueError('secret_key provided without access_key')
return True Type guard
def credentials_are_paired(access_key, secret_key) -> bool:\n return bool(access_key) == bool(secret_key)
Try / catch
try:\n client = RemotionClient(region=region, serve_url=serve_url, function_name=fn,\n access_key=ak, secret_key=sk)\nexcept RemotionInvalidArgumentException as e:\n raise SystemExit(f'Credentials incomplete: {e}') Prevention
- Always pass access_key and secret_key together or neither.
- Prefer boto3.Session from an AWS profile over raw credentials.
- Verify with `aws configure list` that the profile has both credentials.
When it happens
Trigger: Calling RemotionClient(secret_key='...', access_key=None); passing only the secret half of the credential pair.
Common situations: Env var AWS_ACCESS_KEY_ID unset while AWS_SECRET_ACCESS_KEY is set; only the secret was copied from the AWS console; using a partial credential export script.
Related errors
- 'secret_key' must be provided when 'access_key' is specified
- Cannot specify both 'session' and explicit credentials ('acc
- type of startFrom prop must be a number, instead got type ${
- startFrom prop can not be NaN or Infinity.
- startFrom must be greater than equal to 0 instead got ${star
AI-assisted analysis of remotion-dev/remotion@78fe4bb3fd (2026-08-12).
Data as JSON: /api/errors/a257c048ed554309.
Report an issue: GitHub.