What does "Could not prefetch package provider ''apt'': invalid byte sequence in US-ASCII" mean exactly? This started showing up in the logs of some of my servers... -- Peter L. Berghold Salty.Cowdawg@gmail.com http://blog.berghold.net -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users. For more options, visit https://groups.google.com/groups/opt_out.
> From: puppet-users@googlegroups.com [mailto:puppet- > users@googlegroups.com] On Behalf Of Peter Berghold> What does "Could not prefetch package provider ''apt'': invalid byte > sequence in US-ASCII" mean exactly? This started showing up in the logs > of some of my servers...If a file is being interpreted as US-ASCII, then it is expected to have no characters with the high bit set. If you edited any source files with an Unicode editor, it may have changed some of your punctuatiuon to fancy Unicode versions of that punctuation (e.g. a pair of quotes to "left quote" and "right quote"), which the interpreter would not understand. Blind stab: If you save a file as type "UTF-8" on Windows, a BOM will be inserted as the first character in the file. Make sure you save as ASCII. HTH, Mike -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users. For more options, visit https://groups.google.com/groups/opt_out.
Now I''m really confused... I use emacs and vi exclusively and neither of those should be US-ASCII. This leads me to wonder which file. Is it the provider itself or ??? On Tue, Oct 1, 2013 at 2:57 PM, Ayers, Mike <Mike_Ayers@cable.comcast.com>wrote:> > From: puppet-users@googlegroups.com [mailto:puppet- > > users@googlegroups.com] On Behalf Of Peter Berghold > > > What does "Could not prefetch package provider ''apt'': invalid byte > > sequence in US-ASCII" mean exactly? This started showing up in the logs > > of some of my servers... > > If a file is being interpreted as US-ASCII, then it is expected to > have no characters with the high bit set. If you edited any source files > with an Unicode editor, it may have changed some of your punctuatiuon to > fancy Unicode versions of that punctuation (e.g. a pair of quotes to "left > quote" and "right quote"), which the interpreter would not understand. > > Blind stab: If you save a file as type "UTF-8" on Windows, a BOM > will be inserted as the first character in the file. Make sure you save as > ASCII. > > > HTH, > > Mike > > -- > You received this message because you are subscribed to the Google Groups > "Puppet Users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to puppet-users+unsubscribe@googlegroups.com. > To post to this group, send email to puppet-users@googlegroups.com. > Visit this group at http://groups.google.com/group/puppet-users. > For more options, visit https://groups.google.com/groups/opt_out. >-- Peter L. Berghold Salty.Cowdawg@gmail.com http://blog.berghold.net -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users. For more options, visit https://groups.google.com/groups/opt_out.
Actually, the ruby code for the apt provider is UTF-8 (most probably it has the BOM at the beginning). Puppet will ONLY run under an UTF-8 using locale. This is thanks to the "Great Idea[tm]" of the ruby interpreter that only allows source code in the locale of the running process. Regards, David On 2013-10-01 21:39, Peter Berghold wrote:> Now I''m really confused... I use emacs and vi exclusively and neither of > those should be US-ASCII. This leads me to wonder which file. Is it the > provider itself or ??? > > > > On Tue, Oct 1, 2013 at 2:57 PM, Ayers, Mike > <Mike_Ayers@cable.comcast.com <mailto:Mike_Ayers@cable.comcast.com>> wrote: > > > From: puppet-users@googlegroups.com > <mailto:puppet-users@googlegroups.com> [mailto:puppet- <mailto:puppet-> > > users@googlegroups.com <mailto:users@googlegroups.com>] On Behalf > Of Peter Berghold > > > What does "Could not prefetch package provider ''apt'': invalid byte > > sequence in US-ASCII" mean exactly? This started showing up in > the logs > > of some of my servers... > > If a file is being interpreted as US-ASCII, then it is > expected to have no characters with the high bit set. If you edited > any source files with an Unicode editor, it may have changed some of > your punctuatiuon to fancy Unicode versions of that punctuation > (e.g. a pair of quotes to "left quote" and "right quote"), which the > interpreter would not understand. > > Blind stab: If you save a file as type "UTF-8" on Windows, > a BOM will be inserted as the first character in the file. Make > sure you save as ASCII. > > > HTH, > > Mike > > -- > You received this message because you are subscribed to the Google > Groups "Puppet Users" group. > To unsubscribe from this group and stop receiving emails from it, > send an email to puppet-users+unsubscribe@googlegroups.com > <mailto:puppet-users%2Bunsubscribe@googlegroups.com>. > To post to this group, send email to puppet-users@googlegroups.com > <mailto:puppet-users@googlegroups.com>. > Visit this group at http://groups.google.com/group/puppet-users. > For more options, visit https://groups.google.com/groups/opt_out. > > > > > -- > > Peter L. Berghold Salty.Cowdawg@gmail.com <mailto:Salty.Cowdawg@gmail.com> > > http://blog.berghold.net > > -- > You received this message because you are subscribed to the Google > Groups "Puppet Users" group. > To unsubscribe from this group and stop receiving emails from it, send > an email to puppet-users+unsubscribe@googlegroups.com. > To post to this group, send email to puppet-users@googlegroups.com. > Visit this group at http://groups.google.com/group/puppet-users. > For more options, visit https://groups.google.com/groups/opt_out.-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users. For more options, visit https://groups.google.com/groups/opt_out.
I also have been experiencing this same issue since puppet version 3.3.0-1 (latest) as well as with RC2 in the devel repo. With the previous version of 3.2.4-1 this behaviour was not present. After doing some testing/research the other day, I found that if you force locales to en_US.UTF-8 before you run, the problem goes away (see below). [simon@ns2(~)> sudo puppet agent --test [sudo] password for simon: Info: Retrieving plugin Info: Loading facts in /var/lib/puppet/lib/facter/memorysize_raw.rb Info: Loading facts in /var/lib/puppet/lib/facter/augeasversion.rb Info: Loading facts in /var/lib/puppet/lib/facter/root_home.rb Info: Loading facts in /var/lib/puppet/lib/facter/puppet_vardir.rb Info: Loading facts in /var/lib/puppet/lib/facter/facter_dot_d.rb Info: Loading facts in /var/lib/puppet/lib/facter/etcpasswd.rb Info: Loading facts in /var/lib/puppet/lib/facter/etcgroup.rb Info: Loading facts in /var/lib/puppet/lib/facter/isp.rb Info: Loading facts in /var/lib/puppet/lib/facter/concat_basedir.rb Info: Loading facts in /var/lib/puppet/lib/facter/memoryfree_raw.rb Info: Loading facts in /var/lib/puppet/lib/facter/country.rb Info: Loading facts in /var/lib/puppet/lib/facter/pe_version.rb Info: Caching catalog for ns2.example.net Info: Applying configuration version ''1380622806'' *Error: Could not prefetch package provider ''apt'': invalid byte sequence in US-ASCII* Notice: Finished catalog run in 16.36 seconds [simon@ns2(~)> export LC_ALL=en_US.UTF-8 [simon@ns2(~)> export LANG=en_US.UTF-8 [simon@ns2(~)> sudo puppet agent --test Info: Retrieving plugin Info: Loading facts in /var/lib/puppet/lib/facter/memorysize_raw.rb Info: Loading facts in /var/lib/puppet/lib/facter/augeasversion.rb Info: Loading facts in /var/lib/puppet/lib/facter/root_home.rb Info: Loading facts in /var/lib/puppet/lib/facter/puppet_vardir.rb Info: Loading facts in /var/lib/puppet/lib/facter/facter_dot_d.rb Info: Loading facts in /var/lib/puppet/lib/facter/etcpasswd.rb Info: Loading facts in /var/lib/puppet/lib/facter/etcgroup.rb Info: Loading facts in /var/lib/puppet/lib/facter/isp.rb Info: Loading facts in /var/lib/puppet/lib/facter/concat_basedir.rb Info: Loading facts in /var/lib/puppet/lib/facter/memoryfree_raw.rb Info: Loading facts in /var/lib/puppet/lib/facter/country.rb Info: Loading facts in /var/lib/puppet/lib/facter/pe_version.rb Info: Caching catalog for ns2.example.net Info: Applying configuration version ''1380622806'' Notice: Finished catalog run in 14.81 seconds HTH, Regards, Simon On 1 October 2013 20:39, Peter Berghold <salty.cowdawg@gmail.com> wrote:> Now I''m really confused... I use emacs and vi exclusively and neither of > those should be US-ASCII. This leads me to wonder which file. Is it the > provider itself or ??? > > > > On Tue, Oct 1, 2013 at 2:57 PM, Ayers, Mike <Mike_Ayers@cable.comcast.com>wrote: > >> > From: puppet-users@googlegroups.com [mailto:puppet- >> > users@googlegroups.com] On Behalf Of Peter Berghold >> >> > What does "Could not prefetch package provider ''apt'': invalid byte >> > sequence in US-ASCII" mean exactly? This started showing up in the logs >> > of some of my servers... >> >> If a file is being interpreted as US-ASCII, then it is expected >> to have no characters with the high bit set. If you edited any source >> files with an Unicode editor, it may have changed some of your punctuatiuon >> to fancy Unicode versions of that punctuation (e.g. a pair of quotes to >> "left quote" and "right quote"), which the interpreter would not understand. >> >> Blind stab: If you save a file as type "UTF-8" on Windows, a BOM >> will be inserted as the first character in the file. Make sure you save as >> ASCII. >> >> >> HTH, >> >> Mike >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Puppet Users" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to puppet-users+unsubscribe@googlegroups.com. >> To post to this group, send email to puppet-users@googlegroups.com. >> Visit this group at http://groups.google.com/group/puppet-users. >> For more options, visit https://groups.google.com/groups/opt_out. >> > > > > -- > > Peter L. Berghold Salty.Cowdawg@gmail.com > > http://blog.berghold.net > > -- > You received this message because you are subscribed to the Google Groups > "Puppet Users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to puppet-users+unsubscribe@googlegroups.com. > To post to this group, send email to puppet-users@googlegroups.com. > Visit this group at http://groups.google.com/group/puppet-users. > For more options, visit https://groups.google.com/groups/opt_out. >-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users. For more options, visit https://groups.google.com/groups/opt_out.
On Tuesday, October 1, 2013 1:57:43 PM UTC-5, Ayers, Mike wrote:> > > From: puppet...@googlegroups.com <javascript:> [mailto:puppet-<javascript:> > > us...@googlegroups.com <javascript:>] On Behalf Of Peter Berghold > > > What does "Could not prefetch package provider ''apt'': invalid byte > > sequence in US-ASCII" mean exactly? This started showing up in the logs > > of some of my servers... > > If a file is being interpreted as US-ASCII, then it is expected to > have no characters with the high bit set. If you edited any source files > with an Unicode editor, it may have changed some of your punctuatiuon to > fancy Unicode versions of that punctuation (e.g. a pair of quotes to "left > quote" and "right quote"), which the interpreter would not understand. > > Blind stab: If you save a file as type "UTF-8" on Windows, a BOM > will be inserted as the first character in the file. Make sure you save as > ASCII. > >Yes, a byte-order mark at the beginning of the file is the most likely culprit. Note that UTF-8 does not require a BOM, so removing one will not invalidate the file, though it may make life harder for code that tries to detect the encoding. But by that token, no encoding detection appears to be happening anyway, otherwise the file would not be assumed US-ASCII. If the only bytes having their high bit set appear in a BOM at the start of the file, then removing the BOM will make the file simultaneously valid UTF-8, valid US-ASCII, and valid ISO-8859-x, x = 1 ... 15. Note, too, that although Windows editors are known for adding a BOM under certain circumstances, modern vim (and I assume emacs) understand Unicode encodings, including UTF-8, and can probably be induced to add a BOM themselves. John -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users. For more options, visit https://groups.google.com/groups/opt_out.