I was facing a similar issue while updating the partition using Spark. For me, It was fixed by setting the correct hive.metastore.uris in spark configs.
hive.metastore.uris