Project

General

Profile

User story #8323

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 almost 5 years ago. Updated over 4 years ago.

Status:
Released
Priority:
N/A
Category:
Technique editor - UI/UX
Target version:
Suggestion strength:
User visibility:
Effort required:

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

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

Updated by Nicolas CHARLES almost 5 years ago

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

#3

Updated by Nicolas CHARLES almost 5 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

#4

Updated by Nicolas CHARLES almost 5 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

#5

Updated by Jonathan CLARKE almost 5 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.

#6

Updated by Jonathan CLARKE almost 5 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.

#7

Updated by Raphael GAUTHIER almost 5 years ago

  • Status changed from New to In progress
#8

Updated by Raphael GAUTHIER almost 5 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
#9

Updated by Anonymous almost 5 years ago

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

Updated by Vincent MEMBRÉ over 4 years ago

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

Updated by Vincent MEMBRÉ over 4 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.

Also available in: Atom PDF