Jira (PUP-4045) Failed to generate additional resources using 'eval_generate': Cannot manage files of type socket

7 views
Skip to first unread message

redmine.exporter (JIRA)

unread,
Feb 26, 2015, 4:59:36 AM2/26/15
to puppe...@googlegroups.com
redmine.exporter created an issue
 
Puppet / Bug PUP-4045
Failed to generate additional resources using 'eval_generate': Cannot manage files of type socket
Issue Type: Bug Bug
Assignee: Unassigned
Created: 2015/02/26 1:58 AM
Labels: redmine
Priority: Normal Normal
Reporter: redmine.exporter

Using a slightly modified version of the code from "Pro Puppet" I am getting the following error:

Jun 13 01:36:33 media puppet-agent[18196]: (/Stage[main]/Mysql::Config/File[mysql_data_dir]) Failed to generate additional resources using 'eval_generate': Cannot manage files of type socket

The file resource in mysql/manifests/config.pp is as follows:

file

{ "mysql_data_dir" : path => $mysql::params::data_directory, group => "mysql", owner => "mysql", recurse => true, require => File["my.cnf"], }

And for this particular $operatingsystem (Fedora) the value for $data_directory in mysql/manifests/params.pp is :

$data_directory = "/var/lib/mysql"

By default mysql on a Fedora system places its mysql.sock file in the data directory but it appears when a you try and change the permissions recursively, puppet doesn't know what to do with the socket file.

I can place the socket file elsewhere as a work around but I believe that puppet needs to ignore socket files when changing permissions.

[root@media modules]# puppet --version
2.6.8
[root@media modules]# puppet master --version
2.6.8

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v6.3.10#6340-sha1:7ea293a)
Atlassian logo

Peter Souter (JIRA)

unread,
May 6, 2015, 6:45:21 AM5/6/15
to puppe...@googlegroups.com
Peter Souter updated an issue
Change By: Peter Souter
Using a slightly modified version of the code from "Pro Puppet" I am getting the following error:

{code}
    Jun 13 01:36:33 media puppet-agent[18196]: (/Stage[main]/Mysql::Config/File[mysql_data_dir]) Failed to generate additional resources using 'eval_generate': Cannot manage files of type socket
{code}

The file resource in mysql/manifests/config.pp is as follows: 

{code}
    file { "mysql_data_dir" :
        path => $mysql::params::data_directory,
        group => "mysql",
        owner => "mysql",
        recurse => true,
        require => File["my.cnf"],
    }
{code}

And for this particular $operatingsystem (Fedora) the value for $data_directory in mysql/manifests/params.pp is :

{code}
    $data_directory = "/var/lib/mysql"
{code}

By default mysql on a Fedora system places its mysql.sock file in the data directory but it appears when a you try and change the permissions recursively, puppet doesn't know what to do with the socket file. 

I can place the socket file elsewhere as a work around but I believe that puppet needs to ignore socket files when changing permissions. 

