Project

General

Profile

Actions

User story #8323

closed

Bug #8261: Warn when the string length reaches the maximum value supported by the agent

Limit the length of technique names

Added by Alexis Mousset over 8 years ago. Updated over 2 years ago.

Status:
Released
Priority:
N/A
Category:
Web - Technique editor
Target version:
UX impact:
Suggestion strength:
User visibility:
Effort required:
Name check:
Fix check:
Regression:

Description

Technique names are used in the technique filename, and must stay in the limits of maximum filename length of filesystems used on supported platforms. Currently there is an error when saving the technique if the name is too long for the server filesystem, but we should test on Windows especially that the limit for the complete path is not reached within CFEngine when using long technique names.

We should keep in mind that some people may be using name around the limit, and cannot easily change the name that was given at the creation of the technique, so this limit should probably be applied only on new techniques.

An Error occured! Unknown internal error during technique writing
Details: Cause: [Errno 36] File name too long: '/var/rudder/configuration-repository/ncf/50_techniques/8261826182618261826182618261826182618261826182618261826182618261826182618261826182618261826182618261826182618261826182618261826182618261826182618261826182618261826182618261826182618261826182618261826182618261826182618261826182618261826182618261826182618261' Traceback (most recent call last): File "/usr/share/ncf/api/ncf_api_flask_app/views.py", line 147, in create_technique ncf.write_technique(technique,path) File "/usr/share/ncf/tools/ncf.py", line 539, in write_technique os.makedirs(os.path.dirname(filename)) File "/usr/lib64/python2.6/os.py", line 157, in makedirs mkdir(name, mode) OSError: [Errno 36] File name too long: '/var/rudder/configuration-repository/ncf/50_techniques/8261826182618261826182618261826182618261826182618261826182618261826182618261826182618261826182618261826182618261826182618261826182618261826182618261826182618261826182618261826182618261826182618261826182618261826182618261826182618261826182618261826182618261'

Subtasks 1 (0 open1 closed)

User story #8465: Limit length of technique names to 100 chars in the ncf apiReleasedFrançois ARMANDActions
Actions #2

Updated by Nicolas CHARLES over 8 years ago

limit for filename on AIX is 256 char, but no limit on effective path (at least, it's much bigger than 1k)

Actions #3

Updated by Nicolas CHARLES over 8 years ago

Paths on windows are
c:\Program Files\Cfengine\inputs for ncf techniques in 3.2
c:\Program Files\Rudder\var\ncf\local\ in 3.1 and before

Actions #4

Updated by Nicolas CHARLES over 8 years ago

since total path limit is 260 char, name of technique is also name of folder, we have a max value of
c:\Program Files\Rudder\var\ncf\local\TECH_NAME\1.0\TECH_NAME.cf

Technique name = (260-47) / 2 = 106 characters

Actions #5

Updated by Jonathan CLARKE over 8 years ago

Nicolas CHARLES wrote:

since total path limit is 260 char, name of technique is also name of folder, we have a max value of
c:\Program Files\Rudder\var\ncf\local\TECH_NAME\1.0\TECH_NAME.cf

Technique name = (260-47) / 2 = 106 characters

OK, let's limit to 100 chars.

Actions #6

Updated by Jonathan CLARKE over 8 years ago

  • Assignee set to Raphael GAUTHIER

We will add in the Technique editor a warning that says "Warning: technique names longer than 100 characters may not work on some filesystems (Windows, in particular)."

It should be possible to ignore the warning and save anyway.

Actions #7

Updated by Raphael GAUTHIER over 8 years ago

  • Status changed from New to In progress
Actions #8

Updated by Raphael GAUTHIER over 8 years ago

  • Status changed from In progress to Pending technical review
  • Assignee changed from Raphael GAUTHIER to Vincent MEMBRÉ
  • Pull Request set to https://github.com/Normation/ncf/pull/390
Actions #9

Updated by Anonymous over 8 years ago

  • Status changed from Pending technical review to Pending release
  • % Done changed from 0 to 100
Actions #10

Updated by Vincent MEMBRÉ over 8 years ago

  • Category set to Technique editor - UI/UX
Actions #11

Updated by Vincent MEMBRÉ over 8 years ago

  • Status changed from Pending release to Released

This bug has been fixed in ncf version bundled with Rudder 2.11.24, 3.1.13 and 3.2.6 which were released today.

Actions #12

Updated by Alexis Mousset over 2 years ago

  • Target version changed from 0.x to ncf-0.x
Actions #13

Updated by Alexis Mousset over 2 years ago

  • Category set to Web - Technique editor
Actions

Also available in: Atom PDF