Ben Chuanlong Du's Blog

It is never too late to learn.

Fix the CrashLoopBackOff Issue of Pod in Kubernetes

Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!

Define command as ["/busybox/sh", "-c", "tail -f /dev/null"] instead of ["/busybox/sh", "-c", "tail", "-f", "/dev/null"]

ModuleNotFoundError: No Module Named _Ctypes in Python 3.7

Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!

Issue

The error message "Modulenotfounderror: No Module Named _Ctypes" is thrown when intalling packages in Python 3.7.

Cause

libffi-dev is needed to cleanly build Python 3.7.

Solution

  1. Remove Python …

Exception and Error Handling in Python

Tips and Traps

  1. If you need trackback information when throwing an exception use raise ExceptionClass(msg), otherwise, use sys.exit(msg) instead.

  2. The assert statement (which raises AssertionError if the assertion is not met) is a very good way to ensure conditions to be met.

     :::python
     assert some_condition

Spark Issue: java.lang.OutOfMemoryError

Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!

Symptom

OutOfMemoryError

Cause

java.lang.OutOfMemoryError is thrown when there is not enough heap memory (for JVM to allocating new objects).

Solution

Increase executor memory.

--executor-memory=20G

Reference:

http://stackoverflow.com …