Unable to "install DB" after register contrib form assessment_intake


(Ralf Lukner MD PhD) #1

Situation
Unable to install DB after register contrib form assessment_intake.

I get the following error:
Forms Administration

ERROR: could not open table.sql, broken form?

OpenEMR Version
I’m using OpenEMR version 5.0.1(7)

Browser:
I’m using: Chrome Version 75.0.3770.100 (Official Build) (64-bit). The latest version.

Operating System
I’m using: MacOS Mojave client. Amazon AWS Standard version.

Logs
Not sure which logs to check.


(Ralf Lukner MD PhD) #2

Maybe this is a permissions issue?

/var/www/localhost/htdocs/openemr # ls -l interface/forms/assessment_intake/table.sql
-r-------- 1 root root 5490 Jul 6 03:01 interface/forms/assessment_intake/table.sql


(Ralf Lukner MD PhD) #3

It’s not a permissions issue after all. I compared the forms directory of assessment_intake to other forms, like bronchitis, and I cannot tell the difference. I have no idea why the system complains of being unable to open table.sql. Maybe there is another error that is presented as this?


(Ralf Lukner MD PhD) #4

It doesn’t seem to matter what contrib form I use. I’m not able to install DB


(Ralf Lukner MD PhD) #5

I checked the php code and the issue appears to be in this call:
installSQL("$srcdir/…/interface/forms/{$dir[‘directory’]}"))


(Ralf Lukner MD PhD) #6

I will install the table.sql manually and update the registry to work around this issue for now …
–Ralf


(Ralf Lukner MD PhD) #7

Unfortunately, simply installing the table, marking the registry table that the sql was run, and then choosing enable does not make the form (such as assessment_intake or clinical_notes) usable (encounter tab goes blank and stays that way … nothing appears).


(Brady Miller) #8

hi @Ralf_Lukner ,

Are you seeing any more specific errors in your php error log after you try to Install DB for a form?

-brady


(Ralf Lukner MD PhD) #9

The logs are completely clean:

/var/www/localhost/htdocs/openemr # ls -l /var/log/apache2/
total 4
-rw-r--r--    1 root     wheel            0 Jul  7 02:00 access.log
-rw-r--r--    1 root     wheel            0 Jul  7 02:00 error.log
drwxr-sr-x    2 root     wheel         4096 Jul  7 15:32 old_logs
-rw-r--r--    1 root     wheel            0 Mar 19 22:47 php_errors.log
-rw-r--r--    1 root     wheel            0 Jun  3  2018 ssl_access.log
-rw-r--r--    1 root     wheel            0 Jul  7 02:00 ssl_error.log
-rw-r--r--    1 root     wheel            0 Jun  3  2018 ssl_request.log

(Ralf Lukner MD PhD) #10

I can place “echo” statements to help debug the code if you would like me to. If you have debug version of the relevant php files, I can temporarily install those. I can also open Chrome or Firefox in development mode and tell you what that shows if it would be helpful.
–Ralf


(Stephen Waite) #11

hi @Ralf_Lukner, try changing the permission of the new directory to execute so the script can descend into the directory to see the files
chmod u+x openemr/interface/forms/assessment_intake


(Ralf Lukner MD PhD) #12

Attempt:

/var/www/localhost/htdocs/openemr/interface # chmod u+x forms/soap2

Answer: Did not correct the issue.

I added extra information about the directory to the error msg to echo $dir:

ERROR: could not open table.sql, broken form?dir = /var/www/localhost/htdocs/openemr/library/…/interface/forms/soap2

Below is the line showing the (unchanged) “Install DB” status of the soap2 contrib.


(Brady Miller) #13

hi,

Probably not a permission issue. The docker permissions look funky, but they should work. Is this working on the demos: https://www.open-emr.org/wiki/index.php/Development_5.0.1_Demo

If the demos work, then would be helpful to hear from other users that are using aws, since we don’t have a great way to test that very easily.

Also, those logs look weird since the access.log is also empty. For debugging, something I usually do is error_log(“DEBUG”.$info) commands which then output to the error log. Then will also confirm that your error logs are also where you think they are.

-brady


(Stephen Waite) #14

permissions issue is introduced by following installation instructions because we’re working from the sudo bash shell in the openemr docker:

/var/www/localhost/htdocs/openemr # cp -r contrib/forms/assessment_intake/ interface/forms /.

/var/www/localhost/htdocs/openemr # ls -lrt interface/forms/assessment_intake/
total 72
-r-------- 1 root root 27336 Jul 8 14:28 view.php
-r-------- 1 root root 5490 Jul 8 14:28 table.sql
-r-------- 1 root root 6716 Jul 8 14:28 save.php
-r-------- 1 root root 1049 Jul 8 14:28 report.php
-r-------- 1 root root 18544 Jul 8 14:28 new.php
-r-------- 1 root root 22 Jul 8 14:28 info.txt`

so can correct with

chown -R apache interface/forms/assessment_intake/

also think if @Ralf_Lukner installed logrotate could have an effect on the filename of the error.log


(Ralf Lukner MD PhD) #15

This corrected the problem.
–Ralf