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

[Import/Export][Bug] Exporting alerts with faulty names #19655

Open
phospi opened this issue Dec 18, 2019 · 5 comments
Open

[Import/Export][Bug] Exporting alerts with faulty names #19655

phospi opened this issue Dec 18, 2019 · 5 comments

Comments

@phospi
Copy link

phospi commented Dec 18, 2019

Hi there,

I'm using cfme-rhconsulting-scripts to export cfme alerts. I observed that for every manageiq alert there is a file created where the filename == alertname. In manageiq it is perfectly fine to use every available unicode or special character to name the alert. However, when exporting such an alert name as a filename things become awkward. I know that UNIX-based filesystems are less bitchy about special characters. AFAIK, it is a best practice to avoid special characters in filenames. I guess that a lot of problems can arise from just copying any character in a filename without escaping special characters.

Issue 1:
I just tested that I can create alerts with 300 characters. As you might know, the maximum length for a file name is about 250 characters. Such alerts currently raise an OS error as you can see here:
Errno::ENAMETOOLONG: File name too long @ rb_sysopen - /MIQEXPORT/alerts/abcdoflkgndaslgndflskgnlgnregklmgknrkmgrkdfadflnafaidnsflasfjoewrjpaewmffklmöasfokaewrkdklgmvdvdmksflanofeawfmwpmfsolamfdsklfnkglw4eirnflaeiwnflawnfkawöolmfoö3ewmfkoaewöfmewolgnfklgneiwkgneiwrnfewnfewlianflasnflknaewflnaweflvnlwaenvlaewnflaewnglaewnflaewn.yaml

Issue 2:
We just had the issue that we exported an alert with the following special characters: ":<>%". When exporting this into git there was no issue but importing it again into a windows machine broke the git repository because the file name was truncated after ":".

I can't tell exactly where address this issue? I see two options.

First, we can change the way export functions work. I suggest exporting elements by id or guid. Does someone see a problem by doing so?

Second, manageiq could disallow the use of special characters in any name field inside of manageiq. Would this make sense or will this strongly impact the user experience?

Any suggestions on this issue?

Kind Regards,
phospi

@phospi
Copy link
Author

phospi commented Dec 19, 2019

Additional issue with the same cause:

rake aborted!
Errno::ENOENT: No such file or directory @ rb_sysopen - /tmp/miqexport/service_dialogs/My_not_so_nicely$%&amp;"%$&amp;%&/_named_dialog.yml
/var/www/miq/vmdb/lib/tasks/rhconsulting_dialogs.rake:10:in write' /var/www/miq/vmdb/lib/tasks/rhconsulting_dialogs.rake:10:in block in export'
/var/www/miq/vmdb/lib/tasks/rhconsulting_dialogs.rake:7:in each' /var/www/miq/vmdb/lib/tasks/rhconsulting_dialogs.rake:7:in export'
/var/www/miq/vmdb/lib/tasks/rhconsulting_dialogs.rake:160:in `block (3 levels) in <top (required)>'
Tasks: TOP => rhconsulting:service_dialogs:export
(See full trace by running task with --trace)

@phospi phospi changed the title [Bug] Exporting alerts with faulty names [Import/Export][Bug] Exporting alerts with faulty names Jan 10, 2020
@mfeifer mfeifer added the bug label Jan 30, 2020
@miq-bot miq-bot added the stale label Jun 11, 2020
@miq-bot
Copy link
Member

miq-bot commented Jun 11, 2020

This issue has been automatically marked as stale because it has not been updated for at least 3 months.

If you can still reproduce this issue on the current release or on master, please reply with all of the information you have about it in order to keep the issue open.

Thank you for all your contributions! More information about the ManageIQ triage process can be found in the traige process documentation.

@gtanzillo gtanzillo added pinned and removed stale labels Jul 13, 2020
@chessbyte
Copy link
Member

I don't understand the use case - why have a really long alert name? Maybe the code should limit the length on the alert name. Please re-open with more details.

@Fryguy
Copy link
Member

Fryguy commented Feb 18, 2021

Reopening as this issue covers all cases where automate objects are not exportable.

  • names that are valid characters in automate are not valid characters in files names
  • names are too long and break filesystem limits

See also #19702

@Fryguy Fryguy reopened this Feb 18, 2021
@Fryguy Fryguy added size/m and removed pinned labels May 3, 2021
@miq-bot miq-bot added the stale label Feb 27, 2023
@miq-bot
Copy link
Member

miq-bot commented Feb 27, 2023

This issue has been automatically marked as stale because it has not been updated for at least 3 months.

If you can still reproduce this issue on the current release or on master, please reply with all of the information you have about it in order to keep the issue open.

Thank you for all your contributions! More information about the ManageIQ triage process can be found in the triage process documentation.

@Fryguy Fryguy removed the stale label Mar 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants