Closed kenhys closed 9 months ago
This PR still not work correctly yet. checking log...
Installed to c:\Program Files
:
Then check fluentdopt:
Could run manually:
I'm checking the package behavior...
I failed to install the package to C:\Dummy Program Files (FOO)\
.
I'm checking the cause.
I checked the log.
InstallFluentdWinSvc
is failing.
$ msiexec /i fluent-package-5.0.1-x64.msi /l* installer.log
Action 12:39:40: InstallFluentdWinSvc.
WixQuietExec64: \fluent\..\ の使い方が誤っています。
WixQuietExec64: Error 0x800700ff: Command line returned an error.
WixQuietExec64: Error 0x800700ff: QuietExec64 Failed
WixQuietExec64: Error 0x800700ff: Failed in ExecCommon method
CustomAction InstallFluentdWinSvc returned actual error code 1603 (note this may not be 100% accurate if translation happened inside sandbox)
Action ended 12:39:40: InstallFinalize. Return value 3.
Action 12:39:40: Rollback. Rolling back action:
Rollback: InstallFluentdWinSvc
Rollback: Copying new files
Rollback: Creating folders
Rollback: Updating component registration
Action ended 12:40:10: INSTALL. Return value 3.
Action ended 12:40:10: ExecuteAction. Return value 3.
Action 12:40:10: FatalError.
Action start 12:40:10: FatalError.
Action 12:40:10: FatalError. Dialog created
Action ended 12:40:12: FatalError. Return value 2.
Action ended 12:40:12: INSTALL. Return value 3.
Are there Executing op:
log? /l*v
option will enable such feature.
Are there Executing op: log? /l*v option will enable such feature.
Reproduced. got same log.
assets/fluentd.bat cause it.
I think this is completely another issue. I will create another issue later. We should handle this separately from this PR.
()
.delayed environment variable
mechanism of BATCH.I think this is the smallest script to reproduce:
/path/to/foo(bar)/test.bat
@echo off
if "a" == "b" (
echo %~dp0
)
$ .\test.bat
\ was unexpected at this time.
Continue to check the behavior when the installed path including spaces.
bca8ebf967b25d6097271cac35d468fcc088f7fd
I see!
Certainly, "
will solve this problem.
I think this is completely another issue. I will create another issue later. We should handle this separately from this PR.
* This rollback occurs when the path includes `()`. * This is caused by the `delayed environment variable` mechanism of BATCH.
I think this is the smallest script to reproduce:
/path/to/foo(bar)/test.bat
@echo off if "a" == "b" ( echo %~dp0 )
$ .\test.bat \ was unexpected at this time.
Thanks!
/path/to/foo(bar)/test.bat
@echo off
if "a" == "a" (
echo "%~dp0"
)
$ .\test.bat
"C:\path\to\foo(bar)\"
Continue to check the behavior when the installed path including spaces.
Installed path: C:\Dummy Program Files\
Something seems wrong with fluent-gem
.
Looks like calling fluent-gem
breaking the environment.
Fluent Package Command Prompt
with administrative privileges:
C:\Windows\system32>fluentd --version
fluent-package 5.0.1 fluentd 1.16.2 (d5685ada81ac89a35a79965f1e94bbe5952a5d3a)
C:\Windows\system32>fluent-gem --version
'C:\Dummy' は、内部コマンドまたは外部コマンド、
操作可能なプログラムまたはバッチ ファイルとして認識されていません。
'C:\Dummy' は、内部コマンドまたは外部コマンド、
操作可能なプログラムまたはバッチ ファイルとして認識されていません。
C:\Windows\system32>fluent-gem --version
C:/Dummy Program Files/fluent/lib/ruby/3.2.0/rubygems.rb:263:in `find_spec_for_exe': can't find gem fluentd (>= 0.a) with executable fluent-gem (Gem::GemNotFoundException)
from C:/Dummy Program Files/fluent/lib/ruby/3.2.0/rubygems.rb:282:in `activate_bin_path'
from C:/Dummy Program Files/fluent/bin/fluent-gem:32:in `<main>'
C:\Windows\system32>fluentd --version
C:/Dummy Program Files/fluent/lib/ruby/3.2.0/rubygems.rb:263:in `find_spec_for_exe': can't find gem fluentd (>= 0.a) with executable fluentd (Gem::GemNotFoundException)
from C:/Dummy Program Files/fluent/lib/ruby/3.2.0/rubygems.rb:282:in `activate_bin_path'
from C:/Dummy Program Files/fluent/bin/fluentd:32:in `<main>'
Yes fluent-gem also has same issue.
Oh, is it the same issue? I don't completely understand the mechanism... OK, I will check the behavior again after the new package is built!
f1dd645 has still issues...
It should be delims=
.
Now fluent-gem will work.
Thanks. I'm checking the package.
Finally, I understood the mechanism of \ was unexpected at this time.
error.
/path/to/foo(bar)/test.bat
@echo off if "a" == "b" ( echo %~dp0 )
$ .\test.bat \ was unexpected at this time.
delayed environment variable
has nothing to do with this error.
Is is simply because the ()
of the path breaks the if ()
block.
In the above case, echo %~dp0
will be echo /path/to/foo(bar)/
.
So, the script will be equivalent to the following.
@echo off
if "a" == "b" (
echo /path/to/foo(bar)/
)
The error occurs simlply becaues this script is broken.
We can workaround this by "
.
Hmm, I thought there was no problem, but I have noticed that I can not run Fluentd in Fluent Package Command Prompt... I'm checking the cause.
$ fluentd
C:/Dummy Program Files (FOO)/fluent/lib/ruby/gems/3.2.0/gems/fluentd-1.16.2/lib/fluent/config.rb:43:in `initialize': Invalid argument @ rb_sysopen - "C:/Dummy Program Files (FOO)/fluent//etc/fluent/fluentd.conf" (Errno::EINVAL)
from C:/Dummy Program Files (FOO)/fluent/lib/ruby/gems/3.2.0/gems/fluentd-1.16.2/lib/fluent/config.rb:43:in `open'
from C:/Dummy Program Files (FOO)/fluent/lib/ruby/gems/3.2.0/gems/fluentd-1.16.2/lib/fluent/config.rb:43:in `build'
from C:/Dummy Program Files (FOO)/fluent/lib/ruby/gems/3.2.0/gems/fluentd-1.16.2/lib/fluent/supervisor.rb:682:in `setup_global_logger'
from C:/Dummy Program Files (FOO)/fluent/lib/ruby/gems/3.2.0/gems/fluentd-1.16.2/lib/fluent/supervisor.rb:624:in `configure'
from C:/Dummy Program Files (FOO)/fluent/lib/ruby/gems/3.2.0/gems/fluentd-1.16.2/lib/fluent/command/fluentd.rb:351:in `<top (required)>'
from <internal:C:/Dummy Program Files (FOO)/fluent/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
from <internal:C:/Dummy Program Files (FOO)/fluent/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
from C:/Dummy Program Files (FOO)/fluent/lib/ruby/gems/3.2.0/gems/fluentd-1.16.2/bin/fluentd:15:in `<top (required)>'
from C:/Dummy Program Files (FOO)/fluent/bin/fluentd:32:in `load'
from C:/Dummy Program Files (FOO)/fluent/bin/fluentd:32:in `<main>'
Thanks! I'll check it.
Isn't it caused by not applying this?
https://github.com/fluent/fluent-package-builder/pull/589#discussion_r1335325513
Isn't it caused by not applying this?
maybe that's it. Thanks.
With https://github.com/fluent/fluent-package-builder/commit/e26df3fced2606fb60edc3fc7c35f1d4de338f4a, surely unexpected rollback was fixed.
And more, from fluent package prompt with admin also works.
What do you think about https://github.com/fluent/fluent-package-builder/pull/589#discussion_r1335315312?
It seems work as expected.
Thanks! I will check the built package briefly, just in case.
Thanks, I'll fix it.
Revised commit message.
Thanks!
When installing fluent-package to c:\Program Files, the space character must be escaped correctly.
sources.wxs
"cmd" /c "fsutil ... "c:\Program Files .." "c:\Program Files...""
fluentd.bat,fluent-gem.bat
^""C:\..." ....^"
literal are evaluated ^""C:..."^".