Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validator error with config file, fixed with ignoreSubjectConsistency #1233

Closed
ins0mniac2 opened this issue Mar 21, 2021 · 11 comments
Closed

Comments

@ins0mniac2
Copy link

Using 1.6.2 with no command line options, when using a config file, we get the following error:

Unhandled rejection (
reason: TypeError: Cannot read property 'split' of undefined
at Minimatch.match (/usr/lib/node_modules/bids-validator/node_modules/minimatch/minimatch.js:717:9)
at minimatch (/usr/lib/node_modules/bids-validator/node_modules/minimatch/minimatch.js:107:42)
at Object.ignoredFile (/usr/lib/node_modules/bids-validator/utils/config.js:11:13)
at Function.format (/usr/lib/node_modules/bids-validator/utils/issues/index.js:65:16)
at Function.exceptionHandler (/usr/lib/node_modules/bids-validator/utils/issues/index.js:191:25)
at validateMisc.then.then.then.then.then.then.then.then.catch.err (/usr/lib/node_modules/bids-validator/validators/bids/fullTest.js:217:35)
at processTicksAndRejections (internal/process/task_queues.js:86:5)
).

The error doesn't occur when we add --ignoreSubjectConsistency option to the command line, which we do to avoid the error described here: https://neurostars.org/t/validator-internal-error-due-to-dataset-size/17829

@sappelhoff
Copy link
Member

Hi @ins0mniac2, could you please post the contents of your config file here?

Does the validator run normally if you do not pass a config file?

Did you try running the validator on a different dataset using the config file of the other dataset?

@ins0mniac2
Copy link
Author

ins0mniac2 commented Mar 25, 2021

@sappelhoff , thanks for responding. The validator throws the error whether we explicitly use the "-c" argument to specify the config file or don't use any arguments. We haven't tried it with a different dataset yet. I attached the config file as a zip file -- it wasn't formatted correctly when I pasted the content.
config.zip

@sappelhoff
Copy link
Member

for convenience, here it is pasted again (after downloading and unzipping your file)

{
    "ignore": [],
    "warn": [],
    "error": [],
    "ignoredFiles": [
          "/docs/**",
          "/code/**",
          "/ignoredir/**",
          "**/*BAD*.nii.gz",
          "**/*BAD*.json"
    ]

}

If the error also occurs without the config file, it's likely that the config file is not a problem 🤔

Finding out if the validator throws this issue on other datasets would be the next step. you can try some on https://github.com/bids-standard/bids-examples

@ins0mniac2
Copy link
Author

ins0mniac2 commented Mar 25, 2021

Just to clarify, the error does NOT happen when the config file is not there at all, but does happen with it being there, regardless of whether it's specified on the command line with "-c" or not. I assume even without "-c", it is picking it up as the file is saved under the default name it is looking for ( .bids-validator-config.json ) ?

Thanks for posting the content. I need to find the "verbatim" tag in here!

@sappelhoff
Copy link
Member

Just to clarify, the error does NOT happen when the config file is not there at all,

ahh okay

I assume even without "-c", it is picking it up as the file is saved under the default name it is looking for ( .bids-validator-config.json ) ?

yes 👍

I need to find the "verbatim" tag in here!

you can use markdown code blocks:

```put the language here
anything written in between backticks is code
```

for example

```python
def fun(a):
    return a**2
```

renders:

def fun(a):
    return a**2

and

```json
{a: true}
```

renders:

{a: true}

even marking a syntax error, because I should have written "a" and not just a.

see: https://guides.github.com/features/mastering-markdown/

@ins0mniac2
Copy link
Author

ah, markdown. thanks!

based on the above clarification, do you have any further thoughts or trying on another dataset is what you would still suggest next ?

@sappelhoff
Copy link
Member

yes, trying on another dataset would be imporant now. I don't have more ideas unfortunately

@sappelhoff
Copy link
Member

Hey @ins0mniac2 I hope you were able to resolve your issue in the meantime. I am closing this now because we'd need more information to clarify whether this is a bug to be fixed, or something else. Happy to re-open if this is still a problem and if you can provide further info.

@mgxd
Copy link

mgxd commented May 25, 2021

We've also hit this in nipreps/fmriprep#2409 after bumping the bids-validator to the 1.7.x series. However, it is a bit strange because:

  • It is only happening with one dataset (ds005)
  • I haven't been able to replicate it locally
Command and config
bids-validator /tmp/data/ds005 -c /tmp/tmphmn8b3fi

{
  "ignore": [
    "EVENTS_COLUMN_ONSET",
    "EVENTS_COLUMN_DURATION",
    "TSV_EQUAL_ROWS",
    "TSV_EMPTY_CELL",
    "TSV_IMPROPER_NA",
    "VOLUME_COUNT_MISMATCH",
    "BVAL_MULTIPLE_ROWS",
    "BVEC_NUMBER_ROWS",
    "DWI_MISSING_BVAL",
    "INCONSISTENT_SUBJECTS",
    "INCONSISTENT_PARAMETERS",
    "BVEC_ROW_LENGTH",
    "B_FILE",
    "PARTICIPANT_ID_COLUMN",
    "PARTICIPANT_ID_MISMATCH",
    "TASK_NAME_MUST_DEFINE",
    "PHENOTYPE_SUBJECTS_MISSING",
    "STIMULUS_FILE_MISSING",
    "DWI_MISSING_BVEC",
    "EVENTS_TSV_MISSING",
    "TSV_IMPROPER_NA",
    "ACQTIME_FMT",
    "Participants age 89 or higher",
    "DATASET_DESCRIPTION_JSON_MISSING",
    "FILENAME_COLUMN",
    "WRONG_NEW_LINE",
    "MISSING_TSV_COLUMN_CHANNELS",
    "MISSING_TSV_COLUMN_IEEG_CHANNELS",
    "MISSING_TSV_COLUMN_IEEG_ELECTRODES",
    "UNUSED_STIMULUS",
    "CHANNELS_COLUMN_SFREQ",
    "CHANNELS_COLUMN_LOWCUT",
    "CHANNELS_COLUMN_HIGHCUT",
    "CHANNELS_COLUMN_NOTCH",
    "CUSTOM_COLUMN_WITHOUT_DESCRIPTION",
    "ACQTIME_FMT",
    "SUSPICIOUSLY_LONG_EVENT_DESIGN",
    "SUSPICIOUSLY_SHORT_EVENT_DESIGN",
    "MALFORMED_BVEC",
    "MALFORMED_BVAL",
    "MISSING_TSV_COLUMN_EEG_ELECTRODES",
    "MISSING_SESSION"
  ],
  "error": [
    "NO_T1W"
  ],
  "ignoredFiles": [
    "/dataset_description.json",
    "/participants.tsv"
  ]
}

@effigies
Copy link
Collaborator

@mgxd I don't think this is the same issue. Or if so, it's likely to get buried because it's closed. Do you want to open a new one?

@yarikoptic
Copy link
Contributor

not sure if it is the same issue, but also not sure if the original issue filed here was resolved (no PR backref), so here is what I get with some elderly validator (well -- all is in container, used for other studies and actually for this one before with less subjects etc -- didn't investigate yet when started to fail)

bids-validator@1.5.8

Unhandled rejection (
  reason: TypeError: Cannot read property 'split' of undefined
    at Minimatch.match (/usr/local/lib/node_modules/bids-validator/node_modules/minimatch/minimatch.js:717:9)
    at minimatch (/usr/local/lib/node_modules/bids-validator/node_modules/minimatch/minimatch.js:107:42)
    at Object.ignoredFile (/usr/local/lib/node_modules/bids-validator/utils/config.js:11:13)
    at Function.format (/usr/local/lib/node_modules/bids-validator/utils/issues/index.js:65:16)
    at Function.exceptionHandler (/usr/local/lib/node_modules/bids-validator/utils/issues/index.js:191:25)
    at validateMisc.then.then.then.then.then.then.then.then.catch.err (/usr/local/lib/node_modules/bids-validator/validators/bids/fullTest.js:217:35)
    at process._tickCallback (internal/process/next_tick.js:68:7)
).

WARNING: validator exited with exit code 3

and the config file used is

{
    "ignore": [
       "TOTAL_READOUT_TIME_NOT_DEFINED"
    ],
    "warn": [],
    "error": [],
    "ignoredFiles": [
          "/.heudiconv/*", "/.heudiconv/*/*", "/.heudiconv/*/*/*", "/.heudiconv/*/*/*/*",  
          "/.heudiconv/.git*", 
          "/.heudiconv/.git/*",
          "/.heudiconv/.git/*/*",
          "/.heudiconv/.git/*/*/*",
          "/.heudiconv/.git/*/*/*/*",
          "/.heudiconv/.git/*/*/*/*/*",
          "/.heudiconv/.git/*/*/*/*/*/*",
          "/.git*", 
          "/.datalad/*", "/.datalad/.*", 
          "/.*/.datalad/*", "/.*/.datalad/.*", 
          "/sub*/ses*/*/*__dup*", "/sub*/*/*__dup*"
    ]
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants