apache/kafka · warning · ValueError
This field cannot be empty
Error message
This field cannot be empty
What it means
docker/common.py:get_input wraps the builtin input() prompt and rejects empty strings with ValueError('This field cannot be empty'). It is used by the interactive docker release scripts to require a non-empty answer (e.g. image tag, archive path).
Solutions
- Provide a non-empty value at the prompt.
- If running non-interactively, pipe values in: `echo "value" | python3 docker/...`.
- Read the script to learn what each prompt expects (image tag, kafka archive URL, etc.) before running.
Example fix
# before $ python3 docker/docker_release.py Enter kafka url: <Enter> -> ValueError: This field cannot be empty # after $ python3 docker/docker_release.py Enter kafka url: https://archive.apache.org/dist/kafka/3.7.0/kafka_2.13-3.7.0.tgz
Defensive patterns
Strategy: validation
Validate before calling
value = input(message).strip()
if not value:
raise ValueError("This field cannot be empty")
return value Type guard
null
Try / catch
while True:
try:
return get_input(message)
except ValueError:
print("please enter a value") Prevention
- Have the expected values (image tag, kafka archive URL) ready before running the script.
- Run interactively, not with empty stdin.
When it happens
Trigger: Running one of the docker release scripts interactively and pressing Enter at a prompt without typing a value.
Common situations: Operator skips a prompt they did not understand; copy-paste into the terminal dropped the value; running the script non-interactively where stdin is empty.
Related errors
- Docker Image Build failed
- Docker image push failed
- Failure in executing following command:-
- Unexpected contents in the artifact. Exactly one version…
- Didn't find any issues for version
AI-assisted analysis of apache/kafka@996fb4585a (2026-08-11).
Data as JSON: /api/errors/8d2f192b17204937.
Report an issue: GitHub.
Appendix: source
Thrown at docker/common.py:30
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import subprocess
import tempfile
import os
import shutil
def execute(command):
if subprocess.run(command).returncode != 0:
raise SystemError("Failure in executing following command:- ", " ".join(command))
def get_input(message):
value = input(message)
if value == "":
raise ValueError("This field cannot be empty")
return value
def build_docker_image_runner(command, image_type, kafka_archive=None):
temp_dir_path = tempfile.mkdtemp()
current_dir = os.path.dirname(os.path.realpath(__file__))
shutil.copytree(f"{current_dir}/{image_type}", f"{temp_dir_path}/{image_type}", dirs_exist_ok=True)
shutil.copytree(f"{current_dir}/resources", f"{temp_dir_path}/{image_type}/resources", dirs_exist_ok=True)
shutil.copy(f"{current_dir}/server.properties", f"{temp_dir_path}/{image_type}")
if kafka_archive:
shutil.copy(kafka_archive, f"{temp_dir_path}/{image_type}/kafka.tgz")
command = command.replace("$DOCKER_FILE", f"{temp_dir_path}/{image_type}/Dockerfile")
command = command.replace("$DOCKER_DIR", f"{temp_dir_path}/{image_type}")
try:
execute(command.split())
except:
raise SystemError("Docker Image Build failed")
finally:
shutil.rmtree(temp_dir_path)View on GitHub (pinned to 996fb4585a)