We hope you'll join us for our 4/23 webinar on using data tables to apply reference ranges and AE codes in OC4. For more information and to register, visit https://register.gotowebinar.com/register/2882170018956684555

Unable to get new OpenClinica install to authenticate

Openclinica server configuration:

ARCH : x86_64
CPU : 2 Logical Intel Xeon E5-2665 @ 2.40GHz
RAM / SWAP : 4 GB / 8 GB
OS : RHEL 7.7 Server - kernel 3.10.0-1062.el7.x86_64
APPLICATIONS : OpenClinica 3.14
MISC : Java JDK 7u79, PostgreSQL 9.5.19, Tomcat 7.0.52

Database is up and running and I can connect to it fine using the 'clinica' database user:

s01scus-ocdev-root[45]:/opt/PostgreSQL/9.5/bin/psql -d openclinica -h localhost -U clinica
Password for user clinica: ********
psql.bin (9.5.19)
Type "help" for help.

openclinica=#

Openclinica is installed and configured, and tomcat has been updated for UTF-8.

Tomcat starts, the database gets populated, and then the web UI becomes available. Trying to login as root fails,
as does entering bogus info. It always fails with the message "Oops! An error has occurred":



Looking at the logs, it indicates authentication errors but I cannot figure out why it actually fails:

Sep 09, 2019 4:52:18 PM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet [default] in context with path [/OpenClinica] threw exception
java.lang.NullPointerException
at org.akaza.openclinica.dao.login.UserAccountDAO.findByUserName(UserAccountDAO.java:584)
at org.akaza.openclinica.web.filter.OpenClinicaUsernamePasswordAuthenticationFilter.attemptAuthentication(OpenClinicaUsernamePasswordAuthenticationFilter.java:123)
at



I have tried installing 3.10.1, 3.12, and 3.14. I have installed it per the docs, as well as in standard configuration I
normally use for PostgreSQL and Tomcat (installing packages via yum). Regardless of the version or installation
method used, it always fails the same way.

After the database has been created on initial startup of Openclinica, I have verified that the 'root' user does exist
in it.

openclinica=# select * from user_account;
user_id | user_name | passwd | first_name | last_name | email | activ
e_study | institutional_affiliation | status_id | owner_id | date_created | date_updated | date_lastvisit | pass
wd_timestamp | passwd_challenge_question | passwd_challenge_answer | phone | user_type_id | update_id | enabled |
account_non_locked | lock_counter | run_webservices | access_code | time_zone | enable_api_key | api_key
---------+-----------+----------------------------------+------------+-----------+-------------------------------+------
--------+---------------------------+-----------+----------+--------------+--------------+------------------------+-----
-------------+---------------------------+-------------------------+--------------+--------------+-----------+---------+
--------------------+--------------+-----------------+-------------+-----------+----------------+---------
1 | root | 25d55ad283aa400af464c76d713c07ad | Root | User | [email protected] | 1 | Akaza Research | 1 | 1 | | 2006-10-23 | 2006-10-23 00:00:00-05 | 2006-10-23 | | | 617 621 8585 | 3 | 1 | t | t | 0 | f | | | f |
(1 row)


I also noticed that the docs indicate that the Openclinica config files that start out in WEB-INF/classes
/datainfo.properties should be found in /usr/local/tomcat/webapps after startup, but that never happens either.

Attached are the logs and config file from a version 3.10 test.

In the meantime I am trying a fresh install using RHEL 6 with PostgreSQL 8.4 to see if there is any difference.

Thanks,

Rodney

