Skip to content

Polaris Quick Start for local development throws errors when creating a catalog #1351

@Tmonster

Description

@Tmonster

Describe the bug

I'm following the Polaris Quickstart steps on MacOS M3 Sonoma v14.4 and have observed errors when attempting to create a catalog. Specifically

2025-04-10 17:23:51,380 ERROR [org.apa.pol.ser.exc.IcebergExceptionMapper] [,POLARIS] [,,,] (executor-thread-1) Unhandled exception returning INTERNAL_SERVER_ERROR: java.lang.NullPointerException: Cannot invoke "org.apache.polaris.core.persistence.dao.entity.PrincipalSecretsResult.getPrincipalSecrets()" because "principalSecrets" is null

To Reproduce

git clone https://github.com/apache/polaris.git
cd ~/polaris
brew install openjdk@21 jenv
jenv add $(brew --prefix openjdk@21)
jenv local 21
./gradlew \
  :polaris-quarkus-server:assemble \
  :polaris-quarkus-server:quarkusAppPartsBuild --rerun
# Start the server
java -jar quarkus/server/build/quarkus-app/quarkus-run.jar

I got these commands from the Quick Start guide

I see the credentials output realm: POLARIS root principal credentials: {root_id}:{password} and then use them to run the following command

./polaris \
  --client-id ${POLARIS_ROOT_ID} \
  --client-secret ${POLARIS_ROOT_SECRET} \
  catalogs \
  create \
  --storage-type FILE \
  --default-base-location file://${PWD}/storage_files \
  quickstart_catalog

Expected Behavior

The quickstart_catalog is created without errors

Actual Behavior

The create catalogs command fails with the following error

Traceback (most recent call last):
  File "/Users/tomebergen/duckdb-iceberg/polaris_catalog/client/python/cli/polaris_cli.py", line 164, in <module>
    PolarisCli.execute()
    ~~~~~~~~~~~~~~~~~~^^
  File "/Users/tomebergen/duckdb-iceberg/polaris_catalog/client/python/cli/polaris_cli.py", line 57, in execute
    client_builder = PolarisCli._get_client_builder(options)
  File "/Users/tomebergen/duckdb-iceberg/polaris_catalog/client/python/cli/polaris_cli.py", line 155, in _get_client_builder
    token = PolarisCli._get_token(ApiClient(config), polaris_catalog_url, client_id, client_secret)
  File "/Users/tomebergen/duckdb-iceberg/polaris_catalog/client/python/cli/polaris_cli.py", line 102, in _get_token
    raise Exception('Failed to get access token')
Exception: Failed to get access token

And the server logs contain the following error

