IUREDCap/redcap-etl

Error: The properties file \"config/test.ini\" could not be read.

yfarooq opened this issue · 9 comments

Hi,

When I execute "sudo php bin/transformation_rules_generator.php config/test.ini > config/test-rules.txt"
inside test-rule.txt i get an error "Error: The properties file "config/test.ini" could not be read."

And when I execute
"dev@tyvacnepal:/var/www/html/redcap-etl$ bin/redcap_etl.php -c /var/www/html/redcap-etl/config/test.ini"

I get the following errors:

The properties file "/var/www/html/redcap-etl/config/test.ini" could not be read.
#0 /var/www/html/redcap-etl/src/RedCapEtl.php(83): IU\REDCapETL\Configuration->__construct(Object(IU\REDCapETL\Logger), '/var/www/html/r...', false)
#1 /var/www/html/redcap-etl/bin/redcap_etl.php(48): IU\REDCapETL\RedCapEtl->__construct(Object(IU\REDCapETL\Logger), '/var/www/html/r...')
#2 {main}
Processing failed.

OS = Ubuntu 16.04
REDCap = 8.0.0
Database = MySQL

--- test.ini --

; Configuration file for REDCap ETL (Extract Transform Load)

;----------------------------------------------------------
; REDCap API connection information
;----------------------------------------------------------

; The URL for the REDCap API being used. To find out your REDCap
; API URL-
; 1. Log in to your REDCap project
; 2. Click on the API link on the left navigational panel
; 3. Click on REDCap API documentation link in the API Security:
; Best Practices highlighted section
; 4. Select an action under Supported Methods section, like Export Events
; 5. Your API URL will appear in the URL section
; Not ending the URL with a slash (/) may cause an error.
redcap_api_url = https://dev.ox.xyz.com/redcap/api/
ssl_verify = false
ca_cert_file =

;-------------------------------------------------------------------
; Configuration project (optional, if its required properties are
; defined in this file.
;-------------------------------------------------------------------
config_api_token =

;----------------------------------------------
; The REDCap API token for the data project
;----------------------------------------------
data_source_api_token = XYZ7AAB60C113CA39XXXXXXXXXXXXXX

;----------------------------------------------------------
; Transformation Rules
; source: 1 = text, 2 = file, 3 = auto-generated
; (note: "text" can't be used for file-only configuration)
;----------------------------------------------------------
transform_rules_source = 3
transform_rules_file =

;----------------------------------------------
; Load database
; E.g.:
; MySQL:::<>:
;----------------------------------------------
db_connection = MySQL:localhost:root::etl

;-----------------------------------------------------------
; E-mail error notification information (optional)
;-----------------------------------------------------------
email_from_address =
email_subject =
email_to_list =
send_email_summary = false

;-----------------------------------------------------------
; Post-processing SQL file location (optional)
;-----------------------------------------------------------
post_processing_sql_file =

;-----------------------------------------------------------
; Logging information (optional)
;-----------------------------------------------------------
log_file =
log_project_api_token =

;----------------------------------------------------
; ETL processing settings
;----------------------------------------------------
batch_size = 10
label_view_suffix =
table_prefix =
time_limit = 0
timezone =

;----------------------------------------------------------------
; Web script information (optional)
;----------------------------------------------------------------
web_script =
web_script_log_file =

Hi Yama,

Thanks for the feedback. I have not yet been able to recreate your error. Could you please provide some more information:

  • What version of PHP are you using?
  • What version of REDCap-ETL are you using? You can look in the file src/Version.php to see the REDCap-ETL version number.

Jim

Hi Jim,
Thanks for the help.

The configuration file and the plugin seems to be working in my window machine (REDCap 8.5.21, php 7).

production server:

PHP 7.0.30-0ubuntu0.16.04.1
const RELEASE_NUMBER = "0.5.8";

I have changed the redcap-elt folder permission to 777 using chmod -R 777 and still not working.

The error seems to be coming from src/Configuration.php like149

Thanks Yama. Those look good.

Could you please create a test.php script with the following contents:

<?php
$file = $argv[1];
parse_ini_file($file)

And then run that script on your .ini file. This should generate a more specific error message.

Jim

Thanks Jim,
How can I run test.php inside .ini file? never don this before

Regard,

You could put the test.php file in your bin directory and then run it as the other commands:

php bin/test.php config/test.ini

Jim

Thanks Jim

The problem seems to be with the database connection
db_connection = MySQL:localhost:user:pass!54u8*q:test_db
Do you know how can I include the database port number?

The problem appears to be the exclamation point (!) in your db_connection. If you put the db_connection value in double quotes, that should fix your issue:

db_connection = "MySQL:localhost:user:pass!54u8*q:test_db"

Jim

Unfortunately, there does not appear to be a way to specify the port number. I am working on adding that now...

Thanks for the help Jim,
much appreciated !

It is working now.