vanderbilt-redcap / advanced_import Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
Hi @bi0nd0,
When setting up an import job within the module, upon running it I get this error:
Error processing the CSV file - SplFileObject::__construct(/var/app/current/redcap/edocs/advanced_import/uploads/fbef449bc5d42d29039385492a2c8e71.csv): failed to open stream: No such file or directory - (code 0)
My institution runs REDCap on cloud infrastructure within AWS so I've passed this to our DevOps engineer who believes that this module has an issue with recognising the local storage due to the infrastructure setup. Would you be able to take a look at this?
Curious what part of the EM is dependent on v11
thanks!
Hi @bi0nd0
We have received this error in our emails this morning - is this an issue that you need to be aware of?
[This message was automatically generated by REDCap]
Cron job 'advanced_import_process_jobs' failed for External Module 'advanced_import'.
Exception: Exception: The 'advanced_import' module MUST specify a 'namespace' in it's config.json file. in /var/app/current/redcap/redcap_v13.3.3/ExternalModules/classes/ExternalModules.php:3641
Stack trace:
#0 /var/app/current/redcap/redcap_v13.3.3/ExternalModules/classes/ExternalModules.php(6262): ExternalModules\ExternalModules::getFrameworkInstance('advanced_import')
#1 /var/app/current/redcap/redcap_v13.3.3/Classes/Cron.php(319): ExternalModules\ExternalModules::callCronMethod('6', 'advanced_import...')
#2 /var/app/current/redcap/redcap_v13.3.3/cron.php(23): Cron->execute()
#3 /var/app/current/redcap/cron.php(9): include('/var/app/curren...')
#4 {main}
Server: ***
User: SYSTEM
Module Name: (advanced_import)
Module Author(s):
Run Time: 0 seconds
I see in my log the following after trying to import from a csv file.
I can send you further project details if you wish as there is no personal/sensitive data.
Cheers,
John
REDCap 13.8.1 · PHP 8.2.7 (Windows OS) · MySQL 8.0.33
14:23:15 | Error message: Uncaught Error: Object of class stdClass could not be converted to string in modules\advanced_import_v1.9.5\AdvancedImport.php:561 Stack trace: #0 modules\advanced_import_v1.9.5\app\Models\Logs.php(60): Vanderbilt\AdvancedImport\AdvancedImport::escape(Object(stdClass)) #1 modules\advanced_import_v1.9.5\app\Controllers\LogsController.php(33): Vanderbilt\AdvancedImport\App\Models\Logs->getList(0, '...') #2 [internal function]: Vanderbilt\AdvancedImport\App\Controllers\LogsController->index() #3 modules\advanced_import_v1.9.5\app\Helpers\Router.php(91): call_user_func_array(Array, Array) #4 modules\advanced_import_v1.9.5\app\router.php(34): Vanderbilt\AdvancedImport\App\Helpers\Router->dispatch('...') #5 modules\advanced_import_v1.9.5\api.php(4): require_once('...') #6 redcap_v13.8.1\ExternalModules\index.php(139): require('...') #7 redcap_v13.8.1\API\index.php(67): require_once('...') #8 {main} thrownFile: modules\advanced_import_v1.9.5\AdvancedImport.phpLine: 561
We've just been upgrading the infrastructure for one of our test instances of REDCap and it seems that this external module is not compatible with PHP 8.0 or PHP 8.1 (PHP 7 went EOL Monday 28th Nov 2022). I've tried different versions of REDCap and consistently get this issue from 12.5.9
(the earliest version I've tried it with) through to 13.0.1
.
[This message was automatically generated by REDCap]
Cron job 'advanced_import_check_jobs' failed for External Module 'advanced_import'.
Exception: TypeError: count(): Argument #1 ($value) must be of type Countable|array, null given in /var/app/current/redcap/modules/advanced_import_v1.9.3/AdvancedImport.php:291
Stack trace:
#0 /var/app/current/redcap/modules/advanced_import_v1.9.3/AdvancedImport.php(291): count(NULL)
#1 /var/app/current/redcap/redcap_v13.0.1/ExternalModules/classes/ExternalModules.php(6289): Vanderbilt\AdvancedImport\AdvancedImport->cron_checkJobs(Array)
#2 /var/app/current/redcap/redcap_v13.0.1/Classes/Cron.php(319): ExternalModules\ExternalModules::callCronMethod('5', 'advanced_import...')
#3 /var/app/current/redcap/redcap_v13.0.1/cron.php(23): Cron->execute()
#4 /var/app/current/redcap/cron.php(9): include('/var/app/curren...')
#5 {main}
Server: removed
User: SYSTEM
Module Name: Advanced Import/Export (advanced_import)
Module Author(s): [email protected]
Run Time: 0 seconds
The error refers to line 291
of AdvancedImport.php
https://github.com/vanderbilt-redcap/advanced_import/blob/master/AdvancedImport.php#L291
288: function cron_checkJobs($cronInfo)
289: {
290: $stuckJobs = $this->stopStuckJobs();
291: $totalStuck = count($stuckJobs);
292: $messages = ['All jobs have been checked.'];
293: if($totalStuck>=1) {
Line 290 $stuckJobs = $this->stopStuckJobs();
is always null as the stopStuckJobs();
method does not have a return statement.
https://github.com/vanderbilt-redcap/advanced_import/blob/master/AdvancedImport.php#L264
252: private function stopStuckJobs() {
253: $queue = new Queue();
...
263: }
264: $stuckJobs;
265: }
Line 264, the last line of stopStuckJobs
doesn't return anything. I've manually added the return
keyword to this line and no longer get the error. It also doesn't look like $stuckJobs
is actually being set apart from it being set to an empty array.
I don't know if there are any other compatibility issues as I do not know enough about this external module to test it.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.