{code}
    [root@media modules]# puppet --version
    2.6.8
    [root@media modules]# puppet master --version
    2.6.8
{code}
This message was sent by Atlassian JIRA (v6.3.15#6346-sha1:dbc023d)
Atlassian logo

Peter Souter (JIRA)

unread,
May 6, 2015, 6:47:21 AM5/6/15
to puppe...@googlegroups.com
Peter Souter commented on Bug PUP-4045
 
Re: Failed to generate additional resources using 'eval_generate': Cannot manage files of type socket

As someone who encountered this recently, and needed to use the workaround of adding the socket files to the `ignore` parameter, you can find out what files are sockets with `tree` easy enough:

$ tree --inodes -F | grep =
│       │   ├── [2458821]  S_TCP=

So I needed to add this to my code:

ignore    => ['S_TCP']

Stephen Gelman (JIRA)

unread,
Apr 18, 2017, 1:47:02 AM4/18/17
to puppe...@googlegroups.com

I couldn't use ignore because it only matches the filename, not the patch and the socket was a non-unique name. I worked around it locally by adding an empty "when socket" case here:

https://github.com/puppetlabs/puppet/blob/3daa532/lib/puppet/file_serving/metadata.rb#L121

I don't think this is an acceptable solution long term so I am not going to PR it but i wanted to throw it out there in case it helps someone. One solution might be to change ignore to allow it to match on a path instead of just a filename.

This message was sent by Atlassian JIRA (v6.4.14#64029-sha1:ae256fe)
Atlassian logo

Adrien Thebo (JIRA)

unread,
May 15, 2017, 7:57:03 PM5/15/17
to puppe...@googlegroups.com

Adrien Thebo (JIRA)

unread,
May 15, 2017, 7:57:06 PM5/15/17
to puppe...@googlegroups.com
Adrien Thebo commented on Bug PUP-4045
 
Re: Failed to generate additional resources using 'eval_generate': Cannot manage files of type socket

Peter Souter you're a person that knows things, what's the correct behavior in this case? We can definitely solve this problem but we don't know what behavior is correct.

Adrien Thebo (JIRA)

unread,
May 15, 2017, 7:58:02 PM5/15/17
to puppe...@googlegroups.com

Moses Mendoza (JIRA)

unread,
May 18, 2017, 2:04:40 PM5/18/17
to puppe...@googlegroups.com

Robert Weaver (JIRA)

unread,
Feb 5, 2018, 6:54:02 AM2/5/18
to puppe...@googlegroups.com
Robert Weaver commented on Bug PUP-4045
 
Re: Failed to generate additional resources using 'eval_generate': Cannot manage files of type socket

Hello Im getting the same issue running a backup job of the etc and /boot folder : 

Error

Feb  5 11:37:56 EDRSPUATV06 puppet-agent[7848]: (/Stage[main]/Backup::Backupvar/File[/tmp/backup/var]) Failed to generate additional resources using 'eval_generate': Cannot manage files of type socket

puppet --version
5.3.2

puppet code 

 

  

class backup::backupboot inherits backup{

  1. execution of the script will create a backup of the /etc/var directory to /tmp/backup

file { '/tmp/backup/boot':
mode => '644',
ensure => directory, # so make this a directory
recurse => true, # enable recursive directory management
purge => true, # purge all unmanaged junk
force => true, # also purge subdirs and links etc.
owner => "root",
group => "root",

  1. puppet will automatically set +x for directories
    source => '/boot',
    }

}

This message was sent by Atlassian JIRA (v7.5.1#75006-sha1:7df2574)
Atlassian logo

Josh Cooper (JIRA)

unread,
Mar 29, 2019, 6:13:04 PM3/29/19
to puppe...@googlegroups.com
Josh Cooper updated an issue
 
Change By: Josh Cooper
Team: Coremunity
This message was sent by Atlassian JIRA (v7.7.1#77002-sha1:e75ca93)
Atlassian logo

Josh Cooper (Jira)

unread,
May 15, 2020, 12:25:03 PM5/15/20
to puppe...@googlegroups.com
Josh Cooper assigned an issue to Unassigned
Change By: Josh Cooper
Assignee: Peter Souter
This message was sent by Atlassian Jira (v8.5.2#805002-sha1:a66f935)
Atlassian logo

Josh Cooper (Jira)

unread,
Jun 11, 2020, 2:38:03 AM6/11/20
to puppe...@googlegroups.com

Bartosz Blizniak (Jira)

unread,
Jul 1, 2021, 5:31:01 AM7/1/21
to puppe...@googlegroups.com
This message was sent by Atlassian Jira (v8.13.2#813002-sha1:c495a97)
Atlassian logo

Josh Cooper (Jira)

unread,
Jul 1, 2021, 11:09:02 AM7/1/21
to puppe...@googlegroups.com

Ciprian Badescu (Jira)

unread,
Jul 6, 2021, 8:31:02 AM7/6/21
to puppe...@googlegroups.com

Ciprian Badescu (Jira)

unread,
Jul 6, 2021, 8:31:02 AM7/6/21
to puppe...@googlegroups.com

Ciprian Badescu (Jira)

unread,
Jul 6, 2021, 8:32:01 AM7/6/21
to puppe...@googlegroups.com

Ciprian Badescu (Jira)

unread,
Jul 6, 2021, 8:32:02 AM7/6/21
to puppe...@googlegroups.com

Ciprian Badescu (Jira)

unread,
Jul 6, 2021, 8:32:03 AM7/6/21
to puppe...@googlegroups.com

Ciprian Badescu (Jira)

unread,
Jul 6, 2021, 8:32:03 AM7/6/21
to puppe...@googlegroups.com

Ciprian Badescu (Jira)

unread,
Jul 6, 2021, 8:33:01 AM7/6/21
to puppe...@googlegroups.com

Ciprian Badescu (Jira)

unread,
Jul 6, 2021, 8:33:01 AM7/6/21
to puppe...@googlegroups.com

Ciprian Badescu (Jira)

unread,
Jul 6, 2021, 8:33:02 AM7/6/21
to puppe...@googlegroups.com

Ciprian Badescu (Jira)

unread,
Jul 6, 2021, 8:34:02 AM7/6/21
to puppe...@googlegroups.com

Ciprian Badescu (Jira)

unread,
Jul 13, 2021, 10:17:03 AM7/13/21
to puppe...@googlegroups.com

Beth Glenfield (Jira)

unread,
Jul 13, 2021, 11:18:02 AM7/13/21
to puppe...@googlegroups.com
Beth Glenfield commented on Bug PUP-4045
 
Re: Failed to generate additional resources using 'eval_generate': Cannot manage files of type socket

Hi Bartosz Blizniak, looking at the linked ticket it seems like the customer wants to manage socket file types? Or can they use the `ignore` parameter solution?

Ciprian Badescu (Jira)

unread,
Aug 3, 2021, 5:03:04 AM8/3/21
to puppe...@googlegroups.com

Ciprian Badescu (Jira)

unread,
Oct 1, 2021, 8:44:02 AM10/1/21
to puppe...@googlegroups.com

Ciprian Badescu (Jira)

unread,
Oct 7, 2021, 5:23:02 AM10/7/21
to puppe...@googlegroups.com

Ciprian Badescu (Jira)

unread,
Oct 18, 2021, 9:45:02 AM10/18/21
to puppe...@googlegroups.com

Ciprian Badescu (Jira)

unread,
Nov 3, 2021, 5:23:02 AM11/3/21
to puppe...@googlegroups.com
Ciprian Badescu commented on Bug PUP-4045
 
Re: Failed to generate additional resources using 'eval_generate': Cannot manage files of type socket

we can add a new parameter ignore_type that should be similar to the already existing ignore parameter but it will check file type instead file name pattern

Ciprian Badescu (Jira)

unread,
Nov 3, 2021, 5:29:04 AM11/3/21
to puppe...@googlegroups.com

Dorin Pleava (Jira)

unread,
Nov 16, 2021, 5:01:03 AM11/16/21
to puppe...@googlegroups.com

Dorin Pleava (Jira)

unread,
Nov 16, 2021, 6:13:02 AM11/16/21
to puppe...@googlegroups.com
Dorin Pleava assigned an issue to Unassigned

Ciprian Badescu (Jira)

unread,
Nov 17, 2021, 4:14:02 AM11/17/21
to puppe...@googlegroups.com

Luchian Nemes (Jira)

unread,
Nov 17, 2021, 8:42:03 AM11/17/21
to puppe...@googlegroups.com

Luchian Nemes (Jira)

unread,
Dec 6, 2021, 3:30:02 AM12/6/21
to puppe...@googlegroups.com
Luchian Nemes updated an issue
Change By: Luchian Nemes
Release Notes: Bug Fix
Release Notes Summary: This release allows Puppet to retrieve attributes for `fifo` and `socket` files and manage them when given manifest has a `file` resource which is recursing over a given path.

Michael Hashizume (Jira)

unread,
Dec 6, 2021, 5:45:02 PM12/6/21
to puppe...@googlegroups.com

Michael Hashizume (Jira)

unread,
Dec 6, 2021, 5:45:02 PM12/6/21
to puppe...@googlegroups.com

Parker Leach (Jira)

unread,
Jan 11, 2022, 11:16:01 PM1/11/22
to puppe...@googlegroups.com
Parker Leach updated an issue
Change By: Parker Leach
Labels: customer docs_reviewed jira_escalated redmine
This message was sent by Atlassian Jira (v8.20.2#820002-sha1:829506d)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages