- Newest
- Most votes
- Most comments
The issue you're experiencing with AWS Glue 5.0 and the "Fontconfig head is null" error is likely related to font configuration in the Glue environment. This error typically occurs when the Java runtime cannot find or access the necessary font files.
Since you don't have direct control over the Glue image packages, passing Java parameters like -Djava.awt.headless=true can be challenging. However, there are a few approaches you can try to work around this issue:
-
Use Glue job parameters: Instead of setting Spark configurations directly, try passing the Java option as a Glue job parameter. You can do this by adding
--conf spark.executor.extraJavaOptions=-Djava.awt.headless=trueto your job parameters. -
Set Spark configuration in your script: At the beginning of your Glue script, try setting the Spark configuration programmatically:
from pyspark.conf import SparkConf conf = SparkConf() conf.set("spark.executor.extraJavaOptions", "-Djava.awt.headless=true") sc._jsc.sc().setConf(conf) -
Use a custom JAR: If possible, create a custom JAR that includes the necessary font files and add it to your Glue job's dependent JARs.
-
Downgrade spark-excel: Consider using an earlier version of spark-excel that is compatible with Glue 5.0 and doesn't trigger this font issue.
-
Alternative output format: If feasible for your use case, consider outputting to a different format (e.g., CSV) and then converting to Excel in a separate step.
If none of these solutions work, you may need to contact AWS support for further assistance, as they might be able to provide more specific guidance or a patch for this issue in the Glue 5.0 environment.
Remember to thoroughly test any changes in a non-production environment before applying them to your production jobs.
Sources
Upgrading from AWS Glue 4.0 to 5.0: PROXY Error and GlueBootstrap Bootstrapping Failure | AWS re:Post
Glue job failing with "Unknown time-zone ID: GMT000" error | AWS re:Post
answered 2 years ago
Relevant content
asked 4 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated a year ago

We have tried them but no luck.