Ben Chuanlong Du's Blog

It is never too late to learn.

Spark Issue: GetQuotaUsage

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

Symptom I

py4j.protocol.Py4JJavaError: An error occurred while calling o156.getQuotaUsage.

Symptom II

org.apache.hadoop.ipc.RemoteException(java.io.IOException): The quota system is disabled in Router.

Possible Causes …

Spark Issue: Pure Python Code Errors

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

This post collects some typical pure Python errors in PySpark applications.

Symptom 1

object has no attribute

Solution 1

Fix the attribute name.

Symptom 2

No such file or directory

Solution …

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

Ensure Capturing Log of Applications

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

Logging is critical for debugging applications. For production applications, it is best to send log information into a file instead of the standard output so that the log information is persisted …