You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@polaris.apache.org by "Marcus-Rosti (via GitHub)" <gi...@apache.org> on 2025/08/12 03:11:00 UTC

[I] The "initial" bootstrap exit 0 with a warning instead of a raw failure instead of failure if realm already exists [polaris]

Marcus-Rosti opened a new issue, #2324:
URL: https://github.com/apache/polaris/issues/2324

   ### Is your feature request related to a problem? Please describe.
   
   I wanted to script a job in k8s to set up the "admin" realm and credientials and not have to do it manually. However, since it exits 0 on and upgrade, it fails the upgrade...
   
   ### Describe the solution you'd like
   
   _No response_
   
   ### Describe alternatives you've considered
   
   _No response_
   
   ### Additional context
   
   _No response_


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@polaris.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] The "initial" bootstrap exit 0 with a warning instead of a raw failure instead of failure if realm already exists [polaris]

Posted by "snazy (via GitHub)" <gi...@apache.org>.
snazy commented on issue #2324:
URL: https://github.com/apache/polaris/issues/2324#issuecomment-3178119735

   Hi @Marcus-Rosti ,
   
   There are multiple ways to bootstrap a realm. Do you have a sample of the commands you're running? I mean, not the k8s stuff, but the actual command line operations.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] The "initial" bootstrap exit 0 with a warning instead of a raw failure instead of failure if realm already exists [polaris]

Posted by "dimas-b (via GitHub)" <gi...@apache.org>.
dimas-b commented on issue #2324:
URL: https://github.com/apache/polaris/issues/2324#issuecomment-3185544122

   There's an on-going dev ML discussion about bootstrap and schema creation: https://lists.apache.org/thread/9nl0dt6fhqx4t4q55kyzf1v9r2vhl2gg
   
   Making the "schema" part idempotent certainly makes sense.
   
   However, if the tool is also invoked to create the "root" user, failing that in case of user name collision would be valid, IMHO. We can certainly add the `--ignore-existing` option to disambiguate the caller's intent.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] The "initial" bootstrap exit 0 with a warning instead of a raw failure instead of failure if realm already exists [polaris]

Posted by "adutra (via GitHub)" <gi...@apache.org>.
adutra commented on issue #2324:
URL: https://github.com/apache/polaris/issues/2324#issuecomment-3182560878

   FYI I reported an issue a long time ago for this:
   
   https://github.com/apache/polaris/issues/887
   
   I agree that we must provide a flag to achieve "cresate if not exists" semantics.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] The "initial" bootstrap exit 0 with a warning instead of a raw failure instead of failure if realm already exists [polaris]

