Jira (PUP-9263) Modulepath should not be case sensitive on case insensitive file systems

2 views
Skip to first unread message

Glenn Sarti (JIRA)

unread,
Oct 24, 2018, 2:25:02 AM10/24/18
to puppe...@googlegroups.com
Glenn Sarti updated an issue
 
Puppet / Bug PUP-9263
Modulepath should not be case sensitive on case insensitive file systems
Change By: Glenn Sarti
Affects Version/s: PUP 5.5.2
Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.7.1#77002-sha1:e75ca93)
Atlassian logo

Glenn Sarti (JIRA)

unread,
Oct 24, 2018, 2:25:02 AM10/24/18
to puppe...@googlegroups.com
Glenn Sarti created an issue
Issue Type: Bug Bug
Affects Versions: PUP 6.0.2
Assignee: Unassigned
Created: 2018/10/23 11:24 PM
Environment:

Windows 10 - 1803
ruby 2.5.1p57 (2018-03-29 revision 63029) [x64-mingw32]

Priority: Normal Normal
Reporter: Glenn Sarti

Puppet Version: 6.0.2
Puppet Server Version: N/A
OS Name/Version: Windows 10 - 1803

It's not correct behaviour for the filesystem and the error generated by Puppet does not indicate that the path is wrong.

Desired Behavior:

When specifying modulepath on the puppet commandline, the path should not be case sensitive on case insensitive file systems e.g. NTFS

Actual Behavior:

Puppet fails to find modules if

Repro:

  • Windows VM
  • Create a module (This example uses C:\Source\tmp\jess\test)
  • Create a simple function

    # module_name/lib/puppet/functions/winquote.rb
    Puppet::Functions.create_function(:winquote) do
      dispatch :winquote do
        param 'Any', :quote
      end
      def winquote(quote)
        "\"#{quote}\""
      end
    end
    

  • Bundle install (Ruby 2.5, Puppet 6.0.2 Gem)

C:\Source\tmp\jess\test> bundle exec puppet apply -e "notify{ winquote('bob'): }" --modulepath C:\Source\tmp\jess
Notice: Compiled catalog for glenns.gallifrey.local in environment production in 0.10 seconds
Notice: "bob"
Notice: /Stage[main]/Main/Notify["bob"]/message: defined 'message' as '"bob"'
Notice: Applied catalog in 0.03 seconds
C:\Source\tmp\jess\test> bundle exec puppet apply -e "notify{ winquote('bob'): }" --modulepath C:\Source\Tmp\jess
Error: Evaluation Error: Unknown function: 'winquote'. (line: 1, column: 9) on node glenns.gallifrey.local

Note that the first invocation is the correct path, the second invocation has a capital 'T' in tmp.

 
This is also broken in the Puppet Agent package

C:\Source\tmp\jess\test> puppet --version
5.5.2
C:\Source\tmp\jess\test> puppet apply -e "notify

{ winquote('bob'): }

" --modulepath C:\Source\tmp\jess
Notice: Compiled catalog for glenns.gallifrey.local in environment production in 0.14 seconds
Notice: "bob"
Notice: /Stage[main]/Main/Notify["bob"]/message: defined 'message' as '"bob"'
Notice: Applied catalog in 0.03 seconds
C:\Source\tmp\jess\test> puppet apply -e "notify

{ winquote('bob'): }

" --modulepath C:\Source\Tmp\jess
Error: Evaluation Error: Unknown function: 'winquote'. (line: 1, column: 9) on node glenns.gallifrey.local

 

Glenn Sarti (JIRA)

unread,
Oct 24, 2018, 2:27:02 AM10/24/18
to puppe...@googlegroups.com
Glenn Sarti updated an issue
Change By: Glenn Sarti
Acceptance Criteria: * When passing in paths to Puppet, they should honor the case sensitivity of the underlying operating file system

Josh Cooper (JIRA)

unread,
Oct 24, 2018, 12:51:07 PM10/24/18
to puppe...@googlegroups.com
Josh Cooper updated an issue
Change By: Josh Cooper
*Puppet Version:* 6.0.2
*Puppet Server Version:* N/A
*OS Name/Version:* Windows 10 - 1803


It's not correct behaviour for the filesystem and the error generated by Puppet does not indicate that the path is wrong.

*Desired Behavior:*

When specifying modulepath on the puppet commandline, the path should not be case sensitive on case insensitive file systems e.g. NTFS

*Actual Behavior:*


Puppet fails to find modules if

Repro:

* Windows VM
* Create a module (This example uses C:\Source\tmp\jess\test)
* Create a simple function
{code}

# module_name/lib/puppet/functions/winquote.rb
Puppet::Functions.create_function(:winquote) do
  dispatch :winquote do
    param 'Any', :quote
  end
  def winquote(quote)
    "\"#{quote}\""
  end
