Login Fails after DB change

94 views
Skip to first unread message

Joe Kirchner

unread,
Dec 21, 2019, 9:39:18 AM12/21/19
to manydesigns-portofino
Hi 

I have successfully built an application with about 30 tables. I love it, but can never tweak it without rebuilding the entire application.

When I do any of the following, I usually am locked out. I receive the Login failed for user  error.
  • add a field to a table
  • change the character varying field length
  • run the wizard a second time after the initial wizard run
Please note that when I add a field to a table or I change the field length, I make the corresponding change to my_table.table.xml, where "my_table" refers to the table name in my Postgresql DB. I then reboot the server and clear the browser cache. I have even tried restoring the table to its original condition along with restoring my_table.table.xml to its original condition, rebooting, and clearing the cache again. I still cannot log in. Almost always I have to rebuild the entire application, starting from unzipping the portofino download file.

On rare occasions, I can log back in. This may be when I reload the model or groovy from the administration pages prior to logging out.

When this happens, I still cannot fully restore the application. The last time this happened the crud page for the table that I added a field  to could not be restored. No matter what I did, I received the "not configured correctly" error, even though I made sure that it was configured exactly like other working crud pages. I even tried deleting and rebuilding the page. After spending several days, literally, trying different things to restore my site, it becomes completely unusable and I have to rebuild from scratch. Unfortunately, when I did that I left the field length of my new field at 200 when it should have been 1 because it is a Y/N field. That is when I changed the field size as described above and continue to be locked out of the application.

My configuration is as follows:
  • Debian 9
  • Postgresql 9.6.15
  • Portofino 4.2.8
I looked in the catalina.out log. There may be some relevant lines in the catalina.out tail shown below. I think the key line is the one that includes, "No setup exists for database: mydatabase." I cannot understand why changing a field size on one of my database tables would cause the setup for mydatabase to disappear.

I also looked through Security.groovy, but could not find any hints to the problem. Speaking of which, I am confused by the admonition to edit the Security.groovy to eliminate the original default login of admin / admin. The wizard seems to take care of that. Should I still be editing the Security.groovy after the wizard runs the first time?

2019-12-21 13:00:16,086 WARN  c.m.portofino.actions.user.LoginAction    /login;jsessionid=xxxIDxxx Login failed for 'myUserName': Authentication failed for token submission [org.apache.shiro.authc.UsernamePasswordToken - myUserName, rememberMe=false].  Possible unexpected error? (Typical or expected login exceptions should extend from AuthenticationException).
org.apache.shiro.authc.AuthenticationException: Authentication failed for token submission [org.apache.shiro.authc.UsernamePasswordToken - myUserName, rememberMe=false].  Possible unexpected error? (Typical or expected login exceptions should extend from AuthenticationException).
at org.apache.shiro.authc.AbstractAuthenticator.authenticate(AbstractAuthenticator.java:214)
at org.apache.shiro.mgt.AuthenticatingSecurityManager.authenticate(AuthenticatingSecurityManager.java:106)
at org.apache.shiro.mgt.DefaultSecurityManager.login(DefaultSecurityManager.java:275)
at org.apache.shiro.subject.support.DelegatingSubject.login(DelegatingSubject.java:260)
at com.manydesigns.portofino.actions.user.LoginAction.login(LoginAction.java:156)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at net.sourceforge.stripes.controller.DispatcherHelper$6.intercept(DispatcherHelper.java:456)
at net.sourceforge.stripes.controller.ExecutionContext.proceed(ExecutionContext.java:176)
at com.manydesigns.portofino.interceptors.GuardsInterceptor.intercept(GuardsInterceptor.java:60)
at net.sourceforge.stripes.controller.ExecutionContext.proceed(ExecutionContext.java:173)
at net.sourceforge.stripes.controller.BeforeAfterMethodInterceptor.intercept(BeforeAfterMethodInterceptor.java:113)
at net.sourceforge.stripes.controller.ExecutionContext.proceed(ExecutionContext.java:173)
at net.sourceforge.stripes.controller.ExecutionContext.wrap(ExecutionContext.java:86)
at net.sourceforge.stripes.controller.DispatcherHelper.invokeEventHandler(DispatcherHelper.java:454)
at net.sourceforge.stripes.controller.DispatcherServlet.invokeEventHandler(DispatcherServlet.java:278)
at net.sourceforge.stripes.controller.DispatcherServlet.service(DispatcherServlet.java:160)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
at com.manydesigns.portofino.stripes.SimpleDynamicMappingFilter.doFilter(SimpleDynamicMappingFilter.java:60)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at com.manydesigns.portofino.servlets.I18nFilter.doFilter(I18nFilter.java:60)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at net.sourceforge.stripes.controller.StripesFilter.doFilter(StripesFilter.java:260)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at com.manydesigns.portofino.servlets.CleanupFilter.doFilter(CleanupFilter.java:46)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at com.manydesigns.portofino.servlets.DispatcherFilter.doFilter(DispatcherFilter.java:61)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:449)
at org.apache.shiro.web.servlet.AbstractShiroFilter$1.call(AbstractShiroFilter.java:365)
at org.apache.shiro.subject.support.SubjectCallable.doCall(SubjectCallable.java:90)
at org.apache.shiro.subject.support.SubjectCallable.call(SubjectCallable.java:83)
at org.apache.shiro.subject.support.DelegatingSubject.execute(DelegatingSubject.java:387)
at org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:362)
at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at com.manydesigns.elements.servlet.ElementsFilter.doHttpFilter(ElementsFilter.java:132)
at com.manydesigns.elements.servlet.ElementsFilter.doFilter(ElementsFilter.java:83)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:528)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:678)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:798)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:810)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1500)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.Error: No setup exists for database: mydatabase
at com.manydesigns.portofino.persistence.Persistence.ensureDatabaseSetup(Persistence.java:382)
at com.manydesigns.portofino.persistence.Persistence.getSession(Persistence.java:376)
at com.manydesigns.portofino.persistence.Persistence$getSession.call(Unknown Source)
at Security.loadAuthenticationInfo(Security.groovy:139)
at Security$loadAuthenticationInfo.callCurrent(Unknown Source)
at Security.doGetAuthenticationInfo(Security.groovy:114)
at org.apache.shiro.realm.AuthenticatingRealm.getAuthenticationInfo(AuthenticatingRealm.java:571)
at com.manydesigns.portofino.shiro.SecurityGroovyRealm.getAuthenticationInfo(SecurityGroovyRealm.java:228)
at org.apache.shiro.authc.pam.ModularRealmAuthenticator.doSingleRealmAuthentication(ModularRealmAuthenticator.java:180)
at org.apache.shiro.authc.pam.ModularRealmAuthenticator.doAuthenticate(ModularRealmAuthenticator.java:267)
at org.apache.shiro.authc.AbstractAuthenticator.authenticate(AbstractAuthenticator.java:198)
... 64 common frames omitted

By the way, I find these types of problems are just as bad when using Portofino 5 and prefer Level 4 because of its completeness, including the ability to write new pages.

Thanks in advance for your assistance.

Joe

Alessio Stalla

unread,
Dec 22, 2019, 4:31:30 AM12/22/19
to manydesign...@googlegroups.com
Hi Joe,

it's unfortunate to hear that. "No setup exists for database..." is the consequence of something failing earlier on; perhaps a connection problem. You should try to find the very first exception after you change the model in a way that breaks your application.
Have you tried only version 4.2.8 and 5.1? Version 4.2.9 is coming out real soon and it fixes a couple of problems with the wizard, so that may be worth trying.

Regarding Portofino 5, we know there's still a lot of work to be done; lately, we've been focusing more on the internals, with Hibernate 5 and native support for Docker deployments, and the UI has received little love. But if you have particular showstoppers that prevent you from using Portofino 5, please let me know, as we can prioritize those.
Anyway, it's entirely possible to write new page types in Portofino 5, but you have to know Angular.

--
You received this message because you are subscribed to the Google Groups "manydesigns-portofino" group.
To unsubscribe from this group and stop receiving emails from it, send an email to manydesigns-port...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/manydesigns-portofino/06a12d85-dd8b-4f22-8209-3f6ca99fce17%40googlegroups.com.

Joe Kirchner

unread,
Dec 22, 2019, 12:45:06 PM12/22/19
to manydesigns-portofino
Hi Alessio

Thanks for your quick reply.

Found a Solution

Your suggestion sparked a brilliant idea. I searched (grep) some backed up versions of portofino 4.2.8 for the connection string. I then compared (diff) that file to the same file in the recently damaged application. What did I discover?

Lines 59 - 61 in portofino.properties from the recently damaged application were missing. Otherwise, the files were identical. What caused these lines to disappear, I have no idea. However, once restored, I was able to log into my application.

I tried to replicate the error but was unable to. It is likely that it will reoccur as I continue to tweak my database tables. When this happens I will immediately tail the catalina.out log for hints to help you debug.

Version 5 Feedback

My hesitation on using version 5 started when I was experiencing similar instability. My thought was to go to the latest version of 4 (which was 4.2.8) for production figuring it was more stable. There I saw that the interface was so much more robust with features like create new page. So, I stuck with it.

You asked for my showstoppers on using version 5. These would be the easy menu driven page create and easy menu driven move / delete pages. (I can't remember if the latter is in 5 or not, so if it is, then it is just the create page).

Perhaps it would be useful for you to understand what kind of a user I am. First, I love portofino. I have searched extensively and cannot find anything that comes close to it in features. The showstoppers on using anything else are 1) I rule out anything that is not open source, and 2) I need something that can handle complex relational table structure, e.g., inter-related adult-child-grandchild, one-to-many and many-to-many relations. This I can only do with portofino. Thank you.

Second, I am not a professional programmer. I am an economist and my programming proficiency is limited to statistical analysis packages such as R and SPSS, as well as, decent proficiency in SQL. That said, I understand the logic of programming, so I can hack some existing code in other languages to make a few tweaks. Hence, I can adjust the XML files to match the field length change that I made in postgresql, can grep text-based files to find the origin of the missing connection string and can tweak the query and script on the configure (crud) page. Note, I have to replace ".id" with ".users" on all my-xxx pages.

One of the things that makes portofino so powerful is the multitude of tools / languages that you use ... maven, hibernate, groovy, now angular and many others. This also makes it difficult for mere mortals, like myself, to get into the internals. So, for someone like myself, version 4 has the right balance of this power and quick and easy tools to modify and configure a fairly sophisticated application, albeit, perhaps without all of the bells and whistles. Version 4 works for my production needs, but of course, I look forward to version 5 once the quick and easy tools are built out.

Thanks so much for the hard work that you and your team are doing!

Cheers,

Joe

Alessio Stalla

unread,
Dec 22, 2019, 1:27:10 PM12/22/19
to manydesign...@googlegroups.com
Hey Joe,

thanks for the detailed explanation. Actually, you can create new pages, move and delete pages with the UI in Portofino 5 as well, but the interface is less polished and less friendly (e.g., it doesn't yet show a tree of pages where you might want to move).
Knowing Angular is only necessary to write new types of pages that you can reuse. I thought you were referring to that.

That said, at the moment Portofino 4 is still the most widely used version, and it's more stable because it's been used so much more. We're trying to move existing projects to Portofino 5, but it will take time before it's as battle-proven as Portofino 4. That's why we sometimes port some stuff back to Portofino 4 when it's possible to do so, and we continue to issue new releases on the 4.2.x branch. But it's unlikely that Portofino 4 will see any significant new features.

Documentation is another big effort that I'd like to spend time on, but resources are limited :(

--
You received this message because you are subscribed to the Google Groups "manydesigns-portofino" group.
To unsubscribe from this group and stop receiving emails from it, send an email to manydesigns-port...@googlegroups.com.

Joe Kirchner

unread,
Dec 22, 2019, 2:00:58 PM12/22/19
to manydesigns-portofino
Hi Alessio,

I have made several database tweaks like changing the length of a field and adding a field to a table. I mirrored these in the corresponding XML tables. I experienced no problems and everything went as expected.

Then I reran the wizard. At the end it logs you out. When I went to log in, I was logged out. I checked portofino.properties, but it was normal, no missing lines.

So, I tried a quick reboot of the server and everything was right again with the world. I was able to log in again.

I hope that helps.

I will continue to provide feedback when I encounter issues. Is it best to provide that here or would you prefer another channel of communication?

Joe

On Saturday, December 21, 2019 at 9:39:18 AM UTC-5, Joe Kirchner wrote:

Joe Kirchner

unread,
Dec 22, 2019, 2:24:31 PM12/22/19
to manydesigns-portofino
Hi Alessio,

Your reply came as I was typing my last reply. Speaking of which, there is a typo. I meant to say that after running the wizard, I was loCKed out - I could not log in. That was fixed by the reboot.

I would like to make a commitment to the project by providing feedback as I have suggested in previous posts. However, it occurred to me that feedback on version 5 may be more use to you. Of course, I could realistically do that only if 5 is stable enough for production - regardless of the awkward UI. And I would have to figure out how to create text and crud pages without the wizard. So, a few questions ...
  • Is it more useful to you to receive feedback on 5?
  • In your estimation, is 5 stable enough for production (small business - 2 users once a month plus 1 user, using it weekly)?
  • What is the best way to (or channel) to provide feedback?
  • Would it be useful if I could occasionally draft some documentation? If so, how would you want me to do that?
  • Can you give me a few pointers on how to set up new pages in 5? I am interested in building text pages under which I will move several crud pages; and building crud pages as an alternative to using the wizard.
Cheers,

Joe

On Saturday, December 21, 2019 at 9:39:18 AM UTC-5, Joe Kirchner wrote:

Alessio Stalla

unread,
Dec 26, 2019, 5:34:03 AM12/26/19
to manydesign...@googlegroups.com
Hi Joe, my reply is inline.

On Sun, 22 Dec 2019 at 20:24, Joe Kirchner <joe.ki...@cooperativeventure.net> wrote:
Hi Alessio,

Your reply came as I was typing my last reply. Speaking of which, there is a typo. I meant to say that after running the wizard, I was loCKed out - I could not log in. That was fixed by the reboot.

It would be useful if you managed to reproduce this and send logs (even privately if they might contain sensitive information).
 
I would like to make a commitment to the project by providing feedback as I have suggested in previous posts.

Thanks!
 
However, it occurred to me that feedback on version 5 may be more use to you. Of course, I could realistically do that only if 5 is stable enough for production - regardless of the awkward UI. And I would have to figure out how to create text and crud pages without the wizard. So, a few questions ...
  • Is it more useful to you to receive feedback on 5?
Yes, all feedback is useful, but 5 is where we're spending almost all the effort.
  • In your estimation, is 5 stable enough for production (small business - 2 users once a month plus 1 user, using it weekly)?
 I'd wait for 5.1.1 which is set to be released in the first half of January. 5.1.0 is stable, it won't corrupt your data, but it has a few bugs and oversights that can be frustrating in certain scenarios.
  • What is the best way to (or channel) to provide feedback?
If it's a specific issue or bug, the GitHub issues page is best: https://github.com/ManyDesigns/Portofino/issues
Otherwise, here on the mailing list/Google Group is perfectly fine.
  • Would it be useful if I could occasionally draft some documentation? If so, how would you want me to do that?
That would be awesome! If the idea is to incorporate it in Portofino's own documentation, then the Markdown format is the best choice as it's natively supported by the GitHub wiki. If, instead, you're thinking about hosting some community-made documentation by yourself, then whatever suits you: blog posts, wiki articles, YouTube videos, ...
  • Can you give me a few pointers on how to set up new pages in 5? I am interested in building text pages under which I will move several crud pages; and building crud pages as an alternative to using the wizard.
Text pages are not yet supported on version 5. We targeted developers first, who can quickly code their own simple text pages in Angular, or often use a completely custom-made UI with different technologies such as React. But those shouldn't be hard to add to Portofino 5.1.1.
That said, I've made a video that shows how to add a page, I'm attaching it to this message.

Cheers,
Alessio
 
--
You received this message because you are subscribed to the Google Groups "manydesigns-portofino" group.
To unsubscribe from this group and stop receiving emails from it, send an email to manydesigns-port...@googlegroups.com.
p5 - how to add a page.mkv

Alessio Stalla

unread,
Jan 14, 2020, 11:07:38 AM1/14/20
to manydesign...@googlegroups.com
Hey Joe,

how are you doing? This is just a quick follow up to signal that Portofino 5.1.1 has been released and it has text pages :)

Cheers,
Alessio
Reply all
Reply to author
Forward
0 new messages