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

Chef: "No version specified, and no candidate version available for" #579

Closed
iblancasa opened this issue Jan 13, 2015 · 11 comments
Closed

Comments

@iblancasa
Copy link

Buenas.
Estoy intentando ejecutar el ejemplo de Chef... y no lo consigo... El error que tengo es este:

iblancasa@iblancasaPC:~$ sudo chef-solo -c chef/solo.rb
DL is deprecated, please use Fiddle
Starting Chef Client, version 12.0.3
Compiling Cookbooks...
Converging 3 resources
Recipe: emacs::default
  * apt_package[emacs] action install
    * No version specified, and no candidate version available for emacs
    ================================================================================
    Error executing action `install` on resource 'apt_package[emacs]'
    ================================================================================

    Chef::Exceptions::Package
    -------------------------
    No version specified, and no candidate version available for emacs

    Resource Declaration:
    ---------------------
    # In /home/iblancasa/chef/cookbooks/emacs/recipes/default.rb

      1: package 'emacs'
      2: directory '/home/iblancasa/Documentos'

    Compiled Resource:
    ------------------
    # Declared in /home/iblancasa/chef/cookbooks/emacs/recipes/default.rb:1:in `from_file'

    apt_package("emacs") do
      action :install
      retries 0
      retry_delay 2
      default_guard_interpreter :default
      package_name "emacs"
      timeout 900
      declared_type :package
      cookbook_name :emacs
      recipe_name "default"
    end


Running handlers:
[2015-01-13T14:10:58+01:00] ERROR: Running exception handlers
Running handlers complete
[2015-01-13T14:10:58+01:00] ERROR: Exception handlers complete
[2015-01-13T14:10:58+01:00] FATAL: Stacktrace dumped to /home/iblancasa/chef/chef-stacktrace.out
Chef Client failed. 0 resources updated in 1.501709166 seconds
[2015-01-13T14:10:58+01:00] ERROR: apt_package[emacs] (emacs::default line 1) had an error: Chef::Exceptions::Package: No version specified, and no candidate version available for emacs
[2015-01-13T14:10:59+01:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)

Mi fichero solo.rb es:

file_cache_path "/home/iblancasa/chef"
cookbook_path "/home/iblancasa/chef/cookbooks"
json_attribs "/home/iblancasa/chef/node.json"

El node.json:

{
    "emacs":{
        "version" : "24.4"
    },
    "run_list": [ "recipe[emacs]" ]
}

Y el default.rb:

package 'emacs'
directory '/home/iblancasa/Documentos'
file "/home/iblancasa/Documentos/LEEME" do
    owner "iblancasa"
    group "iblancasa"
    mode 00544
    action :create
    content "Directorio para documentos diversos"
end

y los directorios así:

iblancasa@iblancasaPC:~/chef$ tree
.
├── chef-client-running.pid
├── chef-stacktrace.out
├── cookbooks
│   └── emacs
│       └── recipes
│           └── default.rb
├── node.json
└── solo.rb

Si quito, dentro de la receta, el package 'emacs', el resto funciona correctamente...

Gracias.

@JJ
Copy link
Owner

JJ commented Jan 13, 2015

¿Dónde estás tratando de instalarlo?

@iblancasa
Copy link
Author

He probado a hacerlo en mi máquina virtual y, por si es que hubiera algún problema con la conexión, después he probado con mi sistema operativo anfitrión.

Hoy he visto con usted que está leyendo el "node.js" y que, indicándole que lo lea, tampoco pasa nada nuevo:
sudo chef-solo -c chef/solo.rb -j chef/node.js

@JJ
Copy link
Owner

JJ commented Jan 13, 2015

pero no acabo de entender muy bien lo del node.js... por otro lado, hay un
log que puedes consultar y también prueba a ejecutarlo con -verbose o
--verbose.

Di también en qué sistema operativo estás intentando instalar algo. Igual
la versión es del chef en sí. He buscado un poco por Google y stackoverflow
y la verdad es que no he encontrado nada razonable...

@iblancasa
Copy link
Author

El log me genera

Generated at 2015-01-13 17:16:45 +0100
Chef::Exceptions::Package: apt_package[emacs] (emacs::default line 1) had an error: Chef::Exceptions::Package: No version specified, and no candidate version available for emacs
/usr/local/lib/ruby/gems/2.0.0/gems/chef-12.0.3/lib/chef/mixin/why_run.rb:241:in `run'
/usr/local/lib/ruby/gems/2.0.0/gems/chef-12.0.3/lib/chef/mixin/why_run.rb:322:in `block in run'
/usr/local/lib/ruby/gems/2.0.0/gems/chef-12.0.3/lib/chef/mixin/why_run.rb:321:in `each'
/usr/local/lib/ruby/gems/2.0.0/gems/chef-12.0.3/lib/chef/mixin/why_run.rb:321:in `run'
/usr/local/lib/ruby/gems/2.0.0/gems/chef-12.0.3/lib/chef/provider.rb:159:in `process_resource_requirements'
/usr/local/lib/ruby/gems/2.0.0/gems/chef-12.0.3/lib/chef/provider.rb:135:in `run_action'
/usr/local/lib/ruby/gems/2.0.0/gems/chef-12.0.3/lib/chef/resource.rb:582:in `run_action'
/usr/local/lib/ruby/gems/2.0.0/gems/chef-12.0.3/lib/chef/runner.rb:49:in `run_action'
/usr/local/lib/ruby/gems/2.0.0/gems/chef-12.0.3/lib/chef/runner.rb:81:in `block (2 levels) in converge'
/usr/local/lib/ruby/gems/2.0.0/gems/chef-12.0.3/lib/chef/runner.rb:81:in `each'
/usr/local/lib/ruby/gems/2.0.0/gems/chef-12.0.3/lib/chef/runner.rb:81:in `block in converge'
/usr/local/lib/ruby/gems/2.0.0/gems/chef-12.0.3/lib/chef/resource_collection/resource_list.rb:83:in `block in execute_each_resource'
/usr/local/lib/ruby/gems/2.0.0/gems/chef-12.0.3/lib/chef/resource_collection/stepable_iterator.rb:116:in `call'
/usr/local/lib/ruby/gems/2.0.0/gems/chef-12.0.3/lib/chef/resource_collection/stepable_iterator.rb:116:in `call_iterator_block'
/usr/local/lib/ruby/gems/2.0.0/gems/chef-12.0.3/lib/chef/resource_collection/stepable_iterator.rb:85:in `step'
/usr/local/lib/ruby/gems/2.0.0/gems/chef-12.0.3/lib/chef/resource_collection/stepable_iterator.rb:104:in `iterate'
/usr/local/lib/ruby/gems/2.0.0/gems/chef-12.0.3/lib/chef/resource_collection/stepable_iterator.rb:55:in `each_with_index'
/usr/local/lib/ruby/gems/2.0.0/gems/chef-12.0.3/lib/chef/resource_collection/resource_list.rb:81:in `execute_each_resource'
/usr/local/lib/ruby/gems/2.0.0/gems/chef-12.0.3/lib/chef/runner.rb:80:in `converge'
/usr/local/lib/ruby/gems/2.0.0/gems/chef-12.0.3/lib/chef/client.rb:315:in `converge'
/usr/local/lib/ruby/gems/2.0.0/gems/chef-12.0.3/lib/chef/client.rb:400:in `block in run'
/usr/local/lib/ruby/gems/2.0.0/gems/chef-12.0.3/lib/chef/client.rb:399:in `catch'
/usr/local/lib/ruby/gems/2.0.0/gems/chef-12.0.3/lib/chef/client.rb:399:in `run'
/usr/local/lib/ruby/gems/2.0.0/gems/chef-12.0.3/lib/chef/application.rb:261:in `block in fork_chef_client'
/usr/local/lib/ruby/gems/2.0.0/gems/chef-12.0.3/lib/chef/application.rb:249:in `fork'
/usr/local/lib/ruby/gems/2.0.0/gems/chef-12.0.3/lib/chef/application.rb:249:in `fork_chef_client'
/usr/local/lib/ruby/gems/2.0.0/gems/chef-12.0.3/lib/chef/application.rb:215:in `block in run_chef_client'
/usr/local/lib/ruby/gems/2.0.0/gems/chef-12.0.3/lib/chef/local_mode.rb:38:in `with_server_connectivity'
/usr/local/lib/ruby/gems/2.0.0/gems/chef-12.0.3/lib/chef/application.rb:201:in `run_chef_client'
/usr/local/lib/ruby/gems/2.0.0/gems/chef-12.0.3/lib/chef/application/solo.rb:245:in `block in interval_run_chef_client'
/usr/local/lib/ruby/gems/2.0.0/gems/chef-12.0.3/lib/chef/application/solo.rb:234:in `loop'
/usr/local/lib/ruby/gems/2.0.0/gems/chef-12.0.3/lib/chef/application/solo.rb:234:in `interval_run_chef_client'
/usr/local/lib/ruby/gems/2.0.0/gems/chef-12.0.3/lib/chef/application/solo.rb:224:in `run_application'
/usr/local/lib/ruby/gems/2.0.0/gems/chef-12.0.3/lib/chef/application.rb:58:in `run'
/usr/local/lib/ruby/gems/2.0.0/gems/chef-12.0.3/bin/chef-solo:25:in `<top (required)>'
/usr/local/bin/chef-solo:23:in `load'

Ejecutando con sudo chef-solo -c solo.rb -W:

DL is deprecated, please use Fiddle
Starting Chef Client, version 12.0.3
Compiling Cookbooks...
Converging 3 resources
Recipe: emacs::default
  * apt_package[emacs] action install
    * No version specified, and no candidate version available for emacs
    * Assuming a repository that offers emacs would have been configured
    - Would install  package emacs

Perdón que antes la he liado con el nombre del fichero...

sudo chef-solo -c chef/solo.rb -j chef/node.json

es que soy mono-hebra 😅

Estoy en Ubuntu 14.04 de 64 bits y ruby 2.0.0p481 (2014-05-08 revision 45883)

@JJ
Copy link
Owner

JJ commented Jan 13, 2015

Puede ser un problema con las versiones de Ruby:
https://help.openshift.com/hc/en-us/articles/202187604-Why-all-rhc-commands-on-windows-result-in-DL-is-deprecated-please-use-Fiddle-error-

¿Qué versión tienes en el cliente? ¿Y en el servidor? ¿Pueder usar rbenv o
rvm para poner la misma versión en los dos?

JJ

@iblancasa
Copy link
Author

Estuve pensando que podría ser la versión de Ruby...

Estoy intentando lanzarlo contra mi propia máquina, ya que es el ejemplo que hay en los apuntes de la asignatura, por lo que no tengo cliente-servidor.

Cuando fui a usar Chef con la 1.9 de Ruby (que es la que todo el mundo soporta), se me empezó a quejar de que "ohai" no soportaba versiones inferiores a la 2 de Ruby.

Estoy por coger, instalar un Ubuntu 12.04 (o por ahí) y probar

@JJ
Copy link
Owner

JJ commented Jan 13, 2015

Prueba otra receta. ¿Siempre te da el mismo error?

A ver, estoy mirando y creo que el problema es simplemente que no existe emacs para ese sistema operativo o el paquete se llama de esa forma. chef es así, le gusta dar mensajes crípticos. Desde tu propio sistema, sudo apt-cache search emacs a ver qué te da. package instala un paquete directamente yendo al gestor de paquetes del sistema, no hace como apt-get que busca el más aproximado. De hecho, hay un meta-paquete emacs en Ubuntu, pero igual no le gusta.

Voy a probar de todas formas en mi mismo sistema, a ver qué da.

@JJ
Copy link
Owner

JJ commented Jan 13, 2015

He probado en mi ordenador y, aunque ya está instalado, no da ningún error... Voy a probar en una box Debian o ubuntu a ver qué pasa.

@iblancasa
Copy link
Author

Sí. Siempre me da el mismo.

Probé poniendo, por ejemplo:

package 'git'

y me da exactamente el mismo error.

Me da tanto en mi máquina como en la virtual.
Probaré a descargar una versión antigua de Ubuntu...

@JJ
Copy link
Owner

JJ commented Jan 13, 2015

Instálalo con apt-get a ver qué resultado te da la receta.

Yo acabo de probarlo en Debian 7 sin problemas.

@iblancasa
Copy link
Author

Pues conseguido.
¿Qué he hecho?

  • He creado una máquina virtual usando Ubuntu 12.04

  • He instalado ejecutando curl -L https://www.opscode.com/chef/install.sh | sudo bash por que, por el método tradicional, tampoco le gustaba*

    *Se instala la versión 1.9.1 de Ruby y quiere la 1.9.3... y no me iba a arriesgar a instalar la 2 compilándola yo mismo... Por que en mi PC lo he hecho así y al ir a eliminarla para probar otra forma, me he cargado el rubygems y ya no puedo coger gemas...

Instalado y funcionando

Gracias

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

2 participants