end
{code}

* Bundle install (Ruby 2.5, Puppet 6.0.2 Gem)

{code}

C:\Source\tmp\jess\test> bundle exec puppet apply -e "notify{ winquote('bob'): }" --modulepath C:\Source\tmp\jess
Notice: Compiled catalog for glenns.gallifrey.local in environment production in 0.10 seconds
Notice: "bob"
Notice: /Stage[main]/Main/Notify["bob"]/message: defined 'message' as '"bob"'
Notice: Applied catalog in 0.03 seconds
C:\Source\tmp\jess\test> bundle exec puppet apply -e "notify{ winquote('bob'): }" --modulepath C:\Source\Tmp\jess
Error: Evaluation Error: Unknown function: 'winquote'. (line: 1, column: 9) on node glenns.gallifrey.local
{code}

Note that the first invocation is the correct path, the second invocation has a capital 'T' in tmp.
{code}

* This is also broken in the Puppet Agent package

{code}

C:\Source\tmp\jess\test> puppet --version
5.5.2
C:\Source\tmp\jess\test> puppet apply -e "notify{ winquote('bob'): }" --modulepath C:\Source\tmp\jess
Notice: Compiled catalog for glenns.gallifrey.local in environment production in 0.14 seconds
Notice: "bob"
Notice: /Stage[main]/Main/Notify["bob"]/message: defined 'message' as '"bob"'
Notice: Applied catalog in 0.03 seconds
C:\Source\tmp\jess\test> puppet apply -e "notify{ winquote('bob'): }" --modulepath C:\Source\Tmp\jess
Error: Evaluation Error: Unknown function: 'winquote'. (line: 1, column: 9) on node glenns.gallifrey.local
{code}

Jorie Tappa (JIRA)

unread,
Oct 29, 2018, 5:01:04 PM10/29/18
to puppe...@googlegroups.com

Jacob Helwig (JIRA)

unread,
Oct 29, 2018, 5:05:04 PM10/29/18
to puppe...@googlegroups.com
Jacob Helwig commented on Bug PUP-9263
 
Re: Modulepath should not be case sensitive on case insensitive file systems

Could you paste the output of "puppet config print modulepath" with the two different "--modulepath" options you were using? I suspect that this is more of a parsing/escaping issue than a case sensitivity issue, but I could be wrong.

Glenn Sarti (JIRA)

unread,
Oct 29, 2018, 8:16:02 PM10/29/18
to puppe...@googlegroups.com
Glenn Sarti commented on Bug PUP-9263

Nope...Not parsing.

C:\Source> puppet config print modulepath
C:/ProgramData/PuppetLabs/code/environments/workstation_production/modules;C:/ProgramData/PuppetLabs/code/modules
C:\Source> puppet config print modulepath --modulepath C:\Source\tmp\jess
C:/Source/tmp/jess
C:\Source> puppet config print modulepath --modulepath C:\Source\Tmp\jess
C:/Source/Tmp/jess
C:\Source>

Glenn Sarti (JIRA)

unread,
Oct 29, 2018, 8:17:02 PM10/29/18
to puppe...@googlegroups.com
Glenn Sarti assigned an issue to Unassigned
 
Change By: Glenn Sarti
Assignee: Glenn Sarti

Glenn Sarti (JIRA)

unread,
Oct 29, 2018, 8:17:02 PM10/29/18
to puppe...@googlegroups.com
Glenn Sarti assigned an issue to Glenn Sarti

Glenn Sarti (JIRA)

unread,
Oct 29, 2018, 8:18:02 PM10/29/18
to puppe...@googlegroups.com

Jacob Helwig (JIRA)

unread,
Oct 30, 2018, 12:11:13 PM10/30/18
to puppe...@googlegroups.com

Josh Cooper (Jira)

unread,
Jun 14, 2021, 7:07:02 PM6/14/21
to puppe...@googlegroups.com
Josh Cooper commented on Bug PUP-9263
 
Re: Modulepath should not be case sensitive on case insensitive file systems

My guess is this is due to the Pops being case-sensitive when keeping track of candidate files to load: https://github.com/puppetlabs/puppet/blob/ba7ba7285ccfbb659c9ea6c52245508a8795df89/lib/puppet/pops/loader/loader_paths.rb#L105

One simple fix might be to call Pathname.new(Puppet[:modulepath]).cleanpath when creating the directory environments: https://github.com/puppetlabs/puppet/blob/ba7ba7285ccfbb659c9ea6c52245508a8795df89/lib/puppet/environments.rb#L171-L174

This message was sent by Atlassian Jira (v8.13.2#813002-sha1:c495a97)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages