Dates causing login failure

Skip to first unread message

Joe Kirchner

Sep 16, 2021, 10:10:18 PM9/16/21
to manydesigns-portofino
Hi Alessio,

I found a bug. It may not be critical to fix it, but it would be good to let users know that this can occur and that there is an easy work around.

I wanted to test various versions of date and time fields. So I created a test database table with the following column formats:
  • date
  • date with timezone
  • date_time
  • date_time with timezone
  • date[]
  • date with timezone[]
  • date_time[]
  • date_time with timezone[]
  • date_range
The [] mnemonic signifies that this is an array, i.e., multiple dates in the same cell. So for example, I added {1776/7/4, 1976/7/4} into the cells for the array columns and the date_range.

When I synchronized the database model in Portofino to reflect the changes, I was kicked out and could not log back in. Since I was updating from  Portofino-5.2.1, I still had the old version, but could not log into that as well. I also tried to create new instances of both 5.2.1 and 5.3.0. I could log into admin / admin, but once I ran the wizard to connect to the database with my test date time columns, I could not log in.

After some time scratching my head and trying a bunch of things, it occurred to me that the problems started directly after creating these date / time columns. So I deleted the columns. I still could not log in, because I would first have to resynchronize the database and since I could not login, that would not be possible. But when I created a new instance without the date / time columns, the login worked.

Fortunately, the open source methodology of Portofino allowed me to do a manual tweak. I did a search for files with the name of my database table "test_dates" and found "test_dates.xml." I moved it outside of the structure of portofino and was then able to login to the 5.3.0 version of my application, which I thought had been lost.

The moral of the story is that if you get mysteriously locked out of your Portofino application, think if you created some new date / time columns, especially an array or range version. If so, delete these columns and the xml file corresponding to that table. If that table is critical to your application, you can probably recreate it by doing a resync of the database model - but this time without the troublesome date / time formatted columns.

I did not iteratively test each of the separate versions of data / time columns listed above. In my case I need a date range, so I can simply create two columns -  "date_start" and "date_end."

I am using Portofino 5.3.0 (but the error occurred when I tested other versions as well) on Linux Debian 9 using the javaodk framework and postgresql 9.6.23.



Joe Kirchner

Sep 17, 2021, 2:11:15 PM9/17/21
to manydesigns-portofino
I just tried date_time without timezone (timestamp) without any problem. It looks like the arrays are giving the problem, but I haven't tried dates with  timezone yet.

Alessio Stalla

Mar 11, 2022, 7:28:46 AMMar 11
to manydesigns-portofino
Hi Joe,

I'm so sorry to reply only now, but for some reason, these messages of yours didn't get into my email. I'm only seeing them now because I stumbled upon Google Groups' web application. I'll make sure to check that more often!

Portofino doesn't know how to handle array types in the DB. However, the fact that this results in a broken application is definitely a bug; such columns ought to be ignored. I will investigate. Unfortunately, a new version of Portofino has just come out, so the fix for this problem won't be released for a while.
Reply all
Reply to author
0 new messages