apache / apache/pulsar

[Bug] Python function report error `Failed to load the crypto key reader from spec`

Open
#24,782 0 comments 0 reactions 0 assignees View on GitHub
type/bug
Dominant language
Java
Stars
15.3k
Forks
3.8k
Avg merge
1d 14h
Merged PRs (30d)
160

Description

### Search before reporting

- [x] I searched in the [issues](https://github.com/apache/pulsar/issues) and found nothing similar.

### Read release policy

- [x] I understand that [unsupported versions](https://pulsar.apache.org/contribute/release-policy/#supported-versions) don't get bug fixes. I will attempt to reproduce the issue on a supported version of Pulsar client and Pulsar broker.

### User environment

broker version: 1b74fe0

### Issue Description

when running a python function without specify the `crypto_spec.cryptoKeyReaderConfig`, it runs well but will reports an error log:

```
[2025-09-25 07:26:59 +0000] [ERROR] python_instance.py: Failed to load the crypto key reader from spec: , error: Expecting value: line 1 column 1 (char 0)

```

### Error messages

```text
[2025-09-25 07:26:59 +0000] [ERROR] python_instance.py: Failed to load the crypto key reader from spec: , error: Expecting value: line 1 column 1 (char 0)
```

### Reproducing the issue

1. start the pulsar standalone
2. create a python function:

```
pulsar-admin functions craete --py pulsar-functions/python-examples/exclamation_function.py --name package-python-fn --classname exclamation_function.ExclamationFunction --inputs persistent://public/default/package-py-fn-input --output persistent://public/default/package-py-fn-output
```

3. check the function logs

### Additional information

_No response_

### Are you willing to submit a PR?

- [x] I'm willing to submit a PR!

Contributor guide

Open the contributing guide

Research direction

Reproduce the issue with the standalone broker and the Python function command using pulsar-functions/python-examples/exclamation_function.py, then inspect the logging path identified as python_instance.py. Done means running without crypto_spec.cryptoKeyReaderConfig still works and no erroneous crypto key reader error is logged.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
distributed-systems
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.