ModActiveDirectory – “Host can’t be null” error

Forum Home Forums Runtime Bugs Server Bugs ModActiveDirectory – “Host can’t be null” error

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #17898
    AlexandruD
    Participant

    Hello,

    I am experiencing a persistent issue with ModActiveDirectory (v6.1.1.0) while running Scada Server (v6.2.2.1) on a Windows environment (running as Local System Account).

    The Problem:
    Every time the Server starts, the log shows the following error:
    Module ModActiveDirectory: Error creating database entities: Host can’t be null

    What I have tried so far:

    Database Permissions: Confirmed that the postgres user has full GRANT permissions on the public and project schemas. Other modules (like ModArcPostgreSql) connect to the database successfully.

    Configuration Synchronization: Verified that ScadaInstanceConfig.xml contains the correct database connection strings (localhost / 127.0.0.1).

    Manual Module Configuration: I manually edited ModActiveDirectory.xml in both the Instance folder and the main Installation folder, adding the <DbConnOptions> section as suggested by the source code found on GitHub:<DbConnOptions>
    <Server>127.0.0.1</Server>
    <Database>rapidscada</Database>
    <Username>postgres</Username>
    <Password>Password123!</Password>
    <DBMS>PostgreSQL</DBMS>
    </DbConnOptions>

    #17899
    Mikhail
    Moderator

    Hi,

    Right, you should specify the PostgreSQL connection options in the ScadaInstanceConfig.xml file. The module requires creating some tables in the database.
    Password must be encoded. In the Administrator app, use Main Menu – Tools – Project Tools – Encrypt password.

    #17900
    Mikhail
    Moderator

    If you need only validating passwords using ModActiveDirectory, you can disable searching in the database in the module options.

    #17901
    Mikhail
    Moderator

    If you upgraded Rapid SCADA from the older version, you need to upgrade ScadaInstanceConfig.xml as follows

    <?xml version="1.0" encoding="utf-8"?>
    <ScadaInstanceConfig>
      <Culture></Culture>
      <LogDir></LogDir>
      <DefaultConnection>Default Connection</DefaultConnection>
      <ActiveStorage>FileStorage</ActiveStorage>
      <Connections>
        <Connection>
          <Name>Default Connection</Name>
          <DBMS>PostgreSQL</DBMS>
          <Server>localhost</Server>
          <Database>rapid_scada</Database>
          <Username>postgres</Username>
          <Password>4D83D8AEB31C1B40335A78AF3539DD22</Password>
          <ConnectionString />
        </Connection>
      </Connections>
      <Storages>
        <Storage code="FileStorage">
          <ViewAvailable>false</ViewAvailable>
        </Storage>
        <Storage code="PostgreSqlStorage">
          <ViewAvailable>true</ViewAvailable>
          <WaitTimeout>30</WaitTimeout>
        </Storage>
      </Storages>
    </ScadaInstanceConfig>
    
    #17902
    Mikhail
    Moderator

    rapid_scada database should be created on the DB server.

    #17905
    AlexandruD
    Participant

    Hi Mikhail, I updated ScadaInstanceConfig.xml exactly as you suggested, encrypted the password, and verified that the database exists on the PostgreSQL server. However, I still get ‘Host can’t be null’. Could this ‘Host’ refer to the LDAP server instead of the Database server, or is there another place where the connection string must be defined for version 6.2.2.1.
    Just to clarify and provide more context: this is a clean installation of version 6.2.2.1, not an upgrade from an older version.

    #17907
    AlexandruD
    Participant

    Hi Mikhail,

    Thank you very much for your support! After applying the settings exactly as you described, the module is now working correctly.

    Password Encryption: Encrypting the database password using the Administrator -> Tools -> Project Tools utility.

    Database alignment: Verifying that the database name in the XML matched the one created in PostgreSQL.
    The problem was related to incorrect PostgreSQL user configuration. After fixing it, everything works correctly.

    The ‘Host can’t be null’ error is gone and the server starts perfectly now. Thanks again!

    #17909
    Mikhail
    Moderator

    Hi,

    Thank you for the update 🙂

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.