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

rabbitmq-service.bat install failed on folder which has "(" or ")" in the name #1756

Closed
LadaVarga opened this issue Nov 1, 2018 · 14 comments
Assignees
Labels
bug pkg-windows An issue specific to Windows
Milestone

Comments

@LadaVarga
Copy link

LadaVarga commented Nov 1, 2018

  • RabbitMQ version: 3.7.8
  • Erlang version: 21.1
  • OS: Windows

STR
When Deploy RabbitMQ server to non-system drive with disabled 8do3 creation (Check: fsutil 8dot3name query e:)
and Folders has "(" or ")"
Examples:
*8dot3name disabled + e:\program files (x64)\yourcomapnyname\123456789111\rabbitmq_server-3.7.8\sbin*
**8dot3name enabled + c:\h(hj)\yourcomapnyname\123456789111\rabbitmq_server-3.7.8\sbin\ **
and Run "rabbitmq-service.bat install"
Then error thrown:
\yourcomapnyname\123456789111\rabbitmq_server-3.7.8\plugins was unexpected at this time.
2018-11-01 20_02_20-window

During the investigation we figured out there is problem with these lines:
https://github.com/rabbitmq/rabbitmq-server/blob/master/scripts/rabbitmq-env.bat#L459-L468
2018-11-01 19_47_22-window

Solution
Don't know.

Workaround
rem line or remove whole ascii check section (we don't have problem with previous version in that area at all and it is used by thousands of customers)
call :filter_paths "%ERL_LIBS_orig%"

@LadaVarga LadaVarga changed the title rabbitmq-service.bat install failed on drive with disabled 8dot3 creation and folders longer than 8characters and "()" rabbitmq-service.bat install failed on folder which has "(" or ")" in the name Nov 2, 2018
@callofktulu
Copy link

callofktulu commented May 13, 2019

Greetings. Can you please confirm this issue is still happening with the latest version of rabbitmq-env.bat? Thank you!

@LadaVarga
Copy link
Author

Hello,
Was that fixed in the new releases? We still use workaround.

Workaround:
rem line or remove whole ascii check section (we don't have problem with previous version in that area at all and it is used by thousands of customers)
call :filter_paths "%ERL_LIBS_orig%"

@michaelklishin
Copy link
Member

Relevant PR pending QA: #1979. Note that anyone can give it a shot and share the findings.

@callofktulu
Copy link

Hello @michaelklishin #1979 pull request is not fixing this issue. I tried applying the changes of this pull request on rabbitmq-env.bat on a folder that has "(" and ")" characters and I still get "[foldername] was unexpected at this time." error.

@lukebakken
Copy link
Collaborator

@callofktulu please attach your complete, un-altered rabbitmq-env-conf.bat file.

@LadaVarga - it is very unlikely that we will support drives that have disabled 8.3 file names any time soon.

Deploy RabbitMQ server to non-system drive with disabled 8do3 creation (Check: fsutil 8dot3name query e:)

@LadaVarga
Copy link
Author

@lukebakken Non-system drives has disabled 8dot3name by default in Windows. Many of our customers have "program files (x86)" in non-system drives.

@lukebakken
Copy link
Collaborator

@LadaVarga a workaround is to use directories that don't contain problematic characters. The .exe installer supports the /D argument to specify the installation directory.

@LadaVarga
Copy link
Author

@lukebakken as I wrote, we have the workaround. We will upgrade to newer version soon, we will see if we can fix it.

@strollo
Copy link

strollo commented May 16, 2019

The easiest way is to enable (as administrator) the 8dot3name support on E: with
fsutil 8dot3name set E: 0

but it works only on extended paths created once this flag has been enabled, so for already existing paths does not work

@strollo
Copy link

strollo commented May 16, 2019

Maybe the same trick of quote (for supporting extented path) and after unquote proposed in PR #1979 can be applied in this part of code like this...

Note: set ERL_LIBS="%~dpnx1" is the short form of %~dps1%~n1%~x1 and the s (short path form has been removed)

REM Ensure all paths in ERL_LIBS do not contains non-ASCII characters.
set ERL_LIBS_orig=%ERL_LIBS%
set ERL_LIBS=
REM 1) Use quotes to apply to full win paths
call :filter_paths "%ERL_LIBS_orig%"
REM 2) Remove quotes from converted path
CALL :unquote ERL_LIBS "%ERL_LIBS:"=%"
REM echo "After unquote ERL_LIBS: %ERL_LIBS%"
goto :filter_paths_done

:filter_paths
set paths=%1
set paths=%paths:"=%
for /f "tokens=1* delims=;" %%a in ("%paths%") do (
if not "%%a" == "" call :filter_path "%%a"
if not "%%b" == "" call :filter_paths "%%b"
)
set paths=
exit /b

:filter_path
REM Ensure ERL_LIBS begins with valid path
IF "%ERL_LIBS%"=="" (
set ERL_LIBS="%~dpnx1"
) else (
set ERL_LIBS="%ERL_LIBS%;%~dpnx1"
)
exit /b

strollo added a commit to strollo/rabbitmq-server that referenced this issue May 18, 2019
strollo added a commit to strollo/rabbitmq-server that referenced this issue May 18, 2019
In particular needed when installing on drives with no 8dot3 flag enabled.

Includes PR rabbitmq#1979
Fixes: Bug rabbitmq#1756
@lukebakken lukebakken self-assigned this Aug 7, 2019
@lukebakken lukebakken added bug pkg-windows An issue specific to Windows labels Aug 7, 2019
@lukebakken
Copy link
Collaborator

lukebakken commented Aug 29, 2019

Fixed by #2088 and will ship in RabbitMQ 3.7.18

@lukebakken lukebakken added this to the 3.7.18 milestone Aug 29, 2019
@twjs76
Copy link
Contributor

twjs76 commented Jun 5, 2020

This issue seems to appear again on 3.8.4, I was able to reproduce it with the standard installer. It looks like it was brought back in through d3bd7d7

The following if in rabbitmq-env.bat seems to be problematic:

if defined ERL_LIBS (
    set ERL_LIBS=%RABBITMQ_HOME%\plugins;%ERL_LIBS%
) else (
    set ERL_LIBS=%RABBITMQ_HOME%\plugins
)

If %RABBITMQ_HOME% contains parenthesis, then the script will exit with the ... was unexpected at this time. error

@michaelklishin
Copy link
Member

@twjs76 if you understand what the root cause is, please submit a PR. Thank you.

@lukebakken
Copy link
Collaborator

@twjs76 thank you for your contribution.

@lukebakken lukebakken modified the milestones: 3.7.18, 3.8.5 Jun 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug pkg-windows An issue specific to Windows
Projects
None yet
Development

No branches or pull requests

6 participants