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

Skipping because provider prefetch failed #367

Open
andryua opened this issue Dec 16, 2024 · 7 comments
Open

Skipping because provider prefetch failed #367

andryua opened this issue Dec 16, 2024 · 7 comments

Comments

@andryua
Copy link

andryua commented Dec 16, 2024

Describe the Bug

After update Puppet agent to 8.10.0 version - I have issue with chocolatey provider

Steps to Reproduce

powershell or cmd
puppet agent -tdv

Environment

  • Version 2.4.1 (1.3.1)
  • Platform Windows 10 and Windows 11

Output:

> Debug: Prefetching windows resources for chocolateyfeature
> Debug: Gathering features from 'C:\ProgramData\chocolatey\config\chocolatey.config'.
> Error: Could not prefetch chocolateyfeature provider 'windows': Malformed XML: Content at the start of the document (got '')
> Line: 1
> Position: 47
> Last 80 unconsumed characters:
> <?xml version="1.0" encoding="utf-8"?>
> Warning: /Stage[main]/Windows::Chocolatey/Chocolateyfeature[allowEmptyChecksums]: Skipping because provider prefetch failed
> Debug: /Stage[main]/Windows::Chocolatey/Chocolateyfeature[allowEmptyChecksums]: Resource is being skipped, unscheduling all events
> Debug: Prefetching windows resources for chocolateyconfig
> Debug: Gathering sources from 'C:\ProgramData\chocolatey\config\chocolatey.config'.
> Error: Could not prefetch chocolateyconfig provider 'windows': Malformed XML: Content at the start of the document (got '')
> Line: 1
> Position: 47
> Last 80 unconsumed characters:
> <?xml version="1.0" encoding="utf-8"?>
> Warning: /Stage[main]/Windows::Chocolatey/Chocolateyconfig[cachelocation]: Skipping because provider prefetch failed
> Debug: /Stage[main]/Windows::Chocolatey/Chocolateyconfig[cachelocation]: Resource is being skipped, unscheduling all events
> Debug: Prefetching windows resources for chocolateysource
> Debug: Gathering sources from 'C:\ProgramData\chocolatey\config\chocolatey.config'.
> Line: 1
> Position: 47
> Last 80 unconsumed characters:
> <?xml version="1.0" encoding="utf-8"?>
> Warning: /Stage[main]/Windows::Chocolatey/Chocolateysource[chocolatey]: Skipping because provider prefetch failed
> Debug: /Stage[main]/Windows::Chocolatey/Chocolateysource[chocolatey]: Resource is being skipped, unscheduling all events
> Warning: /Stage[main]/Windows::Chocolatey/Chocolateysource[stable]: Skipping because provider prefetch failed
> Debug: /Stage[main]/Windows::Chocolatey/Chocolateysource[stable]: Resource is being skipped, unscheduling all events
> Warning: /Stage[main]/Windows::Chocolatey/Chocolateysource[testing]: Skipping because provider prefetch failed
> Debug: /Stage[main]/Windows::Chocolatey/Chocolateysource[testing]: Resource is being skipped, unscheduling all events
> Debug: Class[Windows::Chocolatey]: Resource is being skipped, unscheduling all events
@mhashizume
Copy link

This is also being tracked in puppetlabs/puppet#9532

@andryua
Copy link
Author

andryua commented Jan 6, 2025

puppet-chocolatey breaks chocolatey.config when modified

Debug: Prefetching windows resources for chocolateysource
Debug: Gathering sources from 'C:\ProgramData\chocolatey\config\chocolatey.config'.
Debug: Loaded source '{:name=>"chocolatey", :location=>"https://community.chocolatey.org/api/v2/", :ensure=>:present, :priority=>"0", :bypass_proxy=>false, :admin_only=>false, :allow_self_se
Notice: /Stage[main]/Windows::Chocolatey/Chocolateysource[chocolatey]/ensure: ensure changed 'present' to 'disabled'
Debug: Executing: '[redacted]'
Debug: Gathering sources from 'C:\ProgramData\chocolatey\config\chocolatey.config'.
Error: /Stage[main]/Windows::Chocolatey/Chocolateysource[chocolatey]: Could not evaluate: Malformed XML: Content at the start of the document (got '')
Line: 1
Position: 47
Last 80 unconsumed characters:
<?xml version="1.0" encoding="utf-8"?>
Debug: Gathering sources from 'C:\ProgramData\chocolatey\config\chocolatey.config'.
Error: /Stage[main]/Windows::Chocolatey/Chocolateysource[stable]: Could not evaluate: Malformed XML: Content at the start of the document (got '')
Line: 1
Position: 47
Last 80 unconsumed characters:
<?xml version="1.0" encoding="utf-8"?>
Debug: Gathering sources from 'C:\ProgramData\chocolatey\config\chocolatey.config'.
Error: /Stage[main]/Windows::Chocolatey/Chocolateysource[testing]: Could not evaluate: Malformed XML: Content at the start of the document (got '')
Line: 1
Position: 47
Last 80 unconsumed characters:
<?xml version="1.0" encoding="utf-8"?>
Debug: Prefetching windows resources for chocolateyfeature
Debug: Gathering features from 'C:\ProgramData\chocolatey\config\chocolatey.config'.
Error: Could not prefetch chocolateyfeature provider 'windows': Malformed XML: Content at the start of the document (got '')
Line: 1
Position: 47
Last 80 unconsumed characters:
<?xml version="1.0" encoding="utf-8"?>
Warning: /Stage[main]/Windows::Chocolatey/Chocolateyfeature[allowEmptyChecksums]: Skipping because provider prefetch failed
Debug: /Stage[main]/Windows::Chocolatey/Chocolateyfeature[allowEmptyChecksums]: Resource is being skipped, unscheduling all events
Debug: Prefetching windows resources for chocolateyconfig
Debug: Gathering sources from 'C:\ProgramData\chocolatey\config\chocolatey.config'.
Error: Could not prefetch chocolateyconfig provider 'windows': Malformed XML: Content at the start of the document (got '')
Line: 1
Position: 47
Last 80 unconsumed characters:
<?xml version="1.0" encoding="utf-8"?>
Warning: /Stage[main]/Windows::Chocolatey/Chocolateyconfig[cachelocation]: Skipping because provider prefetch failed
Debug: /Stage[main]/Windows::Chocolatey/Chocolateyconfig[cachelocation]: Resource is being skipped, unscheduling all events
Debug: Class[Windows::Chocolatey]: Resource is being skipped, unscheduling all events

@andryua
Copy link
Author

andryua commented Jan 6, 2025

after investigation - problem in REXML. Last working version is - 3.3.2. Newest version - puppet agent sending errors. (puppet agent 8.9.0 upgrated to rexml - 3.3.6)

@andryua andryua closed this as completed Jan 6, 2025
@andryua andryua reopened this Jan 27, 2025
@andryua
Copy link
Author

andryua commented Jan 27, 2025

ruby/rexml#231 (comment)
puppetlabs/puppet#9532 (comment)

its a problem, because that function open file in one string with BOM symbols, but if using this

config = REXML::Document.new File.open(choco_config)

it will be using UTF8 with BOM too (like chocolatey.config using) and puppet dont sent errors anymore (i tested by myself)
and one more thing - enabling UTF8 WorlWide support in windows 10/11 is not necessarily or

    config = nil
    File.open(choco_config) do |file|
        content = file.read
        config = REXML::Document.new(content)
    end

against

config = REXML::Document.new File.read(choco_config)

@andryua
Copy link
Author

andryua commented Jan 27, 2025

@andryua
Copy link
Author

andryua commented Feb 4, 2025

ruby/rexml#231 (comment)

@andryua
Copy link
Author

andryua commented Feb 6, 2025

https://github.com/ruby/rexml/issues/231#issuecomment-2638384021

i think, you must read this, please!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants