Giter VIP home page Giter VIP logo

graphite's Introduction

Graphite Cookbook

Cookbook Version Build Status OpenCollective OpenCollective License

Description

Library cookbook for installation and configuration of Graphite via Chef

Consult the Graphite documentation for more information:

Maintainers

This cookbook is maintained by the Sous Chefs. The Sous Chefs are a community of Chef cookbook maintainers working together to maintain important cookbooks. If you’d like to know more please visit sous-chefs.org or come chat with us on the Chef Community Slack in #sous-chefs.

Requirements

Platforms

  • Ubuntu 18.04+
  • Debian 8+
  • RHEL 7+

Chef

  • Chef 13+

Cookbooks

  • poise-python

Attributes

See default attributes for platform specific packages installed.

  • node['graphite']['version'] - package version to install, defaults to '0.9.12'
  • node['graphite']['twisted_version'] - twisted version to pin to, defaults to '13.1'
  • node['graphite']['django_version'] - django version to use, defaults to '1.5.5'
  • node['graphite']['user'] - graphite user, 'graphite'
  • node['graphite']['group'] - graphite group, 'graphite'
  • node['graphite']['base_dir'] - default base dir, '/opt/graphite'
  • node['graphite']['doc_root'] - doc root for graphite-web, '/opt/graphite/webapp'
  • node['graphite']['storage_dir'] - storage dir, '/opt/graphite/storage'
  • node['graphite']['install_type'] - 'package' or 'source'. Setting this to source will use latest github main branch
  • default['graphite']['package_names'] - package name hash, indexed by 'install_type' attribute.
  • default['graphite']['graph_templates'] - graphite template config hash
  • default['graphite']['sort_storage_schemas'] - Boolean attribute to specify whether or not storage schemas should be sorted in alphabetical order
  • default['graphite']['sort_configs'] - Boolean attribute to specify whether or not config stanzas should be sorted in alphabetical order

Adjusting package source location

You can override the node['graphite']['package_names'][#{name}]['source'] attribute, where #{name} is one of whisper, carbon or graphite_web, to set a custom install path. By default a source install will use the github main branch.

Recipes

default

No-op, assuming cookbook inclusion in a custom wrapper.

packages

Just install all packages, carbon and web

carbon

Install all carbon packages, setup the graphite user, storage paths and write the carbon configuration. Does not start any services.

web

Set up just about everything for graphite web, except configure it and start the service. Use the graphite_web_config resource and the uwsgi recipe for those two things.

Some of this weirdness may not really be needed, so send us a PR if you fix it before us. For example, I'd love some way to remove that execute block for selinux and there's probably a better way to manage all those files and directories.

uwsgi

Start a uwsgi runit service for graphite-web. That's it.

Various internal recipes

View the code for additional stub recipes that perform smaller pieces of functionality such as setup the user or install specific packages, the all begin with an underscore _.

It's like a treasure hunt.

Resources

Carbon daemons

Management for the various Carbon services which receive your metrics and write them to disk.

  • graphite_service: sets up a carbon service with runit, essentially a glorified runit_service. Carbon configuration should be defined first with one of the graphite_carbon_* resources. Multiple daemons can be run by using multiple resources with names such as cache:a, cache:b, etc..
  • graphite_carbon_aggregator: data driven resource for carbon-aggregator configuration
  • graphite_carbon_cache: data driven resource for carbon-cache configuration
  • graphite_carbon_relay: data driven resource for carbon-cache configuration

Storage

Whisper is pretty much a requirement right now, so these resources assume whisper libraries should be installed. Feel free to implement something else in your own wrapper if you live on the edge and prefer Ceres.

  • graphite_storage: makes a directory intended for graphite storage, installs whisper
  • graphite_storage_schema: data driven resource for storage schema

Graphite Web

Write the configuration file for Graphite Web

  • graphite_web_config: data driven python config file writer for graphite web. Assumes the whole file is managed, typically this is the path to local_settings.py. Custom python code can be placed in the optional 'dynamic template', by default a file named 'local_settings_dynamic.py' that is optimistically loaded if present.

Yes it's writing python via ruby.

A runit service definition is provided to start a uwsgi process, but note that choice of web server for proxying to the application server is left up to you. No more hard Apache dependency!

Accumulators

Due to the graphite config file format, the data driven resources use an accumulator pattern to find the appropriate resources in the run context and extract provided configuration data. You should never need to use these directly, but you're welcome to go crazy.

  • graphite_carbon_conf_accumulator: lookup named carbon resources in run context and gather config
  • graphite_storage_conf_accumulator: lookup named storage schema resources in run context and gather config

If you look at the example cookbook recipe you probably notice that many of the resources simply take a single config attribute, which is basically a hash of the configuration to be written.

This can come from attributes in a wrapper cookbook or via data bags if you like. Be as creative as you can tolerate.

Accumulator pattern came from excellent work by Mathieu Sauve-Frankel

Usage

It's a library cookbook, intended to be used in your custom wrapper cookbook to behave as needed. It's the building materials, not the house.

We have purposefully left out web server configuration to remove the dependency, so you're free to use whatever works in your environment. This avoids the need for this cookbook to keep up to date with configuration that isn't really graphite specific.

For example usage consult the reference cookbook example

Examples

You can find example usage in the graphite_example cookbook that is included in the git repository.

Data Bags

Sure, use em if you like. Even encrypt them.

Development / Contributing

  • Source hosted at [GitHub][repo]
  • Report issues/questions/feature requests on [GitHub Issues][issues]

Pull requests are very welcome! Make sure your patches are well tested. Ideally create a topic branch for every separate change you make. For example:

  1. Fork the repo
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Write some tests, see ChefSpec
  4. Commit your awesome changes (git commit -am 'Added some feature')
  5. Push to the branch (git push origin my-new-feature)
  6. Create a new Pull Request and tell us about it your changes.

Contributors

This project exists thanks to all the people who contribute.

Backers

Thank you to all our backers!

https://opencollective.com/sous-chefs#backers

Sponsors

Support this project by becoming a sponsor. Your logo will show up here with a link to your website.

https://opencollective.com/sous-chefs/sponsor/0/website https://opencollective.com/sous-chefs/sponsor/1/website https://opencollective.com/sous-chefs/sponsor/2/website https://opencollective.com/sous-chefs/sponsor/3/website https://opencollective.com/sous-chefs/sponsor/4/website https://opencollective.com/sous-chefs/sponsor/5/website https://opencollective.com/sous-chefs/sponsor/6/website https://opencollective.com/sous-chefs/sponsor/7/website https://opencollective.com/sous-chefs/sponsor/8/website https://opencollective.com/sous-chefs/sponsor/9/website

graphite's People

Contributors

abilun avatar agoddard avatar chrisroberts avatar cwjohnston avatar damacus avatar dje avatar fnichol avatar gansbrest avatar igalarzab avatar johnroesler avatar kitchen-porter avatar luckymike avatar lusis avatar mbabineau avatar michaelballantyne avatar mool avatar obazoud avatar pdf avatar portertech avatar powerschill avatar ramereth avatar renovate[bot] avatar scraton avatar smith avatar t2y avatar tas50 avatar webframp avatar xorima avatar xorimabot avatar zuazo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

graphite's Issues

Allowing to customize/override storage-schemas/aggregation

Hi,
Currently storages-schemas.conf is static and storage-aggregation.conf is not handled at all. Personally I'd like to config both, but not sure of the best way.

FYI, changing these files does not require a service restart, so they could be changed externally easily. On the other hand, existing metrics are not affected by these changes unless you run a special script to refactor the existing files.

  1. Minimum change: don't do anything in graphite cookbook :-)
    On every chef run, both the carbon recipe & the user's recipe would write their own differing versions of storage-schemas on every chef run, last to write wins all... not very clean. Slim chance of very rare bug if a new metric comes in while our default file is in effect.
  2. A bit more: allow users to supply alternative template names from their wrapper cookbook, with no default for storage-aggregation (a bit like runit_service allows). Users then can be sure their template would be run at the right point, with the right ownership.
  3. Being nice to StatsD users: optionally creating a storage-aggregations file suitable for StatsD.

Whaddaya say?

FORWARD_ALL aggregator option is missing

From carbon.conf.example:

If set true, metric received will be forwarded to DESTINATIONS in addition to

the output of the aggregation rules. If set false the carbon-aggregator will

only ever send the output of aggregation.

FORWARD_ALL = True

Absence of this option which if False in default leads to filtering all metrics going through aggregator if no aggregation rule used.

SSL support for graphite-web

It would be nice to be able to support ssl in the apache vhosts file. I'll try implementing it in a forked repo.

Could not import settings 'graphite.settings'

Attempting install on a clean Ubuntu 10 template, web root dir /opt/graphite/webapp. Trying the app from apache gives a 500 error, with this in error.log:

ImportError: Could not import settings 'graphite.settings' (Is it on sys.path? Does it have syntax errors?): No module named graphite.settings

(Not a python hacker. :( )

Provide mechanism to restore dashboards to graphite server

It would be great to provide this functionality. I've written a script that loads/saves dashboards from graphite, I'd love to be able to specify a dashboard to load to my newly provisioned graphite server.

This would be a great thing to add as an LWRP to the new graphite cookbook rework in #147

graphite-web python package missing after cookbook run

Hi,

I´m running this cookbook with the latest version available at Chef´s site-cookbooks (version 0.4.8) and having two problems:

  • with first run, the carbon restart (using runit) get´s stuck. This is not a problem anymore during a second Chef run.
  • bigger problem: for some reason the cookbook does not install the graphite-web pip at all - it does not mention the pip run at all in Chef´s run-log...

The OS is a fresh copy of Ubuntu 12.04.3 LTS.

base_dir doesn't work

This attribute and others (doc_root, storage_dir) won't work since the the package builds don't pass any prefix arguments.

Workaround: don't use anything other than /opt/graphite

I'm fixing this in another repo, lmk if you guys want a PR.

storage_schema attribute override

I've been trying to set my storage_schema attributes on a role (either normal or override) but chef keep merging the default found in the attribute file, putting the catchall at the top of the list. It seems that Carbon-Cache matches on the default catch-all rule and uses its retention in favor of anything I set. What is the recommended way of setting these?

Xcode Command line issue

Hi,

I am trying to use this cookbook for graphite deployment to one of my dev environment on my Mac.

I am deploying the machine inside vagrant with from my mac book.

While provisioning I am getting this erro

================================================================================
Recipe Compile Error in /tmp/vagrant-chef-1/chef-solo-1/cookbooks/build-essential/libraries/xcode_command_line_tools.rb
================================================================================

NameError
---------
uninitialized constant Chef::Resource::LWRPBase

Cookbook Trace:
---------------
  /tmp/vagrant-chef-1/chef-solo-1/cookbooks/build-essential/libraries/xcode_command_line_tools.rb:21

Relevant File Content:
----------------------
/tmp/vagrant-chef-1/chef-solo-1/cookbooks/build-essential/libraries/xcode_command_line_tools.rb:

  1:  #
  2:  # Cookbook Name:: build-essential
  3:  # Library:: xcode_command_line_tools
  4:  #
  5:  # Copyright 2014, Chef Software, Inc.
  6:  #
  7:  # Licensed under the Apache License, Version 2.0 (the "License");
  8:  # you may not use this file except in compliance with the License.
  9:  # You may obtain a copy of the License at

[2014-05-13T07:12:24+00:00] ERROR: Running exception handlers
[2014-05-13T07:12:24+00:00] ERROR: Exception handlers complete
[2014-05-13T07:12:24+00:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
[2014-05-13T07:12:24+00:00] FATAL: NameError: uninitialized constant Chef::Resource::LWRPBase
Chef never successfully completed! Any errors should be visible in the
output above. Please fix your recipes so that they properly complete.

I've installed Xcode command line packages as well , but still I am getting this error.

Any help would be appreciated.

thanks
suresh

Test kitchen failing for centos

At least it is for me. The other VMs seem to converge just fine. I tried sshing in and fixing it, but I couldn't figure it out. It looks like the twisted packages are pretty old. I installed twisted from source but continued to get errors when loading graphite. Someone more familiar with centos and python may need to have a go at it.

[2013-04-15T14:41:24+00:00] INFO: Processing package[python-twisted] action install (graphite::carbon line 20)

================================================================================

Error executing action `install` on resource 'package[python-twisted]'

================================================================================


Chef::Exceptions::Package
                                                                                                                                                                                                                                                                                                           [32/1956]
-------------------------

No version specified, and no candidate version available for python-twisted


Resource Declaration:

---------------------

# In /tmp/vagrant-chef-1/chef-solo-1/cookbooks/graphite/recipes/carbon.rb

 20: package "python-twisted"
 21: package "python-simplejson"

Compiled Resource:

------------------

# Declared in /tmp/vagrant-chef-1/chef-solo-1/cookbooks/graphite/recipes/carbon.rb:20:in `from_file'

package("python-twisted") do
  action :install
  retries 0
  retry_delay 2
  package_name "python-twisted"
  cookbook_name :graphite
  recipe_name "carbon"
end

[2013-04-15T14:41:54+00:00] ERROR: Running exception handlers
[2013-04-15T14:41:54+00:00] ERROR: Exception handlers complete
[2013-04-15T14:41:54+00:00] FATAL: Stacktrace dumped to /tmp/vagrant-chef-1/chef-stacktrace.out
[2013-04-15T14:41:54+00:00] FATAL: Chef::Exceptions::Package: package[python-twisted] (graphite::carbon line 20) had an error: Chef::Exceptions::Package: 
No version specified, and no candidate version available for python-twisted
STDERR: Called 'load_file' without the :safe option -- defaulting to safe mode.
Called 'load_file' without the :safe option -- defaulting to safe mode.
Chef never successfully completed! Any errors should be visible in the
output above. Please fix your recipes so that they properly complete.
---- End output of vagrant provision default-centos-58 ----
Ran vagrant provision default-centos-58 returned 231]
        from /home/meyouhealth/.rvm/gems/ruby-1.9.3-p194/gems/test-kitchen-1.0.0.alpha.0/lib/kitchen/instance.rb:266:in `action'
        from /home/meyouhealth/.rvm/gems/ruby-1.9.3-p194/gems/test-kitchen-1.0.0.alpha.0/lib/kitchen/instance.rb:246:in `perform_action'
        from /home/meyouhealth/.rvm/gems/ruby-1.9.3-p194/gems/test-kitchen-1.0.0.alpha.0/lib/kitchen/instance.rb:229:in `converge_action'
        from /home/meyouhealth/.rvm/gems/ruby-1.9.3-p194/gems/test-kitchen-1.0.0.alpha.0/lib/kitchen/instance.rb:219:in `block in transition_to'
        from /home/meyouhealth/.rvm/gems/ruby-1.9.3-p194/gems/test-kitchen-1.0.0.alpha.0/lib/kitchen/instance.rb:218:in `each'
        from /home/meyouhealth/.rvm/gems/ruby-1.9.3-p194/gems/test-kitchen-1.0.0.alpha.0/lib/kitchen/instance.rb:218:in `transition_to'
        from /home/meyouhealth/.rvm/gems/ruby-1.9.3-p194/gems/test-kitchen-1.0.0.alpha.0/lib/kitchen/instance.rb:143:in `verify'
        from /home/meyouhealth/.rvm/gems/ruby-1.9.3-p194/gems/test-kitchen-1.0.0.alpha.0/lib/kitchen/instance.rb:172:in `block in test'
        from /home/meyouhealth/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/benchmark.rb:280:in `measure'
        from /home/meyouhealth/.rvm/gems/ruby-1.9.3-p194/gems/test-kitchen-1.0.0.alpha.0/lib/kitchen/instance.rb:168:in `test'
        from /home/meyouhealth/.rvm/gems/ruby-1.9.3-p194/gems/test-kitchen-1.0.0.alpha.0/lib/kitchen/cli.rb:170:in `public_send'
        from /home/meyouhealth/.rvm/gems/ruby-1.9.3-p194/gems/test-kitchen-1.0.0.alpha.0/lib/kitchen/cli.rb:170:in `block in run_serial'
        from /home/meyouhealth/.rvm/gems/ruby-1.9.3-p194/gems/test-kitchen-1.0.0.alpha.0/lib/kitchen/cli.rb:170:in `map'
        from /home/meyouhealth/.rvm/gems/ruby-1.9.3-p194/gems/test-kitchen-1.0.0.alpha.0/lib/kitchen/cli.rb:170:in `run_serial'
        from /home/meyouhealth/.rvm/gems/ruby-1.9.3-p194/gems/test-kitchen-1.0.0.alpha.0/lib/kitchen/cli.rb:103:in `block in test'
        from /home/meyouhealth/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/benchmark.rb:280:in `measure'
        from /home/meyouhealth/.rvm/gems/ruby-1.9.3-p194/gems/test-kitchen-1.0.0.alpha.0/lib/kitchen/cli.rb:95:in `test'
        from /home/meyouhealth/.rvm/gems/ruby-1.9.3-p194/gems/thor-0.16.0/lib/thor/task.rb:27:in `run'
        from /home/meyouhealth/.rvm/gems/ruby-1.9.3-p194/gems/thor-0.16.0/lib/thor/invocation.rb:120:in `invoke_task'
        from /home/meyouhealth/.rvm/gems/ruby-1.9.3-p194/gems/thor-0.16.0/lib/thor.rb:275:in `dispatch'
        from /home/meyouhealth/.rvm/gems/ruby-1.9.3-p194/gems/thor-0.16.0/lib/thor/base.rb:425:in `start'
        from /home/meyouhealth/.rvm/gems/ruby-1.9.3-p194/gems/test-kitchen-1.0.0.alpha.0/bin/kitchen:12:in `'
        from /home/meyouhealth/.rvm/gems/ruby-1.9.3-p194/bin/kitchen:19:in `load'
        from /home/meyouhealth/.rvm/gems/ruby-1.9.3-p194/bin/kitchen:19:in `'
        from /home/meyouhealth/.rvm/gems/ruby-1.9.3-p194/bin/ruby_noexec_wrapper:14:in `eval'
        from /home/meyouhealth/.rvm/gems/ruby-1.9.3-p194/bin/ruby_noexec_wrapper:14:in `'

lazy not work

================================================================================
Recipe Compile Error in /tmp/vagrant-chef-1/chef-solo-1/cookbooks/graphite/recipes/default.rb
================================================================================

NoMethodError
-------------
undefined method `lazy' for Chef::Resource::PythonPip

Cookbook Trace:
---------------
  /tmp/vagrant-chef-1/chef-solo-1/cookbooks/graphite/recipes/whisper.rb:21:in `block in from_file'
  /tmp/vagrant-chef-1/chef-solo-1/cookbooks/graphite/recipes/whisper.rb:20:in `from_file'
  /tmp/vagrant-chef-1/chef-solo-1/cookbooks/graphite/recipes/default.rb:27:in `from_file'

Relevant File Content:
----------------------
/tmp/vagrant-chef-1/chef-solo-1/cookbooks/graphite/recipes/whisper.rb:

 14:  # distributed under the License is distributed on an "AS IS" BASIS,
 15:  # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 16:  # See the License for the specific language governing permissions and
 17:  # limitations under the License.
 18:  #
 19:
 20:  python_pip 'whisper' do
 21>>   package_name lazy {
 22:      node['graphite']['package_names']['whisper'][node['graphite']['install_type']]
 23:    }
 24:    version lazy {
 25:      node['graphite']['install_type'] == 'package' ? node['graphite']['version'] : nil
 26:    }
 27:  end
 28:
 29:  directory "#{node['graphite']['base_dir']}/bin/" do
 30:    recursive true

set_admin_passwd fails to import 'settings'

Can't figure this out for the life of me. I'm attempting to downgrade from 0.9.12 back to 0.9.10. So I went from cookbook version 0.4.7 to 0.4.5. I checked for any changes in attribute names and the like, but I didn't see anything that would cause any issues. I've cleared the graphite directory so this is almost like a fresh install except that I have a bunch of existing python packages already on the instance.

STDERR: Traceback (most recent call last):
  File "/mnt/graphite/bin/set_admin_passwd.py", line 8, in <module>
    from django.contrib.auth.models import User
  File "/usr/lib/python2.7/dist-packages/django/contrib/auth/models.py", line 7, in <module>
    from django.db import models
  File "/usr/lib/python2.7/dist-packages/django/db/__init__.py", line 14, in <module>
    if not settings.DATABASES:
  File "/usr/lib/python2.7/dist-packages/django/utils/functional.py", line 276, in __getattr__
    self._setup()
  File "/usr/lib/python2.7/dist-packages/django/conf/__init__.py", line 42, in _setup
    self._wrapped = Settings(settings_module)
  File "/usr/lib/python2.7/dist-packages/django/conf/__init__.py", line 89, in __init__
    raise ImportError("Could not import settings '%s' (Is it on sys.path?): %s" % (self.SETTINGS_MODULE, e))
ImportError: Could not import settings 'settings' (Is it on sys.path?): No module named settings```

undefined method `finish_script' for Chef::Resource::RunitService

Hi
I'm using the graphite cookbook v0.3.0

It fails with this message:

================================================================================
Recipe Compile Error in /var/chef/cache/cookbooks/graphite/recipes/default.rb
================================================================================


NoMethodError
-------------
undefined method `finish_script' for Chef::Resource::RunitService


Cookbook Trace:
---------------
  /var/chef/cache/cookbooks/graphite/recipes/carbon.rb:52:in `block in from_file'
  /var/chef/cache/cookbooks/graphite/recipes/carbon.rb:51:in `from_file'
  /var/chef/cache/cookbooks/graphite/recipes/default.rb:23:in `from_file'


Relevant File Content:
----------------------
/var/chef/cache/cookbooks/graphite/recipes/carbon.rb:

 45:
 46:  directory "/opt/graphite/lib/twisted/plugins/" do
 47:    owner "www-data"
 48:    group "www-data"
 49:  end
 50:
 51:  runit_service "carbon-cache" do
 52>>   finish_script true
 53:  end
 54:

Is there a specific version of runit that I need?
It looks like I need anything more recent that 1.0 (https://github.com/hw-cookbooks/graphite/blob/master/metadata.rb#L20) and I have 1.5.9 on the server.

config options such as LOG_CACHE_HITS missing?

Hi,
there seems to be no way to configure LOG_CACHE_HITS for carbon. or am i missing something?
maybe this cookbook needs an update for all the new config options that have been introduced in the last graphite release(s) ?

Cookbook does not install python-ldap

Cookbook doesn't install the ldap module when ldap settings are indicated.

I expect that if ldap settings are indicated, the pre-reqs to make them work be included.

Please add a few lines explaining how to get going

Great recipe, much appreciated!

For newbie's, can someone add a few lines explaining which ports and urls are setup by default so they can get going?

Maybe a starter script or something that pushes some dummy metrics into the system to show it is working etc.

I guess I am looking for a quick-start guide, I've heard it is pretty hard to get graphite setup and I came across this recipe and excited to get going, just want a little push to help me on my way and I'm sure others would appreciate it also.

No version specified, and no candidate version available for Django

Trying to install graphite and logstash , i stumbled on

  • No version specified, and no candidate version available for Django

Error executing action install on resource 'package[Django]'

Chef::Exceptions::Package

No version specified, and no candidate version available for Django

Resource Declaration:

/# In /var/chef/cache/cookbooks/graphite/recipes/web.rb

72: package pkg do
73: action :install
74: end
75: end

Compiled Resource:

/# Declared in /var/chef/cache/cookbooks/graphite/recipes/web.rb:72:in `block in from_file'

package("Django") do
action [:install]
retries 0
retry_delay 2
package_name "Django"
cookbook_name "graphite"
recipe_name "web"
end

I am in centos 6
Any help?

thank you

Chef::Exceptions::ResourceNotFound: resource template[/opt/graphite/conf/storage-schemas.conf]

Ubuntu 12.04.3 LTS

Downloaded the recipe from http://community.opscode.com/cookbooks/graphite, and I added the following to my run list:

run_list "recipe[graphite]"

I got the below error

sudo cat chef/chef-stacktrace.out 
Generated at 2013-10-08 15:58:57 +0000
Chef::Exceptions::ResourceNotFound: resource template[/opt/graphite/conf/storage-schemas.conf] is configured to notify resource runit_service[carbon-cache] with action restart, but runit_service[carbon-cache] cannot be found in the resource collection. template[/opt/graphite/conf/storage-schemas.conf] is defined in /home/ubuntu/chef/cookbooks/graphite/recipes/carbon_cache.rb:28:in `from_file'

/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.6.0/lib/chef/resource_collection.rb:123:in `lookup'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.6.0/lib/chef/resource_collection.rb:241:in `find_resource_by_string'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.6.0/lib/chef/resource_collection.rb:147:in `block in find'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.6.0/lib/chef/resource_collection.rb:142:in `each'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.6.0/lib/chef/resource_collection.rb:142:in `find'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.6.0/lib/chef/resource.rb:63:in `fix_resource_reference'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.6.0/lib/chef/resource.rb:52:in `resolve_resource_reference'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.6.0/lib/chef/resource.rb:430:in `block in resolve_notification_references'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.6.0/lib/chef/resource.rb:430:in `each'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.6.0/lib/chef/resource.rb:430:in `resolve_notification_references'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.6.0/lib/chef/runner.rb:76:in `block in converge'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.6.0/lib/chef/resource_collection.rb:90:in `block in each'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.6.0/lib/chef/resource_collection.rb:89:in `each'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.6.0/lib/chef/resource_collection.rb:89:in `each'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.6.0/lib/chef/runner.rb:75:in `converge'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.6.0/lib/chef/client.rb:429:in `converge'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.6.0/lib/chef/client.rb:494:in `do_run'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.6.0/lib/chef/client.rb:199:in `block in run'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.6.0/lib/chef/client.rb:193:in `fork'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.6.0/lib/chef/client.rb:193:in `run'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.6.0/lib/chef/application.rb:183:in `run_chef_client'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.6.0/lib/chef/application/solo.rb:239:in `block in run_application'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.6.0/lib/chef/application/solo.rb:231:in `loop'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.6.0/lib/chef/application/solo.rb:231:in `run_application'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.6.0/lib/chef/application.rb:66:in `run'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.6.0/bin/chef-solo:25:in `<top (required)>'
/usr/bin/chef-solo:23:in `load'

I also tried adding recipe[graphite::carbon_aggregator] but it gave the same error.

[ec2] deviate from default /opt/graphite installation path

Hey Folks,

in Amazon the most common place to store large data chunks are sadly not in /opt/.

if i specify:

default['graphite']['base_dir'] = '/mnt/graphite'
default['graphite']['doc_root'] = '/mnt/graphite/webapp'
default['graphite']['storage_dir'] = '/mnt/graphite/storage'

everything so far gets smooth installed. But accessing the WebUI results in an Database cannot be opened error.
After some research i found some files/places that still are pointing to /opt/graphite

my current bug-fix is to create a symlink front /opt/graphite => current graphite installation directory.
It does the trick.

im not sure to mark this as bug - i guess its more an improvement.

so long
Daniel

Error executing action `enable` on resource 'runit_service[carbon-cache]'

on ubuntu 12.04 I get the following error

[2013-10-24T22:13:58+00:00] INFO: Processing runit_service[carbon-cache] action enable (graphite::carbon_cache_runit line 22)

Error executing action enable on resource 'runit_service[carbon-cache]'

NameError
Cannot find a resource for load_new_resource_state on ubuntu version 12.04

Cookbook Trace:
/root/monitoring/cookbooks/runit/libraries/provider_runit_service.rb:94:in `action_enable'

Resource Declaration:
In /root/monitoring/cookbooks/graphite/recipes/carbon_cache_runit.rb

Alternate storage directory

When setting storage_dir to someplace outside of /opt/graphite/storage, carbon-cache fails to launch with "/opt/graphite/storage/log/carbon-cache", as the chmod hasn't happened for this location.

OSError: [Errno 13] Permission denied: '/opt/graphite/storage/log/carbon-cache'

When running the recipe[graphite] i am getting the following error.

Recipe: graphite::web

* execute[set admin password] action run

Error executing action run on resource 'execute[set admin password]'

Mixlib::ShellOut::ShellCommandFailed

Expected process to exit with [0], but received '1'
---- Begin output of /opt/graphite/bin/set_admin_passwd.py root change_me ----
STDOUT:
STDERR: Traceback (most recent call last):
File "/opt/graphite/bin/set_admin_passwd.py", line 8, in
from django.contrib.auth.models import User
ImportError: No module named django.contrib.auth.models
---- End output of /opt/graphite/bin/set_admin_passwd.py root change_me ----
Ran /opt/graphite/bin/set_admin_passwd.py root change_me returned 1

Resource Declaration:

In /var/chef/cache/cookbooks/graphite/recipes/web.rb

110: execute 'set admin password' do
111: command "#{basedir}/bin/set_admin_passwd.py root #{password}"
112: action :nothing
113: end

TimeZones and platform support.

Is there any chance we can get this cookbook to allow setting the timezone in graphite
default is US (Chicago) some of us are from outside there :)

/opt/graphite/webapp/graphite/settings.py

TIME_ZONE = 'America/Chicago'

also this cookbook is working on debian as well as ubuntu but the nodejs must be set to source not package in that case.

Missing data if not using default storage dir

I tried to install Graphite using the following:

"graphite": {
    "password": "secret",
    "url": "server.com",
    "listen_port": 8000,
    "storage_dir": "/mnt/opt/graphite",
    "storage_schemas": [...]
    "storage_aggregation": [..]
}

This appears to work, but if you look in the Graphite browser, you never see any stats. This appears to be because of a missing rrd directory in /mnt/opt/graphite, as evidenced by this log from //mnt/opt/graphite/log/webapp/exception.log:

Wed Sep 04 12:15:07 2013 :: Exception Caught
Traceback (most recent call last):
  File "/opt/graphite/webapp/graphite/metrics/views.py", line 135, in find_view
    matches = list( store.find(query) )
  File "/opt/graphite/webapp/graphite/storage.py", line 49, in find
    for match in self.find_all(query):
  File "/opt/graphite/webapp/graphite/storage.py", line 80, in find_all
    for match in find(directory, query):
  File "/opt/graphite/webapp/graphite/storage.py", line 139, in find
    for absolute_path in _find(root_dir, pattern_parts):
  File "/opt/graphite/webapp/graphite/storage.py", line 185, in _find
    entries = os.listdir(current_dir)
OSError: [Errno 2] No such file or directory: '/mnt/opt/graphite/rrd'

Creating the rrd directory fixes the problem.

Python pip error

Hi,

while running chef, I got below error

Relevant File Content:

/var/chef/cache/cookbooks/graphite/recipes/whisper.rb:

14: # distributed under the License is distributed on an "AS IS" BASIS,
15: # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16: # See the License for the specific language governing permissions and
17: # limitations under the License.
18: #
19:
20: python_pip 'whisper' do
21>> package_name lazy {
22: node['graphite']['package_names']['whisper'][node['graphite']['install_type']]
23: }
24: version lazy {
25: node['graphite']['install_type'] == 'package' ? node['graphite']['version'] : nil
26: }
27: end
28:
29: directory "#{node['graphite']['base_dir']}/bin/" do
30: recursive true

[2014-04-01T17:32:48+00:00] ERROR: Running exception handlers
[2014-04-01T17:32:49+00:00] FATAL: Saving node information to /var/chef/cache/failed-run-data.json
[2014-04-01T17:32:49+00:00] ERROR: Exception handlers complete
Chef Client failed. 0 resources updated
[2014-04-01T17:32:49+00:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
[2014-04-01T17:32:49+00:00] FATAL: NoMethodError: undefined method `lazy' for Chef::Resource::PythonPip

Could you please help over this.

WebApp Cache busting

I need(it works anyway) to include the following in the local_settings.py in order to prevent stale metrics being returned for a minute:

CACHES = {
    'default': {
        'BACKEND': 'django.core.cache.backends.dummy.DummyCache',
    },
}

Perhaps an "escape hatch" of sorts could be included in the template to allow arbitrary extra text to be placed in the file?

ssl test suites failing to converge

ssl test suite uses a graphite_test cookbook, this could be handled better and the test specific cookbook could be eliminated or improved

template[/opt/graphite/conf/storage-schemas.conf] action create error

Ubuntu 12.04.3 LTS

run_list "recipe[graphite]"

I got the following error

  • template[/opt/graphite/conf/storage-schemas.conf] action create

Error executing action create on resource 'template[/opt/graphite/conf/storage-schemas.conf]'

Chef::Mixin::Template::TemplateError
undefined method `sort' for "catchall":String

apache cookbook attrs not accessible

So I just realized that this doesn't work:

default['graphite']['user_account'] = node['apache']['user']
default['graphite']['group_account'] = node['apache']['group']

as those throw a nil.

I'm not sure the best way to handle this as we need those attributes set because they're used to control permissions of files in other recipes.

The only way that makes sense is to include_attribute "apache2" conditionally based on the value of default['graphite']['web_server'] and set the default to something like graphite

Thoughts?

ImproperlyConfigured: Error importing template source loader django.template.loaders.filesystem.load_template_source

There's a very good chance that my problem lies elsewhere, but I figured I would post here in case anyone has seen this before.

I just brought up a vagrant box with the graphite::default recipe in it's run_list. The chef run completes successfully but I get a 500 error when trying to access the Graphite webapp. The following appears in the /opt/graphite/storage/log/webapp/error.log log file:

[Tue Apr 09 12:49:31 2013] [error] [client 10.0.2.2] ImproperlyConfigured: Error importing template source loader django.template.loaders.filesystem.load_template_source: "'module' object has no attribute 'load_template_source'"
[Tue Apr 09 12:49:31 2013] [error] [client 10.0.2.2] mod_python (pid=10757, interpreter='graphite', phase='PythonHandler', handler='django.core.handlers.modpython'): Application error
[Tue Apr 09 12:49:31 2013] [error] [client 10.0.2.2] ServerName: 'graphite'
[Tue Apr 09 12:49:31 2013] [error] [client 10.0.2.2] DocumentRoot: '/opt/graphite/webapp'
[Tue Apr 09 12:49:31 2013] [error] [client 10.0.2.2] URI: '/favicon.ico'
[Tue Apr 09 12:49:31 2013] [error] [client 10.0.2.2] Location: '/'
[Tue Apr 09 12:49:31 2013] [error] [client 10.0.2.2] Directory: None
[Tue Apr 09 12:49:31 2013] [error] [client 10.0.2.2] Filename: '/opt/graphite/webapp/favicon.ico'
[Tue Apr 09 12:49:31 2013] [error] [client 10.0.2.2] PathInfo: ''
[Tue Apr 09 12:49:31 2013] [error] [client 10.0.2.2] Traceback (most recent call last):
[Tue Apr 09 12:49:31 2013] [error] [client 10.0.2.2]   File "/usr/lib/python2.7/dist-packages/mod_python/importer.py", line 1537, in HandlerDispatch\n    default=default_handler, arg=req, silent=hlist.silent)
[Tue Apr 09 12:49:31 2013] [error] [client 10.0.2.2]   File "/usr/lib/python2.7/dist-packages/mod_python/importer.py", line 1229, in _process_target\n    result = _execute_target(config, req, object, arg)
[Tue Apr 09 12:49:31 2013] [error] [client 10.0.2.2]   File "/usr/lib/python2.7/dist-packages/mod_python/importer.py", line 1128, in _execute_target\n    result = object(arg)
[Tue Apr 09 12:49:31 2013] [error] [client 10.0.2.2]   File "/usr/lib/python2.7/dist-packages/django/core/handlers/modpython.py", line 180, in handler\n    return ModPythonHandler()(req)
[Tue Apr 09 12:49:31 2013] [error] [client 10.0.2.2]   File "/usr/lib/python2.7/dist-packages/django/core/handlers/modpython.py", line 158, in __call__\n    response = self.get_response(request)
[Tue Apr 09 12:49:31 2013] [error] [client 10.0.2.2]   File "/usr/lib/python2.7/dist-packages/django/core/handlers/base.py", line 179, in get_response\n    response = self.handle_uncaught_exception(request, resolver, sys.exc_info())
[Tue Apr 09 12:49:31 2013] [error] [client 10.0.2.2]   File "/usr/lib/python2.7/dist-packages/django/core/handlers/base.py", line 228, in handle_uncaught_exception\n    return callback(request, **param_dict)
[Tue Apr 09 12:49:31 2013] [error] [client 10.0.2.2]   File "/opt/graphite/webapp/graphite/views.py", line 8, in server_error\n    template = loader.get_template(template_name)
[Tue Apr 09 12:49:31 2013] [error] [client 10.0.2.2]   File "/usr/lib/python2.7/dist-packages/django/template/loader.py", line 145, in get_template\n    template, origin = find_template(template_name)
[Tue Apr 09 12:49:31 2013] [error] [client 10.0.2.2]   File "/usr/lib/python2.7/dist-packages/django/template/loader.py", line 128, in find_template\n    loader = find_template_loader(loader_name)
[Tue Apr 09 12:49:31 2013] [error] [client 10.0.2.2]   File "/usr/lib/python2.7/dist-packages/django/template/loader.py", line 101, in find_template_loader\n    raise ImproperlyConfigured('Error importing template source loader %s: "%s"' % (loader, e))
[Tue Apr 09 12:49:31 2013] [error] [client 10.0.2.2] ImproperlyConfigured: Error importing template source loader django.template.loaders.filesystem.load_template_source: "'module' object has no attribute 'load_template_source'"

I'm using the graphite(0.4.2) and apache2(1.6.0) cookbooks.

I'll followup if I figure out a solution to the problem. I know next to nothing about how python apps work.

storage-aggregation.conf belongs to carbon-cache, not carbon-aggregator

Despite the filename, storage-aggregation.conf is a part of carbon-cache relating to the storage aggregation attributes laid down in Whisper database files. It is unrelated to carbon-aggregator, which aggregates and rewrites metrics in-flight before they reach carbon-cache, and its current placement prevents aggregation rules from being set in simple Graphite configurations that do not require an aggregator layer. It should be moved into the carbon_cache recipe instead.

Here is the Launchpad commit where the feature was added back in 2011:

https://code.launchpad.net/~jerith/graphite/storage-aggregation/+merge/76355

carbon cache with runit logs to bad location

Carbon cache using runit logs to /etc/sv/carbon-cache/log/main. Given that Apache is configured to use /opt/graphite/storage/log/webapp should carbon cache logs go to /opt/graphite/storage/log/carbon-cache?

When running recipe[graphite] i get NoMethodError

I've got the same NoMethodError for 'lazy' in versions 0.4.6 0.4.5... Tested on chef-solo: 11.4.4. If you need any more info just let me know.

================================================================================
Recipe Compile Error in /var/chef/cookbooks/graphite/recipes/default.rb
================================================================================


NoMethodError
-------------
undefined method `lazy' for Chef::Resource::Execute


Cookbook Trace:
---------------
  /var/chef/cookbooks/graphite/recipes/whisper.rb:37:in `block in from_file'
  /var/chef/cookbooks/graphite/recipes/whisper.rb:34:in `from_file'
  /var/chef/cookbooks/graphite/recipes/default.rb:25:in `from_file'


Relevant File Content:
----------------------
/var/chef/cookbooks/graphite/recipes/whisper.rb:

 30:    creates "#{Chef::Config[:file_cache_path]}/whisper-#{version}"
 31:    cwd Chef::Config[:file_cache_path]
 32:  end
 33:
 34:  execute 'install whisper' do
 35:    command "python setup.py install --prefix=#{node['graphite']['base_dir']} --install-lib=#{install_lib_dir}"
 36:    cwd "#{Chef::Config[:file_cache_path]}/whisper-#{version}"
 37>>   creates lazy {
 38:      pyver = node['languages']['python'] && node['languages']['python']['version'][0..-3] || node['python']['version'][0..-3]
 39:      "#{install_lib_dir}/whisper-#{version}-py#{pyver}.egg-info"
 40:    }
 41:  end
 42:
 43:  directory "#{node['graphite']['base_dir']}/bin" do
 44:    owner 'root'
 45:    group 'root'
 46:    recursive true



[2014-02-28T13:49:50+00:00] DEBUG: Re-raising exception: NoMethodError - undefined method `lazy' for Chef::Resource::Execute
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.4/lib/chef/resource.rb:282:in `method_missing'
  /var/chef/cookbooks/graphite/recipes/whisper.rb:37:in `block in from_file'
  /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.4/lib/chef/dsl/recipe.rb:71:in `instance_eval'
  /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.4/lib/chef/dsl/recipe.rb:71:in `method_missing'
  /var/chef/cookbooks/graphite/recipes/whisper.rb:34:in `from_file'
  /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.4/lib/chef/mixin/from_file.rb:30:in `instance_eval'
  /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.4/lib/chef/mixin/from_file.rb:30:in `from_file'
  /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.4/lib/chef/cookbook_version.rb:346:in `load_recipe'
  /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.4/lib/chef/run_context.rb:151:in `load_recipe'
  /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.4/lib/chef/run_context.rb:132:in `block in include_recipe'
  /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.4/lib/chef/run_context.rb:131:in `each'
  /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.4/lib/chef/run_context.rb:131:in `include_recipe'
  /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.4/lib/chef/dsl/include_recipe.rb:26:in `include_recipe'
  /var/chef/cookbooks/graphite/recipes/default.rb:25:in `from_file'
  /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.4/lib/chef/mixin/from_file.rb:30:in `instance_eval'
  /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.4/lib/chef/mixin/from_file.rb:30:in `from_file'
  /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.4/lib/chef/cookbook_version.rb:346:in `load_recipe'
  /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.4/lib/chef/run_context.rb:151:in `load_recipe'
  /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.4/lib/chef/run_context/cookbook_compiler.rb:139:in `block in compile_recipes'
  /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.4/lib/chef/run_context/cookbook_compiler.rb:137:in `each'
  /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.4/lib/chef/run_context/cookbook_compiler.rb:137:in `compile_recipes'
  /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.4/lib/chef/run_context/cookbook_compiler.rb:74:in `compile'
  /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.4/lib/chef/run_context.rb:86:in `load'
  /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.4/lib/chef/client.rb:224:in `setup_run_context'
  /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.4/lib/chef/client.rb:467:in `do_run'
  /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.4/lib/chef/client.rb:200:in `run'
  /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.4/lib/chef/application.rb:190:in `run_chef_client'
  /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.4/lib/chef/application/solo.rb:239:in `block in run_application'
  /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.4/lib/chef/application/solo.rb:231:in `loop'
  /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.4/lib/chef/application/solo.rb:231:in `run_application'
  /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.4/lib/chef/application.rb:73:in `run'
  /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.4/bin/chef-solo:25:in `<top (required)>'
  /usr/bin/chef-solo:23:in `load'
  /usr/bin/chef-solo:23:in `<main>'
[2014-02-28T13:49:50+00:00] ERROR: Running exception handlers
[2014-02-28T13:49:50+00:00] ERROR: Exception handlers complete
[2014-02-28T13:49:50+00:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
[2014-02-28T13:49:50+00:00] DEBUG: NoMethodError: undefined method `lazy' for Chef::Resource::Execute
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.4/lib/chef/resource.rb:282:in `method_missing'
/var/chef/cookbooks/graphite/recipes/whisper.rb:37:in `block in from_file'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.4/lib/chef/dsl/recipe.rb:71:in `instance_eval'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.4/lib/chef/dsl/recipe.rb:71:in `method_missing'
/var/chef/cookbooks/graphite/recipes/whisper.rb:34:in `from_file'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.4/lib/chef/mixin/from_file.rb:30:in `instance_eval'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.4/lib/chef/mixin/from_file.rb:30:in `from_file'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.4/lib/chef/cookbook_version.rb:346:in `load_recipe'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.4/lib/chef/run_context.rb:151:in `load_recipe'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.4/lib/chef/run_context.rb:132:in `block in include_recipe'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.4/lib/chef/run_context.rb:131:in `each'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.4/lib/chef/run_context.rb:131:in `include_recipe'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.4/lib/chef/dsl/include_recipe.rb:26:in `include_recipe'
/var/chef/cookbooks/graphite/recipes/default.rb:25:in `from_file'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.4/lib/chef/mixin/from_file.rb:30:in `instance_eval'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.4/lib/chef/mixin/from_file.rb:30:in `from_file'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.4/lib/chef/cookbook_version.rb:346:in `load_recipe'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.4/lib/chef/run_context.rb:151:in `load_recipe'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.4/lib/chef/run_context/cookbook_compiler.rb:139:in `block in compile_recipes'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.4/lib/chef/run_context/cookbook_compiler.rb:137:in `each'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.4/lib/chef/run_context/cookbook_compiler.rb:137:in `compile_recipes'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.4/lib/chef/run_context/cookbook_compiler.rb:74:in `compile'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.4/lib/chef/run_context.rb:86:in `load'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.4/lib/chef/client.rb:224:in `setup_run_context'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.4/lib/chef/client.rb:467:in `do_run'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.4/lib/chef/client.rb:200:in `run'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.4/lib/chef/application.rb:190:in `run_chef_client'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.4/lib/chef/application/solo.rb:239:in `block in run_application'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.4/lib/chef/application/solo.rb:231:in `loop'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.4/lib/chef/application/solo.rb:231:in `run_application'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.4/lib/chef/application.rb:73:in `run'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.4/bin/chef-solo:25:in `<top (required)>'
/usr/bin/chef-solo:23:in `load'
/usr/bin/chef-solo:23:in `<main>'
[2014-02-28T13:49:50+00:00] FATAL: NoMethodError: undefined method `lazy' for Chef::Resource::Execute

Default settings for graphite web do not work

/var/chef/cache/cookbooks/graphite/recipes/uwsgi.rb throws an error when the listen_port is less than 1024 and listen_http is true.

The default listen_port is 80 and the listen_http is true.

Why is this check necessary? Also, default values shouldn't cause a failure. Either default listen_http to off or remove this check.

htpasswd -bc error

OS: Ubuntu 12.04 x64
Tested graphite cookbook versions: 0.4.3, 0.4.8

attributes:

"graphite":
    {
        "password": "suchmuchrandom",
        ...
        "apache":
        {
            "basic_auth":
            {
                "enabled": true,
                "file_path": "/etc/apache2/graphite.htpasswd",
                "user": "graphite",
                "password": "suchmuchrandom"
            }
        }
    },

Stacktrace:

162.243.221.218 [2014-03-29T15:39:57-04:00] ERROR: Running exception handlers
162.243.221.218 [2014-03-29T15:39:57-04:00] ERROR: Exception handlers complete
162.243.221.218 [2014-03-29T15:39:57-04:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
162.243.221.218 [2014-03-29T15:39:57-04:00] DEBUG: Mixlib::ShellOut::ShellCommandFailed: execute[create apache basic_auth file for graphite] (graphite::apache line 5) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '2'
162.243.221.218 ---- Begin output of htpasswd -bc /etc/apache2/graphite.htpasswd graphite  ----
162.243.221.218 STDOUT: 
162.243.221.218 STDERR: Usage:
162.243.221.218     htpasswd [-cmdpsD] passwordfile username
162.243.221.218     htpasswd -b[cmdpsD] passwordfile username password
162.243.221.218 
162.243.221.218     htpasswd -n[mdps] username
162.243.221.218     htpasswd -nb[mdps] username password
162.243.221.218  -c  Create a new file.
162.243.221.218  -n  Don't update file; display results on stdout.
162.243.221.218  -m  Force MD5 encryption of the password (default).
162.243.221.218  -d  Force CRYPT encryption of the password.
162.243.221.218  -p  Do not encrypt the password (plaintext).
162.243.221.218  -s  Force SHA encryption of the password.
162.243.221.218  -b  Use the password from the command line rather than prompting for it.
162.243.221.218  -D  Delete the specified user.
162.243.221.218 On other systems than Windows, NetWare and TPF the '-p' flag will probably not work.
162.243.221.218 The SHA algorithm does not use a salt and is less secure than the MD5 algorithm.
162.243.221.218 ---- End output of htpasswd -bc /etc/apache2/graphite.htpasswd graphite  ----
162.243.221.218 Ran htpasswd -bc /etc/apache2/graphite.htpasswd graphite  returned 2

Looks like the format of htpasswd command was incorrect

include_recipe memcached in default recipe

Doesn't make any sense IF your memcached is NOT running on the same host as Graphite.
Instead I'd propose to have an attribute like:

node['graphite']['web']['memcached_local'] = True

ONLY if this attribute is set to True you should include_recipe memcached and thus essentially install/setup memcached on the Graphite host.

node['graphite']['base_dir'] unchangable from "/opt/graphite" based on python setup.py call

I made an attempt to install graphite in a different location by overriding the node.graphite.base_dir attribute, however, this had little effect. On line 42 in carbon.rb it calls the command "python setup.py install" without any arguments that specify the base_dir and therefore defaults to /opt/graphite regardless of what you change the base_dir too.

i do not know if there is a way to pass that in as an argument, but alternatively, creating a template for the setup.cfg that incorporates the base_dir should do the trick.

i will write a patch to do so when I find the time, but I figured I should file an issue anyways, so it is at least catalogued.

apache2.4 appears to break the graphite cookbook

I am having issues installing graphite using the default apache version (2.4) on Ubuntu 13.10. Is there any easy workaround to fixing this? Or is there something simple I can do to get this cookbook working on Ubuntu 13.10 with apache2.4?

Here is the error message I am receiving:

Recipe: apache2::mod_authz_default
  * execute[a2enmod authz_default] action run[2014-05-19T02:02:47+00:00] INFO: Processing execute[a2enmod authz_default] action run (apache2::mod_authz_default line 37)

================================================================================
Error executing action `run` on resource 'execute[a2enmod authz_default]'
================================================================================


Mixlib::ShellOut::ShellCommandFailed
------------------------------------
Expected process to exit with [0], but received '1'
---- Begin output of /usr/sbin/a2enmod authz_default ----
STDOUT:
STDERR: ERROR: Module authz_default does not exist!
---- End output of /usr/sbin/a2enmod authz_default ----
Ran /usr/sbin/a2enmod authz_default returned 1


Resource Declaration:
---------------------
# In /tmp/kitchen/cookbooks/apache2/definitions/apache_module.rb

 37:     execute "a2enmod #{params[:name]}" do
        38:       command "/usr/sbin/a2enmod #{params[:name]}"

        39:       notifies :reload, 'service[apache2]'
        40:       not_if do
        41:         ::File.symlink?("#{node['apache']['dir']}/mods-enabled/#{params[:name]}.load") &&
        42:         (::File.exists?("#{node['apache']['dir']}/mods-available/#{params[:name]}.conf") ? ::File.symlink?("#{node['apache']['dir']}/mods-enabled/#{params[:name]}.conf") : true)
        43:       end
        44:     end
        45:   else

       Compiled Resource:
       ------------------
# Declared in /tmp/kitchen/cookbooks/apache2/definitions/apache_module.rb:37:in `block in from_file'

       execute("a2enmod authz_default") do
         params {:enable=>true, :conf=>false, :name=>"authz_default", :filename=>"mod_authz_default.so", :module_path=>"/usr/lib/apache2/modules/mod_authz_default.so", :identifier=>"authz_default_module"}
         action "run"
         retries 0
         retry_delay 2
         guard_interpreter :default
         command "/usr/sbin/a2enmod authz_default"
         backup 5
         returns 0
         cookbook_name :apache2
         recipe_name "mod_authz_default"
         not_if { #code block }
       end



       [2014-05-19T02:02:47+00:00] INFO: Running queued delayed notifications before re-raising exception


Running handlers:
       [2014-05-19T02:02:47+00:00] ERROR: Running exception handlers
       Running handlers complete


       [2014-05-19T02:02:47+00:00] ERROR: Exception handlers complete
[2014-05-19T02:02:47+00:00] FATAL: Stacktrace dumped to /tmp/kitchen/cache/chef-stacktrace.out
Chef Client failed. 2 resources updated in 21.910923729 seconds
[2014-05-19T02:02:47+00:00] ERROR: execute[a2enmod authz_default] (apache2::mod_authz_default line 37) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '1'
---- Begin output of /usr/sbin/a2enmod authz_default ----
STDOUT:
STDERR: ERROR: Module authz_default does not exist!
---- End output of /usr/sbin/a2enmod authz_default ----
Ran /usr/sbin/a2enmod authz_default returned 1
[2014-05-19T02:02:47+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.