Bug 1489785 - [WIN] When applying CP from deep directory structure an The directory name is too long err is thrown
Summary: [WIN] When applying CP from deep directory structure an The directory name is...
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: JBoss Operations Network
Classification: JBoss
Component: Launch Scripts
Version: JON 3.3.9
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: JON 3.3.11
Assignee: Josejulio Martínez
QA Contact: Mike Foley
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-09-08 11:36 UTC by Filip Brychta
Modified: 2018-04-19 14:49 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-04-19 14:49:22 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
update log (1.46 MB, text/plain)
2017-09-08 11:36 UTC, Filip Brychta
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1294626 0 high CLOSED Path too long error on unzipping the patch using Extract All on Windows Server 2008 R2 2021-02-22 00:41:40 UTC

Internal Links: 1294626

Description Filip Brychta 2017-09-08 11:36:25 UTC
Created attachment 1323697 [details]
update log

Description of problem:
Following error is thrown when applying patch from deep directory structure like c:\Program Files\reeeeeeeeeealy-very-long-path\jon-server-3.3.0.GA-update-09>app
ly-updates.bat

The directory name c:\Program Files\reeeeeeeeeealy-very-long-path\jon-server-3.3
.0.GA-update-09\jon-server-updates\modules\org\rhq\server-startup\main\deploymen
ts\rhq.ear\rhq-portal.war\WEB-INF\classes\org\rhq\enterprise\gui\legacy\action\r
esource\common\monitor\alerts\config\condition is too long.

Version-Release number of selected component (if applicable):
JON 3.3.9.DR01 but very probably in previous versions as well

How reproducible:
Always

Steps to Reproduce:
1. extract jon server to e.g. c:\jon-server-3.3.0.GA\
2. extract CP9 to c:\Program Files\reeeeeeeeeealy-very-long-path\jon-server-3.3
.0.GA-update-09\
3. apply the patch: apply-updates.bat c:\jon-server-3.3.0.GA\jon-server-3.3.0.GA

Actual results:
c:\Program Files\reeeeeeeeeealy-very-long-path\jon-server-3.3.0.GA-update-09>app
ly-updates.bat c:\jon-server-3.3.0.GA\jon-server-3.3.0.GA
[Fri 09/08/2017 11:09:43.17] Starting Update
Detected 'jon-server-updates.zip' has not yet been unpacked. Extracting. This ma
y take a few moments...

  Successfully detected server to update [c:\jon-server-3.3.0.GA\jon-server-3.3.
0.GA]
  Proceeding with application of patch [09] to [c:\jon-server-3.3.0.GA\jon-serve
r-3.3.0.GA]

  Did not detect agent to update at [c:\jon-server-3.3.0.GA\jon-server-3.3.0.GA\
..\rhq-agent]
  Assessing permissions needed during update process....
The directory name c:\Program Files\reeeeeeeeeealy-very-long-path\jon-server-3.3
.0.GA-update-09\jon-server-updates\modules\org\rhq\server-startup\main\deploymen
ts\rhq.ear\rhq-portal.war\WEB-INF\classes\org\rhq\enterprise\gui\legacy\action\r
esource\common\monitor\alerts\config\condition is too long.
  No installed JON Server was found. Bypassing shut down check.

  Certain patch files can not be overwritten due to name changes. These
  files are being archived.
  Archived server files will be moved to [c:\jon-server-3.3.0.GA\jon-server-3.3.
0.GA\.patched\090817110943\.old].
  See c:\jon-server-3.3.0.GA\jon-server-3.3.0.GA\.patched\090817110943\update.lo
g for more archive details.


  Applying JON Server updates...

  Applying additional JON Server updates...

  We detected a 'JON server' that had not yet been initialized/installed.
  You have successfully extracted updated installation contents into the 'JON se
rver'.
  You should now proceed with installation/upgrade of JON servers as is appropri
ate.


Expected results:
No errors

Additional info:
The patch was applied successfully and installation of jon server afterwards was successful as well.
update.log is attached
Have not checked yet but it's probably not a regression and the issue is there for a long time.

Comment 1 Josejulio Martínez 2018-01-19 22:35:48 UTC
It seems that the errors are given by the following command:

dir /a-r /s /b "%PATCH_HOME%\jon-server-updates"

The output of this command is used to verify if we have write permissions on the files and halt the updates if any file doesn't have write permission.

This bug removes that capability for files that are about 260+ characters (I read somewhere 256).
So if the PATCH_HOME is 260 characters long, it would skip that check for all the files.

I'm not aware of any alternatives for `dir`, our only alternative would be detecting if the `dir` command failed and create a custom (java) application to output the files.
Still, need to check if the commands to check if the file is writable don't fail (they might do), if so, the custom java application might need to take care of that check too.

Comment 2 Josejulio Martínez 2018-01-19 23:38:12 UTC
Calling ATTRIB on a "too long" directory or any of its contents, yields:

Parameter format not correct -

Will migrate the whole write check to java

Comment 6 Filip Brychta 2018-04-19 14:49:22 UTC
Triage: Larry, Simeon, Filip - not a customer issue, fix could be risky -> closing as won't fix


Note You need to log in before you can comment on or make changes to this bug.