Originally created by: rhys-phelps-labs
The default admin user is not able to login as the db has no rows in tables.
On startup of server the following error appears:
2024-05-19T13:45:11.300+10:00 DEBUG 26804 --- [ main] c.o.c.s.event.ApplicationEventService : : [registerEventConsumerWithMethod] methodName: runScriptJS description: This consumer will run Javascript that is defined as "SERVER_JS". Consumer is parametrized by the name of script.
2024-05-19T13:45:11.300+10:00 ERROR 26804 --- [ main] c.o.c.s.event.ApplicationEventService : http://localhost:8080/html/audit/all?audit_search=: Could not find event consumer method [com.openkoda.core.customisation.ServerJSRunner, runScriptJS]. Consumer not registered.
2024-05-19T13:45:11.301+10:00 DEBUG 26804 --- [ main] c.o.c.s.event.ApplicationEventService : : [emitEvent] event: com.openkoda.core.service.event.ApplicationEvent@92e53bc1
2024-05-19T13:45:11.309+10:00 DEBUG 26804 --- [ main] c.AuditConfig$SpringSecurityAuditorAware : [getCurrentAuditor]
2024-05-19T13:45:11.479+10:00 DEBUG 26804 --- [ main] c.o.c.s.event.ApplicationEventService : : [registerEventConsumerWithMethod] methodName: modifyRoleForAllUsersInOrganization description: This consumer will run Javascript that is defined in Server-side Js. And modify all users role given by the script. Consumer is parametrized by the name of script.
2024-05-19T13:45:11.480+10:00 INFO 26804 --- [ main] c.o.c.s.event.ApplicationEventService : : Registering Event Consumer class com.openkoda.service.role.RoleModificationsConsumers with method modifyRoleForAllUsersInOrganization for event type interface com.openkoda.dto.OrganizationRelatedObject. This consumer will run Javascript that is defined in Server-side Js. And modify all users role given by the script. Consumer is parametrized by the name of script.
2024-05-19T13:45:11.480+10:00 DEBUG 26804 --- [ main] c.o.c.s.event.ApplicationEventService : : [registerEventListener] eventConsumer: com.openkoda.core.service.event.EventConsumer@1b42e17a
When the login attempt is made on localhost:8080, the following appears in the logs:
2024-05-19T13:45:35.015+10:00 DEBUG 26804 --- [io-8080-exec-10] o.s.security.web.FilterChainProxy : Securing GET /vendor/openkoda/openkoda_icon.png
2024-05-19T13:45:35.017+10:00 DEBUG 26804 --- [io-8080-exec-10] o.s.security.web.FilterChainProxy : Secured GET /vendor/openkoda/openkoda_icon.png
2024-05-19T13:45:35.018+10:00 DEBUG 26804 --- [io-8080-exec-10] c.o.c.helper.ModelEnricherInterceptor : 20240519134535-lvPn9Wjb: [preHandle]
2024-05-19T13:45:35.018+10:00 DEBUG 26804 --- [io-8080-exec-10] o.s.s.w.a.AnonymousAuthenticationFilter : Set SecurityContextHolder to anonymous SecurityContext
2024-05-19T13:45:35.018+10:00 DEBUG 26804 --- [io-8080-exec-10] c.o.c.helper.ModelEnricherInterceptor : 20240519134535-lvPn9Wjb: [preHandle] no user present
2024-05-19T13:45:35.018+10:00 DEBUG 26804 --- [io-8080-exec-10] c.o.c.helper.SlashEndingUrlInterceptor : 20240519134535-lvPn9Wjb: [preHandle]
2024-05-19T13:45:35.019+10:00 DEBUG 26804 --- [io-8080-exec-10] c.o.c.helper.ModelEnricherInterceptor : 20240519134535-lvPn9Wjb: [postHandle]
2024-05-19T13:45:43.178+10:00 DEBUG 26804 --- [nio-8080-exec-1] o.s.security.web.FilterChainProxy : Securing POST /login
2024-05-19T13:45:43.262+10:00 DEBUG 26804 --- [nio-8080-exec-1] c.o.c.s.OrganizationUserDetailsService : 20240519134543-he6X7OiQ: [loadUserByUsername] admin
2024-05-19T13:45:43.320+10:00 DEBUG 26804 --- [nio-8080-exec-1] o.s.s.a.dao.DaoAuthenticationProvider : Failed to find user 'admin'
2024-05-19T13:45:43.374+10:00 DEBUG 26804 --- [nio-8080-exec-1] c.o.c.s.OrganizationUserDetailsService : 20240519134543-he6X7OiQ: [loadUserByUsername] admin
2024-05-19T13:45:43.427+10:00 DEBUG 26804 --- [nio-8080-exec-1] nByPasswordOrTokenAuthenticationProvider : Failed to find user 'admin'
2024-05-19T13:45:43.435+10:00 DEBUG 26804 --- [nio-8080-exec-8] o.s.security.web.FilterChainProxy : Securing GET /login?error
2024-05-19T13:45:43.435+10:00 DEBUG 26804 --- [nio-8080-exec-8] o.s.security.web.FilterChainProxy : Secured GET /login?error
Under schema openkoda, the users table is empty, as are most of the tables.
am looking for advice on how to see what the underlying might be, please.
Originally posted by: arekdrysch
@rhys-phelps-labs
As mentioned in issue title, data initialization requires
drop_and_init_databaseprofile.In some cases the profile may be configured so that it does not trigger the database initialization.
In order to help, please provide the command line used to start the instance, or screenshot of Run configuration (eg. from IntelliJ) to show the way you provide the
drop_and_init_databaseprofile.Cheers,
Arek