jfryman-nginx Duplicate Declaration

288 views
Skip to first unread message

Danny Roberts

unread,
Apr 19, 2015, 5:41:04 AM4/19/15
to puppet...@googlegroups.com
I am trying to use the jfryman-nginx module (Code is here: https://github.com/kemra102/puppet-gitlab/blob/master/manifests/webserver.pp)

However when running the module this code is part of it spits out these errors:

Error: Duplicate declaration: Concat::Fragment[0024e4ac0b2015c6fe48cb277f2f1f98] is already declared in file /root/modules/nginx/manifests/resource/location.pp:359; cannot redeclare at /root/modules/nginx/manifests/resource/location.pp:359 on node gitlab.thefallenphoenix.net
Error: Duplicate declaration: Concat::Fragment[0024e4ac0b2015c6fe48cb277f2f1f98] is already declared in file /root/modules/nginx/manifests/resource/location.pp:359; cannot redeclare at /root/modules/nginx/manifests/resource/location.pp:359 on node gitlab.thefallenphoenix.net

Now unfortunately I cannot unravel the complexities of the nginx module so cannot determine exactly what is duplicated that shouldn't be. Can anyone provide any insight?

Gabriel Filion

unread,
Apr 21, 2015, 11:17:58 AM4/21/15
to puppet...@googlegroups.com
Hey there,
those errors are some of the worst to debug since the output is most
useless.. but not completely so!

The output indicates that two diffrent calls to
nginx::resource::location are using the same name for concat::fragment.
So you need to inspect what's happening with the calls to
nginx::resource::location and figure out why the double usage of name
happens. The tricky part is that this might be called automatically by
other parts of the module (I haven't looked at the module's manifests)

That's unfortunately the best I can help you with for now.

--
Gabriel Filion

signature.asc

ma...@3flex.com.au

unread,
Apr 21, 2015, 4:29:44 PM4/21/15
to puppet...@googlegroups.com
The nginx::resource::vhost resource creates a nginx::resource::location by default. This location will be named after the vhost you created (gitlab) with location "/". You're also declaring your own nginx::resource::location with vhost name "gitlab" and location "/".

In the nginx module it creates a fragment. The name of this fragment is the MD5 sum of ${vhost_sanitized}-${priority}-${location_sanitized}. The default location for your vhost is clashing with the one you are manually declaring since the MD5 sum of the two fragments are identical due to the way they are created.

Simplest fix is to set use_default_location => false on the vhost.
Reply all
Reply to author
Forward
0 new messages