-
Notifications
You must be signed in to change notification settings - Fork 21
Description
I just ran through the first steps document online and I had some issues. With @tbatchelli's help I overcame all of them and was successful, but I thought I'd document them all to help with revising the doc.
I'll put them all together in a single issue, but feel free to split out parts and close this issue as you see fit.
Part 1: lein pallet commands throw an exception
The lein command throws an exception apparently because jclouds can't resolve my hostname. The error itself makes sense because my laptop doesn't have a DNS name, but I don't know why the system should care. The requested command seems to complete fine, so this is basically a cosmetic issue.
Independently of the exception, the lein pallet command seems to do an insane amount of logging about pretty much nothing.
When I was first doing this, I had the exception when doing the lein pallet add-service command. I made a new project to do this write-up and now I see that it occurs on any lein pallet invocation. Here I used lein help. If I run lein help repeatedly, I get the error on each run.
mondrian:clj tom$ lein new pallet quickstart
mondrian:clj tom$ cd quickstart
mondrian:quickstart tom$ lein pallet help
12:25:10,345 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback.groovy]
12:25:10,345 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback-test.xml]
12:25:10,346 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Found resource [logback.xml] at [file:/Users/tom/src/clj/quickstart/resources/logback.xml]
12:25:10,576 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - debug attribute not set
12:25:10,579 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - Setting ReconfigureOnChangeFilter scanning period to 1 seconds
12:25:10,579 |-INFO in ReconfigureOnChangeFilter{invocationCounter=0} - Will scan for changes in [[/Users/tom/src/clj/quickstart/resources/logback.xml]] every 1 seconds.
12:25:10,579 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - Adding ReconfigureOnChangeFilter as a turbo filter
12:25:10,586 |-ERROR in ch.qos.logback.core.util.ContextUtil@51ed7f2f - Failed to get local hostname java.net.UnknownHostException: mondrian: mondrian: nodename nor servname provided, or not known
at java.net.UnknownHostException: mondrian: mondrian: nodename nor servname provided, or not known
at at java.net.InetAddress.getLocalHost(InetAddress.java:1473)
at at ch.qos.logback.core.util.ContextUtil.getLocalHostName(ContextUtil.java:32)
at at ch.qos.logback.core.util.ContextUtil.addHostNameAsProperty(ContextUtil.java:41)
at at ch.qos.logback.classic.joran.action.ConfigurationAction.begin(ConfigurationAction.java:56)
at at ch.qos.logback.core.joran.spi.Interpreter.callBeginAction(Interpreter.java:276)
at at ch.qos.logback.core.joran.spi.Interpreter.startElement(Interpreter.java:148)
at at ch.qos.logback.core.joran.spi.Interpreter.startElement(Interpreter.java:130)
at at ch.qos.logback.core.joran.spi.EventPlayer.play(EventPlayer.java:50)
at at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:157)
at at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:143)
at at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:106)
at at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:56)
at at ch.qos.logback.classic.util.ContextInitializer.configureByResource(ContextInitializer.java:75)
at at ch.qos.logback.classic.util.ContextInitializer.autoConfig(ContextInitializer.java:148)
at at org.slf4j.impl.StaticLoggerBinder.init(StaticLoggerBinder.java:85)
at at org.slf4j.impl.StaticLoggerBinder.<clinit>(StaticLoggerBinder.java:55)
at at org.slf4j.LoggerFactory.bind(LoggerFactory.java:128)
at at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:107)
at at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:295)
at at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:269)
at at clojure.tools.logging$eval390$reify__391.get_logger(logging.clj:45)
at at pallet.main$pallet_task.doInvoke(main.clj:133)
at at clojure.lang.RestFn.invoke(RestFn.java:439)
at at clojure.lang.Var.invoke(Var.java:423)
at at user$eval5.invoke(form-init8741844825741654977.clj:1)
at at clojure.lang.Compiler.eval(Compiler.java:6511)
at at clojure.lang.Compiler.eval(Compiler.java:6501)
at at clojure.lang.Compiler.eval(Compiler.java:6501)
at at clojure.lang.Compiler.load(Compiler.java:6952)
at at clojure.lang.Compiler.loadFile(Compiler.java:6912)
at at clojure.main$load_script.invoke(main.clj:283)
at at clojure.main$init_opt.invoke(main.clj:288)
at at clojure.main$initialize.invoke(main.clj:316)
at at clojure.main$null_opt.invoke(main.clj:349)
at at clojure.main$main.doInvoke(main.clj:427)
at at clojure.lang.RestFn.invoke(RestFn.java:421)
at at clojure.lang.Var.invoke(Var.java:419)
at at clojure.lang.AFn.applyToHelper(AFn.java:163)
at at clojure.lang.Var.applyTo(Var.java:532)
at at clojure.main.main(main.java:37)
Caused by: java.net.UnknownHostException: mondrian: nodename nor servname provided, or not known
at at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method)
at at java.net.InetAddress$1.lookupAllHostAddr(InetAddress.java:901)
at at java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1293)
at at java.net.InetAddress.getLocalHost(InetAddress.java:1469)
at ... 39 common frames omitted
12:25:10,587 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.ConsoleAppender]
12:25:10,591 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [CONSOLE]
12:25:10,618 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property
12:25:10,704 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.rolling.RollingFileAppender]
12:25:10,709 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [COMPUTEFILE]
12:25:10,735 |-INFO in c.q.l.core.rolling.TimeBasedRollingPolicy - No compression will be used
12:25:10,736 |-INFO in c.q.l.core.rolling.TimeBasedRollingPolicy - Will use the pattern logs/old/jclouds-compute.%d{yyyy-MM-dd}.log for the active file
12:25:10,743 |-INFO in c.q.l.core.rolling.DefaultTimeBasedFileNamingAndTriggeringPolicy - The date pattern is 'yyyy-MM-dd' from file name pattern 'logs/old/jclouds-compute.%d{yyyy-MM-dd}.log'.
12:25:10,743 |-INFO in c.q.l.core.rolling.DefaultTimeBasedFileNamingAndTriggeringPolicy - Roll-over at midnight.
12:25:10,748 |-INFO in c.q.l.core.rolling.DefaultTimeBasedFileNamingAndTriggeringPolicy - Setting initial period to Sun Apr 13 12:25:10 PDT 2014
12:25:10,751 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property
12:25:10,752 |-INFO in ch.qos.logback.core.rolling.RollingFileAppender[COMPUTEFILE] - Active log file name: logs/jclouds-compute.log
12:25:10,752 |-INFO in ch.qos.logback.core.rolling.RollingFileAppender[COMPUTEFILE] - File property is set to [logs/jclouds-compute.log]
12:25:10,755 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.rolling.RollingFileAppender]
12:25:10,755 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [WIREFILE]
12:25:10,757 |-INFO in c.q.l.core.rolling.TimeBasedRollingPolicy - No compression will be used
12:25:10,757 |-INFO in c.q.l.core.rolling.TimeBasedRollingPolicy - Will use the pattern logs/old/jclouds-wire.%d{yyyy-MM-dd}.log for the active file
12:25:10,759 |-INFO in c.q.l.core.rolling.DefaultTimeBasedFileNamingAndTriggeringPolicy - The date pattern is 'yyyy-MM-dd' from file name pattern 'logs/old/jclouds-wire.%d{yyyy-MM-dd}.log'.
12:25:10,759 |-INFO in c.q.l.core.rolling.DefaultTimeBasedFileNamingAndTriggeringPolicy - Roll-over at midnight.
12:25:10,759 |-INFO in c.q.l.core.rolling.DefaultTimeBasedFileNamingAndTriggeringPolicy - Setting initial period to Sun Apr 13 12:25:10 PDT 2014
12:25:10,759 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property
12:25:10,761 |-INFO in ch.qos.logback.core.rolling.RollingFileAppender[WIREFILE] - Active log file name: logs/jclouds-wire.log
12:25:10,761 |-INFO in ch.qos.logback.core.rolling.RollingFileAppender[WIREFILE] - File property is set to [logs/jclouds-wire.log]
12:25:10,761 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.rolling.RollingFileAppender]
12:25:10,761 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [PALLETFILE]
12:25:10,762 |-INFO in c.q.l.core.rolling.TimeBasedRollingPolicy - No compression will be used
12:25:10,763 |-INFO in c.q.l.core.rolling.TimeBasedRollingPolicy - Will use the pattern logs/old/pallet.%d{yyyy-MM-dd}.log for the active file
12:25:10,764 |-INFO in c.q.l.core.rolling.DefaultTimeBasedFileNamingAndTriggeringPolicy - The date pattern is 'yyyy-MM-dd' from file name pattern 'logs/old/pallet.%d{yyyy-MM-dd}.log'.
12:25:10,764 |-INFO in c.q.l.core.rolling.DefaultTimeBasedFileNamingAndTriggeringPolicy - Roll-over at midnight.
12:25:10,764 |-INFO in c.q.l.core.rolling.DefaultTimeBasedFileNamingAndTriggeringPolicy - Setting initial period to Sun Apr 13 12:25:10 PDT 2014
12:25:10,764 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property
12:25:10,765 |-INFO in ch.qos.logback.core.rolling.RollingFileAppender[PALLETFILE] - Active log file name: logs/pallet.log
12:25:10,765 |-INFO in ch.qos.logback.core.rolling.RollingFileAppender[PALLETFILE] - File property is set to [logs/pallet.log]
12:25:10,766 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.rolling.RollingFileAppender]
12:25:10,766 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [VMFESTFILE]
12:25:10,768 |-INFO in c.q.l.core.rolling.TimeBasedRollingPolicy - No compression will be used
12:25:10,768 |-INFO in c.q.l.core.rolling.TimeBasedRollingPolicy - Will use the pattern logs/old/vmfest.%d{yyyy-MM-dd}.log for the active file
12:25:10,770 |-INFO in c.q.l.core.rolling.DefaultTimeBasedFileNamingAndTriggeringPolicy - The date pattern is 'yyyy-MM-dd' from file name pattern 'logs/old/vmfest.%d{yyyy-MM-dd}.log'.
12:25:10,770 |-INFO in c.q.l.core.rolling.DefaultTimeBasedFileNamingAndTriggeringPolicy - Roll-over at midnight.
12:25:10,770 |-INFO in c.q.l.core.rolling.DefaultTimeBasedFileNamingAndTriggeringPolicy - Setting initial period to Sun Apr 13 12:25:10 PDT 2014
12:25:10,770 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property
12:25:10,772 |-INFO in ch.qos.logback.core.rolling.RollingFileAppender[VMFESTFILE] - Active log file name: logs/vmfest.log
12:25:10,772 |-INFO in ch.qos.logback.core.rolling.RollingFileAppender[VMFESTFILE] - File property is set to [logs/vmfest.log]
12:25:10,773 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [jclouds.headers] to INFO
12:25:10,773 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [WIREFILE] to Logger[jclouds.headers]
12:25:10,775 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [jclouds.wire] to INFO
12:25:10,775 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [WIREFILE] to Logger[jclouds.wire]
12:25:10,775 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [jclouds.compute] to INFO
12:25:10,775 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [COMPUTEFILE] to Logger[jclouds.compute]
12:25:10,775 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [jclouds.ssh] to INFO
12:25:10,775 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [COMPUTEFILE] to Logger[jclouds.ssh]
12:25:10,775 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [clj-ssh.ssh] to INFO
12:25:10,775 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [COMPUTEFILE] to Logger[clj-ssh.ssh]
12:25:10,775 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [pallet] to DEBUG
12:25:10,775 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [PALLETFILE] to Logger[pallet]
12:25:10,775 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [vmfest] to DEBUG
12:25:10,776 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [VMFESTFILE] to Logger[vmfest]
12:25:10,776 |-INFO in ch.qos.logback.classic.joran.action.RootLoggerAction - Setting level of ROOT logger to INFO
12:25:10,776 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [CONSOLE] to Logger[ROOT]
12:25:10,776 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [clj-ssh.ssh] to ERROR
12:25:10,776 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [pallet.action-plan] to INFO
12:25:10,776 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [pallet.action-plan] to INFO
12:25:10,776 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [pallet.algo.fsm] to WARN
12:25:10,776 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [pallet.algo.fsmop] to WARN
12:25:10,776 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [pallet.configure] to INFO
12:25:10,777 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [pallet.core.api] to DEBUG
12:25:10,777 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [pallet.core.operations] to DEBUG
12:25:10,777 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [pallet.core.primitives] to DEBUG
12:25:10,777 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [pallet.crate.nohup] to DEBUG
12:25:10,777 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [pallet.execute] to DEBUG
12:25:10,777 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [pallet.executors] to INFO
12:25:10,777 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [pallet.project] to INFO
12:25:10,777 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [pallet.stevedore] to INFO
12:25:10,777 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [pallet.transport] to DEBUG
12:25:10,777 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - End of configuration.
12:25:10,780 |-INFO in ch.qos.logback.classic.joran.JoranConfigurator@33b2cb98 - Registering current configuration as safe fallback point
Pallet is a provisioning, configuration management and orchestration tool.
Several tasks are available:
add-service - Add a service definition to pallet.
bootstrap - Bootstrap pallet to work with the specified provider.
config - Create a pallet configuration file in ~/.pallet/config.clj
containers - List containers.
converge - Adjust node counts.
converge-test -
describe-node - Describe the node definition.
down - Remove project nodes.
help - Display a list of tasks or help for a given task.
images - List images.
lift - Apply configuration.
nodes - List nodes.
project-init - Initialise a project.
providers - Provide information on the supported and enabled providers.
providers-test -
to-blob - Upload to a blob.
up - Bring up nodes.
version - Print Pallet's version to standard out.
Run pallet help $TASK for details.
Usage:
Switches Default Desc
-------- ------- ----
-P, --service Service key to use (use add-service to create a service
-p, --provider Cloud provider name.
-i, --identity Cloud user name or key.
-c, --credential Cloud password or secret.
-B, --blobstore-provider Blobstore provider name.
-I, --blobstore-identity Blobstore user name or key.
-C, --blobstore-credential Blobstore password or secret.
-O, --project-options Project options (usually picked up from project.clj).
-D, --defaults Default options (usually picked up from config.clj).
If no options are given, the following sequence is used to
find a compute service to use.
the pallet.config.service property is checked for the
name of a var to use for the service,
the ~/.pallet/config.clj is checked for an active profile
specified with `defpallet`. e.g.
(defpallet
:services {
:aws {:provider "ec2"
:identity "username or key"
:credential "password, key or secret key"}})
the pallet.config/service is used if it exists.
You can write project specific tasks under the
pallet.task namespace.
See http://palletops.com for documentation
mondrian:quickstart tom$
Part 2: Converge fails because of a bad project file
When I tried to run the first converge command, I got the following results:
; CIDER 0.6.0alpha (package: 20140125.2304) (Clojure 1.4.0, nREPL 0.2.3)
user> (require 'pallet.api 'pallet.compute 'pallet.configure)
nil
user> (pallet.api/converge
(pallet.api/group-spec "mygroup"
:count 1
:node-spec (pallet.api/node-spec
:image {:os-family :ubuntu :image-id "us-east-1/ami-3c994355"}))
:compute (pallet.configure/compute-service :aws))
CreationException Guice creation errors:
1) org.jclouds.rest.RestContext<org.jclouds.aws.ec2.AWSEC2Client, A> cannot be used as a key; It is not fully specified.
1 error com.google.inject.internal.Errors.throwCreationExceptionIfErrorsExist (Errors.java:435)
user>
Toni gave gave me a new project.clj file and everything worked better.
Part 3: AWSResponse exception during shutdown
When I ran the first shutdown, I got the following error. The system did seem to shut down fine, however.
user> (pallet.api/converge
(pallet.api/group-spec "mygroup" :count 0)
:compute (pallet.configure/compute-service :aws))
AWSResponseException request POST https://ec2.us-east-1.amazonaws.com/ HTTP/1.1 failed with code 400, error: AWSError{requestId='6837c6a3-f81a-4788-83a0-2a914cf9939d', requestToken='null', code='DependencyViolation', message='resource sg-0d56e668 has a dependent object', context='{Response=, Errors=}'} org.jclouds.aws.handlers.ParseAWSErrorFromXmlContent.handleError (ParseAWSErrorFromXmlContent.java:77)
user> (pst)
AWSResponseException request POST https://ec2.us-east-1.amazonaws.com/ HTTP/1.1 failed with code 400, error: AWSError{requestId='6837c6a3-f81a-4788-83a0-2a914cf9939d', requestToken='null', code='DependencyViolation', message='resource sg-0d56e668 has a dependent object', context='{Response=, Errors=}'}
org.jclouds.aws.handlers.ParseAWSErrorFromXmlContent.handleError (ParseAWSErrorFromXmlContent.java:77)
org.jclouds.http.handlers.DelegatingErrorHandler.handleError (DelegatingErrorHandler.java:67)
org.jclouds.http.internal.BaseHttpCommandExecutorService.shouldContinue (BaseHttpCommandExecutorService.java:180)
org.jclouds.http.internal.BaseHttpCommandExecutorService.invoke (BaseHttpCommandExecutorService.java:150)
org.jclouds.rest.internal.InvokeHttpMethod.invoke (InvokeHttpMethod.java:93)
org.jclouds.rest.internal.InvokeHttpMethod.apply (InvokeHttpMethod.java:76)
org.jclouds.rest.internal.InvokeHttpMethod.apply (InvokeHttpMethod.java:47)
org.jclouds.reflect.FunctionalReflection$FunctionalInvocationHandler.handleInvocation (FunctionalReflection.java:117)
com.google.common.reflect.AbstractInvocationHandler.invoke (AbstractInvocationHandler.java:79)
com.sun.proxy.$Proxy56.deleteSecurityGroupInRegion (:-1)
org.jclouds.ec2.compute.EC2ComputeService.deleteSecurityGroup (EC2ComputeService.java:228)
org.jclouds.ec2.compute.EC2ComputeService$3.apply (EC2ComputeService.java:311)
nil
user>
Part 4: Installing curl is a bad example
curl is already installed on that image when you set it up, so having that be the package you install is not particularly compelling :).
Part 5: package action moved
In the section "Installing something", the use refers to the wrong location for the package function. This should be corrected to:
(use '[pallet.actions :only [package]]
'[pallet.api :only [plan-fn]])
That's all. Thanks for your help, Toni!