Comments

  • GerbenRienkGerbenRienk Posts: 818 ✭✭✭
    Hi Rodney,
    Thank you for sending the logs and the datainfo.properties.
    All looks good and well indeed, except for the error-message.
    Before trying anything else: could you very that linux-user tomcat can write in /usr/local/apache-tomcat-7.0.52 ?
    I ask because you mention that the folder openclinica.config was not created.
    And in catalina it seems you made a soft link for /usr/local/tomcat, correct?
    Then if this is all OK, could you check the available memory for tomcat?
    If that is more than 1.2 Gb, could you do the following:
    - stop tomcat
    - empty the work folder
    - start tomcat again
    Many thanks,
    Gerben Rienk
  • Hi Gerben,

    Yes, I have verified that tomcat can write there, and the openclinica.data directory and log files are all getting created properly. I never do see the custom .properties files created anywhere after startup. I do see that openclinica is properly connecting to the database in both the logs and the ps output:

    postgres 2402 1967 0 14:59 ? 00:00:00 postgres: clinica openclinica 127.0.0.1(39392) idle

    This is the memory usage after a fresh boot:

    Tasks: 141 total, 1 running, 140 sleeping, 0 stopped, 0 zombie
    Cpu(s): 0.2%us, 0.0%sy, 0.0%ni, 99.7%id, 0.2%wa, 0.0%hi, 0.0%si, 0.0%st
    Mem: 3924256k total, 1205900k used, 2718356k free, 18708k buffers
    Swap: 8388604k total, 0k used, 8388604k free, 252408k cached

    PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
    2136 tomcat 20 0 3623m 740m 13m S 0.3 19.3 1:32.22 java

    That is from my latest attempt (RHEL6.10, PGSQL 8.4.20, JDK 7 or 8, Tomcat 7.0.52 or 7.0.94). I have now tried probably a dozen different combinations, but it *always fails* the same way.

    The only thing that makes sense is that I am missing a step somewhere or making the exact same mistake every time. I am following the steps here:

    https://github.com/OpenClinica/OpenClinica/wiki/Install-OpenClinica-v3.6-and-higher-on-Linux

    and I have tried explicitly following them, as well as using them as a guideline
    for installing openclinica with system installed versions of postgresql, java, and tomcat.

    I am also always seeing this error on the 3.14 startup:

    java.lang.NullPointerException
    at java.util.Hashtable.put(Hashtable.java:460)
    at java.util.Properties.setProperty(Properties.java:166)
    at org.akaza.openclinica.dao.core.CoreResources.setDatabaseProperties(CoreResources.java:445)
    at org.akaza.openclinica.dao.core.CoreResources.setDataInfoProperties(CoreResources.java:287)
    at org.akaza.openclinica.dao.core.CoreResources.setResourceLoader(CoreResources.java:159)

    I am going to retest again making the least amount of changes to the config file
    to try troubleshooting further.

    Rodney
  • GerbenRienkGerbenRienk Posts: 818 ✭✭✭
    Hi Rodney,
    Sorry, I didn't explain well enough. What I meant was: how much memory did you reserve for tomcat? It's mostly done in setenv.sh and As a starting point I take 1.2 Gb and for example 600Mb for permgen.

    export JAVA_OPTS="-Xms256m -Xmx1200m -XX:PermSize=600m -Duser.country=US -Duser.language=en"

    Kind regards,
    Gerben Rienk
  • jacob.rousseaujacob.rousseau Posts: 22 ✭✭
    Hi Rodney,
    the log messages seem to point to a problem with the database connection. Do you have a file called datainfo.properties in the directory /openclinica.config ? If the file is not present there then copy it from the directory /webapps/OpenClinica/WEB-INF/classes and place in in the openclinica.config directory .

    After editing the datainfo.properties file to match your DB- and other configurations you must restart Tomcat .

    Please let us know how you solved this problem.

    regards, Jacob
  • I determined the root cause is due to a bug with a property and/or the documentation for it. The errors were caused by commenting out or deleting the designerURL setting in the datainfo.properties file:

    ### designerURL=https://designer13.openclinica.com/

    even though that is what the documentation says you can do:

    # If you do not want to see a link to the Rule Designer on the Build Study page,
    # you must delete this configuration option.

    Commenting it out or deleting it causes the following issues:

    - The following error is seen in catalina.out during startup:

    java.lang.NullPointerException
    at java.util.Hashtable.put(Hashtable.java:460)
    at java.util.Properties.setProperty(Properties.java:166)
    at org.akaza.openclinica.dao.core.CoreResources.setDatabaseProperties(CoreResources.java:445)
    at org.akaza.openclinica.dao.core.CoreResources.setDataInfoProperties(CoreResources.java:287)
    at org.akaza.openclinica.dao.core.CoreResources.setResourceLoader(CoreResources.java:159)

    - The root (or any) user is not allowed to login, always fails with "Oops! An error has occurred"
    in the browser, and the following error is logged to localhost.YYYY-MM-DD.log:

    Sep 09, 2019 4:52:18 PM org.apache.catalina.core.StandardWrapperValve invoke
    SEVERE: Servlet.service() for servlet [default] in context with path [/OpenClinica] threw exception
    java.lang.NullPointerException
    at org.akaza.openclinica.dao.login.UserAccountDAO.findByUserName(UserAccountDAO.java:584)
    at org.akaza.openclinica.web.filter.OpenClinicaUsernamePasswordAuthenticationFilter.attemptAuthentication(OpenClinicaUsernamePasswordAuthenticationFilter.java:123)

    - The custom openclinica.config directory/files never are created

    - The "About" section of the home page is blank

    Workaround: Leave it the config file and uncommented.

    #
    # BUG: designerURL MUST be set, otherwise it breaks OpenClinica
    # - Users cannot authenticate and log in
    # - The "About" section of the home page is blank
    # - The custom openclinica.config directory/files never are created
    #
    #############################################################################
    designerURL=https://designer13.openclinica.com/

  • FYI, I documented that on RHEL 6, PostgreSQL 8.4, Java 7/8, OpenClinica 3.14.

    When I tried going back to RHEL 7 with PostgreSQL 9.5 I couldn't even get OpenClinica to start saying property settings were missing (matching symptoms
    in https://github.com/OpenClinica/OpenClinica/issues/581), though in earlier testing I got it to at least start. My guess is that combination had some other
    issues with the property file as well, but I gave up and went back to RHEL 6 with
    PostgreSQL 8.4 which is working for me now.
  • That said, I also documented two other "bugs"

    -- SyslogWriter errors on startup.

    Even though collectStats = false, the usage.stats.host must be set to a valid name.

    The setting:

    collectStats=false
    usage.stats.host=usage.openclinica.com
    usage.stats.port=514
    OpenClinica.version=3.14

    generates errors in the catalina.out log during startup because the hostname
    'usage.openclinica.com' is currently not resolvable via DNS:

    15:56:30,585 |-ERROR in ch.qos.logback.classic.net.SyslogAppender[SYSLOG-USAGESTATS] - Could not create
    SyslogWriter java.net.UnknownHostException: usage.openclinica.com: Name or service not known
    at java.net.UnknownHostException: usage.openclinica.com: Name or service not known
    at at java.net.Inet4AddressImpl.lookupAllHostAddr(Native Method)

    Workaround: Set usage.stats.host to localhost

    #
    # BUG: Even though collectStats = false, usage.stats.host must be set to a valid name.
    # usage.openclinica.com does not resolve currently, so we set it to localhost
    #
    collectStats=false
    usage.stats.host=localhost
    usage.stats.port=514
    OpenClinica.version=3.14

    -- Logging configuration not properly documented

    This is really specifying log.dir + logname prefix

    For example:

    log.dir=${catalina.home}/logs/openclinica

    means the log filenames would have a prefix name of 'openclinica' and they would
    be written to ${catalina.home}/logs

    #############################################################################
    # 11 - Logging configuration
    # Specify the log location - local/syslog/both
    #
    # BUG: This is really log.dir + logname prefix
    #
    # /var/log/tomcat is log dir, openclinica is logname prefix
    #
    log.dir=/var/log/tomcat/openclinica
Sign In or Register to comment.