SQL Ledger Install/Configuration Trouble

mike-h30 wrote on Saturday, April 19, 2008:

I am not seeing a link for SQL Ledger on the billing page of OpenEMR. I have SQL Ledger 2.6.27 installed.  I confirmed that I am able to get to the login page from this link.

   http://localhost/sql-ledger/admin.pl

The screen that appears shows the SQL Ledger logo, version 2.6.27, the word "Administration", and a password field.  Inititially the password field was blank and once I logged in,  I assigned a password.

Once I am logged into SQL Ledger, the next screen shows the following:

SQL-Ledger Accounting Administration
Login      Name        Company  Driver    Host         Dataset     Templates
openemr  openemr         Pg           localhost     openemr     openemr

I followed the instructions written by Tekkno Genius in the /srv/www/htdocs/openemr-2.8.3/accounting directory and performed a manual install of SQL-Ledger for version 2.6.27.  Rod recommended that I install version 2.6.27 because I am using OpenEMR 2.8.3.  I chose the manual install because it appeared that the setup.pl script wanted to install a newer version of SQL Ledger (I think it was 2.8.X).

Questions

1.)  Does this line in ws_server.pl need to be modifed to point to /var/local/sql-ledger? This is where I have SQL Ledger installed.

######################################################################
# IMPORTANT - modify this to point to your SQL-Ledger installation!
######################################################################
use lib qw (/var/www/sql-ledger);

(I copied “ws_server_26.pl” and re-named as “ws_server.pl” into /var/local/sql-ledger per Tekkno Genius’s instructions.)

2.) I am unable to login at http://localhost/sql-ledger/login.pl

What is the "Name" that goes here?  "openemr" or "sql-ledger"?  I tried both.  With "sql-ledger" I used the "sql-ledger" password from the admin page (http://localhost/sql-ledger/admin.pl).  With "openemr" I used the password that I created for user/login "openemr" that I created from the admin page (http://localhost/sql-ledger/admin.pl).

3.) When I created user/login "openemr" at http://localhost/sql-ledger/admin.pl, when I clicked save I received this error message:

Error!

FATAL: Ident authentication failed for user "sql-ledger"

However, even with the error, user/login "openemr" was still created.

Is this a permissions issue?  What should the permissions be set to for directory /usr/local/sql-ledger?  They are root at the moment.

4.) Is there anything else that needs to be done to get SQL Ledger working with OpenEMR-2.8.3? 

Please advise.

-Mike

bradymiller wrote on Sunday, April 20, 2008:

hey,

Detailed installation instructions for sql-ledger in openemr can be found at (on page 100):
http://www.bradymd.com/appliance/manual3/

This should help to answer most of your questions.

-Brady

mike-h30 wrote on Sunday, April 20, 2008:

Thanks Brady!

-Mike

mike-h30 wrote on Sunday, April 20, 2008:

I keep getting the following error when I click ‘Create Dataset’ in SQL Ledger.  I have installed SQL Ledger 2.6.27.

Error!

FATAL: Ident authentication failed for user "sql-ledger"

I followed the SQL Ledger install directions from Brady’s website - http://www.bradymd.com/appliance/manual3/#0.0.0.0.0.0.Install%20FreeB%200.11|outline.
I have attempted to delete and re-create user “sql-ledger” but to no avail.  I have included my command line output as well as my Apache2 error log below.  This is my first time having installed/used PostgreSQL.

Questions

1.)  Can anyone determine what I am doing wrong from my output?
2.)  Did I not setup the initial postgres user correctly?
3.)  Should there be a "admin" user for PostgreSQL?

********  My Command Line Output *******************************

linux-7sni:~ # su postgres
postgres@linux-7sni:/root> psql --version
could not change directory to "/root"
psql (PostgreSQL) 8.1.11
contains support for command-line editing
postgres@linux-7sni:/root> dropuser sql-ledger
could not change directory to "/root"
DROP ROLE
postgres@linux-7sni:/root> exit
exit
linux-7sni:~ # /sbin/service postgresql restart
Shutting down PostgreSQLpostmaster stopped
                                                                     done
Starting PostgreSQL                                                  done
linux-7sni:~ # su postgres
postgres@linux-7sni:/root> createuser -d -P sql-ledger
could not change directory to "/root"
Enter password for new role:
Enter it again:
Shall the new role be a superuser? (y/n) n
Shall the new role be allowed to create more new roles? (y/n) y
CREATE ROLE
postgres@linux-7sni:/root> createlang plpgsql template1
could not change directory to "/root"
createlang: language "plpgsql" is already installed in database "template1"
postgres@linux-7sni:/root> exit
exit
linux-7sni:~ #

*******  Apache2 Error Log ******************

[Sun Apr 20 15:14:13 2008] [error] [client 127.0.0.1] DBI connect(‘dbname=template1’,‘sql-ledger’,…) failed: FATAL:  Ident authentication failed for user “sql-ledger”, referer: http://localhost/sql-ledger/admin.pl
[Sun Apr 20 15:14:13 2008] [error] [client 127.0.0.1]  at SL/User.pm line 253, referer: http://localhost/sql-ledger/admin.pl

gutiersa wrote on Wednesday, April 23, 2008:

Mike:

1.) Can anyone determine what I am doing wrong from my output?

    the same thing happened to me today actually, I went back (via browser back-arrow) and re-entered the sql-ledger password (don’t just use the asterisks that appear automatically, if any). The manual referrenced above is pretty good about helping you keep track of your passwords. You could retrace your steps and write down the sql-ledger password. It is different from the openemr password. To create the dataset you need to enter sql-ledger password, not openemr password (the latter you need when entering sql-ledger from the openemr billing screen)

2.) Did I not setup the initial postgres user correctly?

     If you followed instructions in manual above you probably set up postgres correctly. especially if you were able to create the sql-ledger user.

3.) Should there be a “admin” user for PostgreSQL?
     I don’t think so.

I hope this helps

bradymiller wrote on Wednesday, April 23, 2008:

hey,

1. Yep, the passwords are a pain. Page 19 of above manual may also help to clarify them.

2. The thing that is weird is the "could not change directory to “/root” " statements, although it does seem like the commands are working. According to http://www.dirvish.org/pipermail/dirvish/2006-June/000851.html using ‘su - postgres’ may avoid this(although won’t likely solve your problem).

After ‘su postgres’, type ‘psql’, then ‘\l’ and should get:

         List of databases
   Name    |   Owner    | Encoding
-----------±-----------±---------
openemr   | sql-ledger | UTF8
postgres  | postgres   | UTF8
template0 | postgres   | UTF8
template1 | postgres   | UTF8
(4 rows)

Then type ‘SELECT * FROM “pg_user”;’ and should get stuff like:

  usename   | usesysid | usecreatedb | usesuper | usecatupd |  passwd  | valuntil | useconfig
------------±---------±------------±---------±----------±---------±---------±----------
postgres   |       10 | t           | t        | t         | ******** |          |
sql-ledger |    16384 | t           | t        | t         | ******** |          |

3. postgres should be the superuser and considered root

What’s your OS and postgres version?

-Brady

mike-h30 wrote on Thursday, April 24, 2008:

Thanks for the input Dr. G and Brady.

I am running SUSE Linux Enterprise Server 10 - SP1 and (PostgreSQL) 8.1.11

mike-h30 wrote on Sunday, May 04, 2008:

Brady,

I started from a clean install of Suse Linux Enterprise Server 10 - SP1 and OpenEMR.  I followed the directions from your manual referenced above exactly and I still get the following error.

Error!

FATAL: Ident authentication failed for user "sql-ledger"

1.)  I noticed that I was never asked these questions from the command prompt during set up of postgres.  Instead I was asked “Shall  
     the new role be a superuser?”  I chose ‘yes’ (see my command output below).  Could this be the issue?

     Shall the new user be allowed to create databases? (y/n)
     Shall the new user be allowed to create more new users? (y/n)

2.)  Is this a version issue with SQL-Ledger?  I installed version 2.6.27.

3.)  Here is my version information:
      PostgreSql 8.1.11
      PHP 5.2.5
      Apache 2.2.3
      SQL Ledger 2.6.27

*** Output from my command line ************

linux-o73z:/usr/local/sql-ledger # chown -hR wwwrun:www users templates css spool
linux-o73z:/usr/local/sql-ledger #
linux-o73z:/usr/local/sql-ledger #
linux-o73z:/usr/local/sql-ledger # cd
linux-o73z:~ # rcapache2 restart
Syntax OK
Shutting down httpd2 (waiting for all children to terminate)         done
Starting httpd2 (prefork)                                            done
linux-o73z:~ # su - postgres
postgres@linux-o73z:~> createuser -d -P sql-ledger
Enter password for new role:
Enter it again:
Shall the new role be a superuser? (y/n) y
CREATE ROLE
postgres@linux-o73z:~> createlang plpgsql template1
postgres@linux-o73z:~> exit
logout

mike-h30 wrote on Sunday, May 04, 2008:

Here is my Apache error log:

[Sun May 04 13:45:29 2008] [error] [client 127.0.0.1] DBI connect(‘dbname=template1’,‘sql-ledger’,…) failed: FATAL:  Ident authentication failed for user “sql-ledger”, referer: http://localhost/sql-ledger/admin.pl
[Sun May 04 13:45:29 2008] [error] [client 127.0.0.1]  at SL/User.pm line 253, referer: http://localhost/sql-ledger/admin.pl

mike-h30 wrote on Sunday, May 04, 2008:

Problem solved!!  In the SUSE distro, the file "pg_hba.conf"  must be edited as follows:

#OLD
# TYPE  DATABASE    USER        CIDR-ADDRESS          METHOD
# "local" is for Unix domain socket connections only
local   all         all                               ident sameuser

#New
local   all         all                               md5

After making the change, I was then able to create the "openemr" dataset.