2025-04-10 17:31:09,863 ERROR [org.apa.pol.ser.exc.IcebergExceptionMapper] [,POLARIS] [,,,] (executor-thread-1) Unhandled exception returning INTERNAL_SERVER_ERROR: java.lang.NullPointerException: Cannot invoke "org.apache.polaris.core.persistence.dao.entity.PrincipalSecretsResult.getPrincipalSecrets()" because "principalSecrets" is null
	at org.apache.polaris.service.persistence.InMemoryPolarisMetaStoreManagerFactory.bootstrapRealms(InMemoryPolarisMetaStoreManagerFactory.java:121)
	at org.apache.polaris.service.persistence.InMemoryPolarisMetaStoreManagerFactory.bootstrapRealmsAndPrintCredentials(InMemoryPolarisMetaStoreManagerFactory.java:99)
	at org.apache.polaris.service.persistence.InMemoryPolarisMetaStoreManagerFactory.getOrCreateMetaStoreManager(InMemoryPolarisMetaStoreManagerFactory.java:82)
	at org.apache.polaris.service.persistence.InMemoryPolarisMetaStoreManagerFactory_ClientProxy.getOrCreateMetaStoreManager(Unknown Source)
	at org.apache.polaris.service.auth.JWTRSAKeyPairFactory.apply(JWTRSAKeyPairFactory.java:54)
	at org.apache.polaris.service.auth.JWTRSAKeyPairFactory.apply(JWTRSAKeyPairFactory.java:33)
	at org.apache.polaris.service.auth.JWTRSAKeyPairFactory_ClientProxy.apply(Unknown Source)
	at org.apache.polaris.service.auth.DefaultOAuth2ApiService.getToken(DefaultOAuth2ApiService.java:73)
	at org.apache.polaris.service.auth.DefaultOAuth2ApiService_ClientProxy.getToken(Unknown Source)
	at org.apache.polaris.service.catalog.api.IcebergRestOAuth2Api.getToken(IcebergRestOAuth2Api.java:113)
	at org.apache.polaris.service.catalog.api.IcebergRestOAuth2Api_Subclass.getToken$$superforward(Unknown Source)
	at org.apache.polaris.service.catalog.api.IcebergRestOAuth2Api_Subclass$$function$$1.apply(Unknown Source)
	at io.quarkus.arc.impl.AroundInvokeInvocationContext.proceed(AroundInvokeInvocationContext.java:73)
	at io.quarkus.arc.impl.AroundInvokeInvocationContext.proceed(AroundInvokeInvocationContext.java:62)
	at io.quarkus.micrometer.runtime.MicrometerTimedInterceptor.timedMethod(MicrometerTimedInterceptor.java:79)
	at io.quarkus.micrometer.runtime.MicrometerTimedInterceptor_Bean.intercept(Unknown Source)
	at io.quarkus.arc.impl.InterceptorInvocation.invoke(InterceptorInvocation.java:42)
	at io.quarkus.arc.impl.AroundInvokeInvocationContext.perform(AroundInvokeInvocationContext.java:30)
	at io.quarkus.arc.impl.InvocationContexts.performAroundInvoke(InvocationContexts.java:27)
	at org.apache.polaris.service.catalog.api.IcebergRestOAuth2Api_Subclass.getToken(Unknown Source)
	at org.apache.polaris.service.catalog.api.IcebergRestOAuth2Api$quarkusrestinvoker$getToken_f6dd65d68bbb7be8bc087c1c82d2d2a56984933f.invoke(Unknown Source)
	at org.jboss.resteasy.reactive.server.handlers.InvocationHandler.handle(InvocationHandler.java:29)
	at io.quarkus.resteasy.reactive.server.runtime.QuarkusResteasyReactiveRequestContext.invokeHandler(QuarkusResteasyReactiveRequestContext.java:141)
	at org.jboss.resteasy.reactive.common.core.AbstractResteasyReactiveContext.run(AbstractResteasyReactiveContext.java:147)
	at io.quarkus.vertx.core.runtime.VertxCoreRecorder$15.runWith(VertxCoreRecorder.java:638)
	at org.jboss.threads.EnhancedQueueExecutor$Task.doRunWith(EnhancedQueueExecutor.java:2675)
	at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2654)
	at org.jboss.threads.EnhancedQueueExecutor.runThreadBody(EnhancedQueueExecutor.java:1627)
	at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1594)
	at org.jboss.threads.DelegatingRunnable.run(DelegatingRunnable.java:11)
	at org.jboss.threads.ThreadLocalResettingRunnable.run(ThreadLocalResettingRunnable.java:11)
	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
	at java.base/java.lang.Thread.run(Thread.java:1583)

2025-04-10 17:31:09,863 INFO  [io.qua.htt.access-log] [,POLARIS] [,,,] (executor-thread-1) 0:0:0:0:0:0:0:1 - - [10/Apr/2025:17:31:09 +0200] "POST /api/catalog/v1/oauth/tokens HTTP/1.1" 500 211

Additional context

A recent commit has this working 53eb36de9d892c9cc0ef4d2f02f6594446e28413 (merged April 6), so this has been a recent break

System information

OS: macOS Sonoma v14.4
Polaris Catalog Version: Dev
Storage: File

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions