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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to