User story #8323
closedBug #8261: Warn when the string length reaches the maximum value supported by the agent
Limit the length of technique names
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'
Updated by Nicolas CHARLES over 8 years ago
Limit for full path on windows is 260 chars
http://news.softpedia.com/news/microsoft-removes-260-characters-path-length-limit-in-windows-10-redstone-504596.shtml
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)
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
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
Updated by Jonathan CLARKE about 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.cfTechnique name = (260-47) / 2 = 106 characters
OK, let's limit to 100 chars.
Updated by Jonathan CLARKE about 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.
Updated by Raphael GAUTHIER about 8 years ago
- Status changed from New to In progress
Updated by Raphael GAUTHIER about 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
Updated by Anonymous about 8 years ago
- Status changed from Pending technical review to Pending release
- % Done changed from 0 to 100
Applied in changeset commit:8b476173d79e3a8ce261f3a67bfa9e27348cfa0b.
Updated by Vincent MEMBRÉ about 8 years ago
- Category set to Technique editor - UI/UX
Updated by Vincent MEMBRÉ about 8 years ago
- Status changed from Pending release to Released
Updated by Alexis Mousset over 2 years ago
- Target version changed from 0.x to ncf-0.x
Updated by Alexis Mousset over 2 years ago
- Category set to Web - Technique editor