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

Error when creating location '/' when $use_default_location not false #902

Closed
wyardley opened this issue Oct 7, 2016 · 3 comments
Closed

Comments

@wyardley
Copy link
Collaborator

wyardley commented Oct 7, 2016

When $use_default_location is not set to false, and you try to define a location '/' (even when that location does have a www_root, proxy, etc. directive set), you get this error, which is somewhat misleading:

Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Cannot create a location reference without a www_root, proxy, location_alias, fastcgi, uwsgi, stub_status, internal, or location_custom_cfg defined at /etc/puppet/modules/nginx/manifests/resource/location.pp:347 on node xxxx
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run
nginx::nginx_vhosts:
  'foo':
    server_name:
      - '_'
    locations:
      /:
        proxy: 'http://localhost:3000'

If you take out that check entirely, a duplicate fragment error comes up instead. I should be able to fix this, but for now, I'm being lazy and just opening an issue... will see if I can come up with a reasonable fix myself, but if someone else wants to take a stab, have at it.

@wyardley
Copy link
Collaborator Author

wyardley commented Oct 8, 2016

See also #544 and #639

@wyardley
Copy link
Collaborator Author

Is there some way to make this more magic:
https://github.com/voxpupuli/puppet-nginx/blob/master/manifests/resource/vhost.pp#L605
i.e., if the user has supplied a location resource with location => '/' for the vhost, just don't create it?

Is that just not possible to check, or is there some other reason for this that I'm missing?

@wyardley
Copy link
Collaborator Author

For better or worse, the changes in #923 seem to suppress the error (not sure if I fixed a problem or introduced one there), though still causes that duplicate fragment error when $use_default_location is unset.

Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Duplicate declaration: Concat::Fragment[foo-500-6666cd76f96956469e7be39d750cc7d9] is already declared in file /etc/puppet/modules/nginx/manifests/resource/location.pp:418; cannot redeclare at /etc/puppet/modules/nginx/manifests/resource/location.pp:418 on node c7node0.dev.axsops.local

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

1 participant