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

Workflowengine "The given regular expression is invalid" #23666

Open
R0Wi opened this issue Oct 24, 2020 · 14 comments · May be fixed by #50259
Open

Workflowengine "The given regular expression is invalid" #23666

R0Wi opened this issue Oct 24, 2020 · 14 comments · May be fixed by #50259
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap 25-feedback bug feature: workflows

Comments

@R0Wi
Copy link
Member

R0Wi commented Oct 24, 2020

Steps to reproduce

  1. Create a new flow (concrete workflow app doesn't matter)
  2. Choose File MIME type
  3. Choose matches (or does not match)
  4. Choose PDF documents (or Folder)

image

Note: the filters for Images and Office Documents are working.

Expected behaviour

Workflow can be created

Actual behaviour

If i try to save the workflow an error message is raised "The given regular expression is invalid"

Server configuration

Operating system: Ubuntu 20.04

Web server: Apache2

Database: MySql 8.0

PHP version: 7.4

Nextcloud version: 20.0.1

Additional information

Currently there is also an open issue at R0Wi-DEV/workflow_ocr#32 where multiple users reported this problem.

@R0Wi R0Wi added bug 0. Needs triage Pending check for reproducibility or if it fits our roadmap labels Oct 24, 2020
@kesselb
Copy link
Contributor

kesselb commented Oct 24, 2020

Thanks for reporting 👍 I see the same issue on Nextcloud 19.

cc @juliushaertl @blizzz as 'httpd/unix-directory' is not a pattern they cannot use matches as operator. We should probably hide operators which are not compatible to each other. We have the same issue the other way around for File MIME type is Office Documents.

@R0Wi
Copy link
Member Author

R0Wi commented Feb 25, 2021

Hi since the number of reported issues at the workflow_ocr app regarding this problem is increasing i'd kindly like to ask what are the plans for this? If we like to implement #23666 (comment) i can try to do this if you're willing to accept my PR ? 😃

cc @juliushaertl @blizzz @kesselb

@kesselb
Copy link
Contributor

kesselb commented Feb 25, 2021

can try to do this if you're willing to accept my PR

Cool 👍

since the number of reported issues at the workflow_ocr app

A pinned FAQ issue might help with that. At least here at nextcloud/server it helps a bit.

@R0Wi
Copy link
Member Author

R0Wi commented Feb 25, 2021

A pinned FAQ issue might help with that. At least here at nextcloud/server it helps a bit.

Thanks for the hint, will give it a try 😄

So basically i'd implement it the following way (given that the first column is set to File MIME type):

  • The entries of third column (containing the the filetype) are filtered with respect to the second columns choice (comparator)
  • If the user sets the comparator to is or is not the filetypes Folder, PDF Documents and Custom mimetype will be shown in the third column
  • If the user sets the comparator to matches or does not match the regex based types Images and Office documents will be shown in the third column

Would that be the way to go @kesselb ?

@blizzz
Copy link
Member

blizzz commented Feb 25, 2021

@R0Wi generally that sounds good to me.

On a second thought, it is quite technical for the end user. An admin might now about regex's and stuff, but for the average user "is (not)" or "matches (not)" or the meaning of it is black magic. The best way would be to eliminate the differences (only keep is _(not)) and figure out what is desired by testing the third columns value.

That would be a bigger change however, and not backportable. This is an advantage of your suggestion, so let's go with it.

Changing the UI more radically (it has effects on the backend bits, too) could be something for 22.

@szaimen
Copy link
Contributor

szaimen commented Jun 23, 2021

I suppose this is still valid on NC21.0.2?

@R0Wi
Copy link
Member Author

R0Wi commented Jun 24, 2021

AFAIK unfortunately yes. Did not manage to create a PR, yet 😢

@szaimen szaimen added 1. to develop Accepted and waiting to be taken care of and removed 0. Needs triage Pending check for reproducibility or if it fits our roadmap needs info labels Jun 24, 2021
@FernandoMarques-Santos
Copy link

NC 21.0.3 Workflow OCR 1.21.1, the problem still persists.

The only way to deal with this, for now, is to remove the other conditional, in my case, it was file MIME = pdf.
As I wanted it to ocr just files created/modified with 2ocr somewhere in its name (insert /2ocr/i in the box), it is usable for now.

@github-cli
Copy link

@kesselb did you ever get around to doing this?
still seems to be an issue though luckily after reading this, changing it to "is" instead of matches works for me but the error is not very intuitive

@szaimen
Copy link
Contributor

szaimen commented Jan 23, 2023

Hi, please update to 24.0.9 or better 25.0.3 and report back if it fixes the issue. Thank you!

My goal is to add a label like e.g. 25-feedback to this ticket of an up-to-date major Nextcloud version where the bug could be reproduced. However this is not going to work without your help. So thanks for all your effort!

If you don't manage to reproduce the issue in time and the issue gets closed but you can reproduce the issue afterwards, feel free to create a new bug report with up-to-date information by following this link: https://github.com/nextcloud/server/issues/new?assignees=&labels=bug%2C0.+Needs+triage&template=BUG_REPORT.yml&title=%5BBug%5D%3A+

@szaimen szaimen added needs info 0. Needs triage Pending check for reproducibility or if it fits our roadmap and removed 1. to develop Accepted and waiting to be taken care of labels Jan 23, 2023
@github-cli
Copy link

I dont have an issue with this anymore in general as after reading all this back when I had the issue I just know what I need to click and what that error actually means...
However I would love to help as far as I can...
I just tested this on 25.0.3 and selected "matches" PDF and it tells me that the regular expression is invalid.

@rotdrop
Copy link
Contributor

rotdrop commented Mar 2, 2023

Actually, when you choose "custom MIME type" you are facing a similar error. But this is a bogus user-interface: the placeholder suggests that you just can add "e.g. http/unix-directory". However, the placeholder suggestion is wrong, you need to enter a full-fledged regular expression, i.e. http/unix-directory does not work, but something like |http/unix-directory|.

I have no problems with entering a regular expression, but neither the placeholder nor the cryptic error message The given regular expression is invalid are of any help for directing the struggling user into the right direction.

I experienced this with a up-to-date v25 NC. Screenshots are appended

Screenshot_20230302_205807
Screenshot_20230302_205852
Screenshot_20230302_210938

@Nils160988
Copy link
Contributor

Still valid for NC 27.1.3

R0Wi added a commit that referenced this issue Jan 18, 2025
@R0Wi R0Wi linked a pull request Jan 18, 2025 that will close this issue
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap 25-feedback bug feature: workflows
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants