Running pks tasks command fails with "Error: An error occurred in the PKS API when processing"
search cancel

Running pks tasks command fails with "Error: An error occurred in the PKS API when processing"

book

Article ID: 345544

calendar_today

Updated On:

Products

VMware

Issue/Introduction

Symptoms:

·         When you run pks tasks command in PKS 1.7.0, it fails with an error similar to:
Error: An error occurred in the PKS API when processing

·         In pks-api.log, you see entries similar to:
2020-04-03 17:41:22.522 ERROR 17598 --- [nio-9021-exec-9] o.a.c.c.C.[.[.[/].[dispatcherServlet]    : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is java.lang.NullPointerException] with root cause
java.lang.NullPointerException: null
at io.pivotal.pks.upgrade.UpgradeTaskService.lambda$listTaskInfos$10(UpgradeTaskService.java:294) ~[classes!/:na]
at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195) ~[na:na]
at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1654) ~[na:na]
at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484) ~[na:na]
 at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474) ~[na:na]
 at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:913) ~[na:na]
at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[na:na]
at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:578) ~[na:na]...


Environment

VMware PKS 1.x

Cause

If you’ve upgraded your clusters from 1.6.x to 1.7.0 tile, after that, you tried to upgrade all your k8s clusters, when you run pks tasks command, it will fail with nullPointerException: An error occurred in the PKS API when processing

If PKS is upgraded to 1.7.0 and if there were tasks still logged in the pks-api database from 1.6,  the pks tasks command will not work in 1.7.0 due to the introduction of new columns, of which the old records will have null values.

We introduced date columns in 1.7.0 that will have null values for existing rows in that table from 1.6. Our query to list the tasks does not take this into account.

 

Resolution

This is a known issue in VMware Enterprise PKS 1.7.0, it will fixed in future versions.