Posted by "bacek (via GitHub)" <gi...@apache.org>.
bacek commented on issue #2324:
URL: https://github.com/apache/polaris/issues/2324#issuecomment-3182033237

   @snazy I can chime in.
   
   We are using Pulumi for IaaC. To bootstrap polaris we create k8s Job like this:
   ```
           # Bootstrap job. It's idempotent and we can rut it multiple times
           k8s.batch.v1.Job(
               f"{name}-bootstrap",
               metadata=metadata,
               spec=k8s.batch.v1.JobSpecArgs(
                   backoff_limit=1,
                   template=k8s.core.v1.PodTemplateSpecArgs(
                       spec=k8s.core.v1.PodSpecArgs(
                           restart_policy="Never",
                           containers=[
                               k8s.core.v1.ContainerArgs(
                                   name="bootstrap",
                                   image="apache/polaris-admin-tool:1.0.1-incubating-rc0",
                                   args=[
                                       "bootstrap",
                                       "-r",
                                       "POLARIS",
                                       # TODO(bacek) Randomize
                                       "-c",
                                       "POLARIS,client-id,client-secret",
                                   ],
                                   env=[
                                       k8s.core.v1.EnvVarArgs(
                                           name="QUARKUS_DATASOURCE_USERNAME",
                                           value_from=k8s.core.v1.EnvVarSourceArgs(
                                               secret_key_ref=k8s.core.v1.SecretKeySelectorArgs(
                                                   key="username",
                                                   name=db_secret.metadata.name,
                                               )
                                           ),
                                       ),
                                       k8s.core.v1.EnvVarArgs(
                                           name="QUARKUS_DATASOURCE_PASSWORD",
                                           value_from=k8s.core.v1.EnvVarSourceArgs(
                                               secret_key_ref=k8s.core.v1.SecretKeySelectorArgs(
                                                   key="password",
                                                   name=db_secret.metadata.name,
                                               )
                                           ),
                                       ),
                                       k8s.core.v1.EnvVarArgs(
                                           name="QUARKUS_DATASOURCE_JDBC_URL",
                                           value_from=k8s.core.v1.EnvVarSourceArgs(
                                               secret_key_ref=k8s.core.v1.SecretKeySelectorArgs(
                                                   name=db_secret.metadata.name,
                                                   key="jdbcUrl",
                                               )
                                           ),
                                       ),
                                   ],
                               ),
                           ],
                           tolerations=[GENERAL.k8s_tolerations()],
                       )
                   ),
               ),
               opts=self.opts,
           )
   ```
   
   It successfully deployed on the first run. But if job is changed (e.g. image tag changes), it fails
   ```
   2025-08-13 03:07:00,809 ERROR [org.apa.pol.per.rel.jdb.JdbcMetaStoreManagerFactory] (main)                                                     
                                                                                                                                                  
    It appears this metastore manager has already been bootstrapped. To continue bootstrapping, please first purge the metastore with the `purge` 
    command.                                                                                                                                      
                                                                                                                                                  
                                                                                                                                                  
   java.lang.IllegalArgumentException: It appears this metastore manager has already been bootstrapped. To continue bootstrapping, please first p 
   urge the metastore with the `purge` command.                                                                                                   
       at org.apache.polaris.persistence.relational.jdbc.JdbcMetaStoreManagerFactory.bootstrapServiceAndCreatePolarisPrincipalForRealm(JdbcMetaSt 
   oreManagerFactory.java:254)                                                                                                                    
       at org.apache.polaris.persistence.relational.jdbc.JdbcMetaStoreManagerFactory.bootstrapRealms(JdbcMetaStoreManagerFactory.java:148)        
       at org.apache.polaris.persistence.relational.jdbc.JdbcMetaStoreManagerFactory_ClientProxy.bootstrapRealms(Unknown Source)                  
       at org.apache.polaris.admintool.BootstrapCommand.call(BootstrapCommand.java:108)                                                           
       at org.apache.polaris.admintool.BootstrapCommand.call(BootstrapCommand.java:28)                                                            
       at picocli.CommandLine.executeUserObject(CommandLine.java:2031)                                                                            
       at picocli.CommandLine.access$1500(CommandLine.java:148)                                                                                   
       at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2469)                                      
       at picocli.CommandLine$RunLast.handle(CommandLine.java:2461)                                                                               
       at picocli.CommandLine$RunLast.handle(CommandLine.java:2423)                                                                               
       at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2277)                                                           
       at picocli.CommandLine$RunLast.execute(CommandLine.java:2425)                                                                              
       at io.quarkus.picocli.runtime.PicocliRunner$EventExecutionStrategy.execute(PicocliRunner.java:26)                                          
       at picocli.CommandLine.execute(CommandLine.java:2174)                                                                                      
       at io.quarkus.picocli.runtime.PicocliRunner.run(PicocliRunner.java:40)                                                                     
       at io.quarkus.runtime.ApplicationLifecycleManager.run(ApplicationLifecycleManager.java:141)                                                
       at io.quarkus.runtime.Quarkus.run(Quarkus.java:80)                                                                                         
       at io.quarkus.runtime.Quarkus.run(Quarkus.java:51)                                                                                         
       at io.quarkus.runner.GeneratedMain.main(Unknown Source)                                                                                    
       at io.quarkus.bootstrap.runner.QuarkusEntryPoint.doRun(QuarkusEntryPoint.java:68)                                                          
       at io.quarkus.bootstrap.runner.QuarkusEntryPoint.main(QuarkusEntryPoint.java:36)                                                           
   Bootstrap encountered errors during operation.                                                                                                 
   Stream closed EOF for dev-polaris-c1f6613a/dev-polaris-bootstrap-318736f1-nrcl5 (bootstrap)                                                    
                                                                                                                                                  
   ```
   
   Ideal solution is either:
   * Print warning and exit with 0
   * Add flag like `--ignore-existing` to implement "create if not exists" semantics.
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] The "initial" bootstrap exit 0 with a warning instead of a raw failure instead of failure if realm already exists [polaris]

Posted by "snazy (via GitHub)" <gi...@apache.org>.
snazy commented on issue #2324:
URL: https://github.com/apache/polaris/issues/2324#issuecomment-3182608935

   Thanks for the information.
   
   I agree, the current behavior could be improved. Also agree that bootstrap should be idempotent by default, ideally be usable to "fix" a previously failed bootstrap.
   
   For posterity, some implementations can auto-bootstrap (config option `polaris.persistence.auto-bootstrap-type`), which is what I had in mind initially, but I'm not sure whether even the "in-memory" one wouldn't fail with the same error.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org