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

Working directory 'C:/Program Files/Filebeat' does not exist #224

Open
cdenneen opened this issue Aug 12, 2019 · 7 comments · May be fixed by #333
Open

Working directory 'C:/Program Files/Filebeat' does not exist #224

cdenneen opened this issue Aug 12, 2019 · 7 comments · May be fixed by #333

Comments

@cdenneen
Copy link
Contributor

module version: 3.4.0

[mNotice: /Stage[main]/Filebeat::Install::Windows/Archive[C:/Windows/Temp/filebeat-6.8.2-windows-x86_64.zip]/ensure: download archive from https://artifactory.example.com/beats-windows/filebeat/filebeat-6.8.2-windows-x86_64.zip to C:/Windows/Temp/filebeat-6.8.2-windows-x86_64.zip  without cleanup�[0m
[mNotice: /Stage[main]/Filebeat::Install::Windows/Exec[unzip filebeat-6.8.2-windows-x86_64]/returns: executed successfully�[0m
[mNotice: /Stage[main]/Filebeat::Install::Windows/File[C:/Windows/Temp/filebeat-6.8.2-windows-x86_64.zip]/ensure: removed�[0m
[mNotice: /Stage[main]/Filebeat::Install::Windows/Exec[rename filebeat-6.8.2-windows-x86_64]/returns: executed successfully�[0m
[mNotice: /Stage[main]/Filebeat::Install::Windows/Exec[mark filebeat-6.8.2-windows-x86_64]/returns: executed successfully�[0m
[1;31mError: /Stage[main]/Filebeat::Install::Windows/Exec[install filebeat-6.8.2-windows-x86_64]: Failed to call refresh: Working directory 'C:/Program Files/Filebeat' does not exist�[0m
[1;31mError: /Stage[main]/Filebeat::Install::Windows/Exec[install filebeat-6.8.2-windows-x86_64]: Working directory 'C:/Program Files/Filebeat' does not exist�[0m
[1;31mError: Cannot create C:/Program Files/Filebeat/conf.d; parent directory C:/Program Files/Filebeat does not exist�[0m
[1;31mError: /Stage[main]/Filebeat::Config/File[filebeat-config-dir]/ensure: change from absent to directory failed: Cannot create C:/Program Files/Filebeat/conf.d; parent directory C:/Program Files/Filebeat does not exist�[0m

This is definitely an ordering issue because the second run works fine. I'm just trying to track down which resource is the culprit.

@cdenneen
Copy link
Contributor Author

@pcfens I do not use chocolatey and install 7zip prior to this step.
So I'm guessing this works for people who use chocolatey vs those using 7zip.

if that's the case maybe a boolean of use_chocolatey or use_7zip that would allow for extract => true parameter to archive and wrapping around the unzip command that doesn't seem to be working in my case.

https://github.com/pcfens/puppet-filebeat/blob/master/manifests/install/windows.pp#L40-L47

@pcfens
Copy link
Owner

pcfens commented Aug 13, 2019

If it's possible to resolve the dependency issue without requiring a specific piece of software then I think that's a good thing, but since I'm not a Windows person at all I'm not sure what's reasonable on that front and what isn't.

I don't know if @edestecd is still around, but his comments might be helpful since he's the original author of this (and included a comment about it).

I read the comment as though any unzip package will work with the current implementation, but the archive module requires 7zip. By not using the archive module's built in feature users are free to use whichever unzip tool they like.

@edestecd
Copy link
Contributor

This should have nothing to do with 7zip or chocolatey as far as i can see. Neither is used here.
Powershell commands are used to unzip the archive.

@edestecd
Copy link
Contributor

All the proper requires are used here. I have experienced some "lag" in windows file manipulation in the past. This is my guess. I don't really know how to fix this as it seems like an underlying os or puppet issue.

@cdenneen
Copy link
Contributor Author

@edestecd not sure. It constantly is failing for my users trying to apply configuration that the parent directory of C:\Program Files\Filebeat doesn’t exist. (install_dir)

@freibuis
Copy link
Contributor

I can confirm this. it looks like provider => powershell, is taking too long

this is weird filebeat installer should also create the directory and the config should wait any way.

Personally, Filebeat should be putting conf files in the ProgramsData location anyway.
ProgramsData\Filebeat\conf.d
and the data directory should be in the
ProgramsData\Filebeat\data
thats my op

maybe on windows decouple the conf from the Program Files\Filebeat\ and place it into ProgramsData\Filebeat\ ? I know this is opinionated tho

@dannygoulder
Copy link

I've seen a similar issue with the metricbeat module. I've seen the note in the install module about the archive module requiring 7-zip to be installed but this isn't strictly true (at least not any more). The archive resource will happily unzip a .zip file using PowerShell (and as a bonus clean up after itself). If 7-zip is installed it will use that instead so it'll be faster.

Today I submitted a PR to the metricbeat module which allows the behaviour to be configurable - feel free to take it if it's possible that this may help with this issue (since it means that the archive resource will unzip and cleanup in one fell swoop).

@trunet trunet linked a pull request Aug 25, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants