I saw in the javadoc of the fetch method that ivy could be used to retrieve the artifact.
I tried and I got a unknown protocol: ivy exception. Is it already implemented? Thanks Jérôme. |
Administrator
|
Yes it is supported. Another thing I missed in the documentation :( I added it to the ticket: https://github.com/linkedin/glu/issues/55
You need to configure it this way: add the configuration: glu.agent.ivySettings=<url to ivy settings file> This configuration property can be set in the agentConfig.properties file or in the one that ends up in ZooKeeper directly. Note that this property is pointing to a URL so it can use zookeeper:/ style url thus allowing you to store in zookeeper as well! If you check the file under setup/zookeeper-config/config.properties there is a commented line at the bottom which give you an example: ################################ # Binary repository location # glu.agent.ivySettings=zookeeper:${glu.agent.zookeeper.root}/agents/fabrics/${glu.agent.fabric}/config/ivysettings.xml By making it relative to a fabric, you can reuse the same agent configuration files and simply uploads different ivy settings file in zookeeper based on the fabric. LinkedIn uses this to have different binary repos depending on the data center... Yan |
After added the configuration, ivy works correctly and the artifact is downloaded.
I can see the war file under the .ivy2/cache folder, however glu displays the following error message. * [java.io.FileNotFoundException]: ivy:/com.xxx.xxx/admin/1.1.1.2-SNAPSHOT * [org.apache.tools.ant.BuildException]: Can't get ivy:/com.xxx.xxx/admin/1.1.1.2-SNAPSHOT to /opt/glu_apps/xxx/i003/webapps/ROOT.war How can I fix this problem? Thanks Jérôme. |
Administrator
|
Can you post:
1) the line in your glu script causing the problem 2) the full stack trace Are you sure that /opt/glu_apps/xxx/i003/webapps is writable by the agent ? Yan |
1) the line in your glu script causing the problem
log.info "Fetching ${webapp.war} artifact..." def war = shell.fetch(webapp.war, serverRoot."webapps/${name}.war") log.info "Fetching done..." 2) the full stack trace Where can I get the stack trace? I didn't see any stack trace in the log file of the agent. The latest info in the log are: 2011/05/20 15:23:19.126 INFO [/xxx/i003] Fetching ivy:/com.xxx.xxx/admin/1.1.1.2-SNAPSHOT artifact... 2011/05/20 15:23:28.680 INFO [/xxx/i003] waitForState([state:stopped, timeout:10s, mountPoint:/xxx/i003]): false 3) Are you sure that /opt/glu_apps/xxx/i003/webapps is writable by the agent ? Yes... The script works if I use http instead of ivy Thanks for your help. Jérôme |
Administrator
|
Where did you copy those lines from ?
* [java.io.FileNotFoundException]: ivy:/com.xxx.xxx/admin/1.1.1.2-SNAPSHOT * [org.apache.tools.ant.BuildException]: Can't get ivy:/com.xxx.xxx/admin/1.1.1.2-SNAPSHOT to /opt/glu_apps/xxx/i003/webapps/ROOT.war It should be in a log file no on the agent side ? I will try to reproduce with ivy vs http. given your script. Yan |
I got these lines directly from the console when I execute the plan.
Where the log file is located?
2011/5/20 frenchyan [via glu] <[hidden email]> Where did you copy those lines from ? |
Administrator
|
Go to the agent view page and click on the view full stack trace link as shown in the screenshot:
![]() Yan |
Here is the stack trace
Grails Runtime ExceptionError Details
Error 500: Executing action [fullStackTrace] of controller [org.linkedin.glu.console.controllers.AgentsController] caused exception: Cannot invoke method getURI() on null object Servlet: grails URI: /console/grails/agents/fullStackTrace.dispatch Exception Message: Cannot invoke method getURI() on null object Caused by: Cannot invoke method getURI() on null object Class: AgentsController At Line: [243] Code Snippet: Stack Tracejava.lang.NullPointerException: Cannot invoke method getURI() on null object 2011/5/21 frenchyan [via glu] <[hidden email]> Go to the agent view page and click on the view full stack trace link as shown in the screenshot: |
Administrator
|
wow it looks like we are cursed there :(
The stack trace you sent is not the stack trace of the error you had in the first place but the stack trace of trying to fetch the stack trace! Did you by any chance stop the agent itself ? I was able to reproduce this exception by doing the following: * go to the agent view page (the screenshot of my previous comment) * stop the agent * then click on the 'View Full Stack Trace' link if I restart the agent the exception goes away.. Yan |
Administrator
|
I just pushed 2.4.1 which should fix the second issue (exception while fetching stack trace). Do you mind trying again with 2.4.1 (and make sure the agent is up and running..)
Yan |
In reply to this post by frenchyan
I realize this thread is pretty old, but I'm having some issues getting this to work in my environment. What I have done is:
1) I've loaded the ivysettings.xml into my zookeeper, located at: zookeeper:/org/glu/agents/fabrics/myfab/config/ivysettings.xml 2) I've configured the agent.properties to contain the value: glu.agent.ivySettings=zookeeper:${glu.agent.zookeeper.root}/agents/fabrics/${glu.agent.fabric}/config/ivysettings.xml 3) I restarted both console / agent 4) I've configured the model to refer to: url: ivy:/com.myorg/myapp/a.b.c-SNAPSHOT/ I've also tried: url: ivy://com.myorg/myapp/a.b.c-SNAPSHOT/ I upload my model and attempt to deploy, but get : org.linkedin.glu.agent.api.ScriptExecutionCauseException: [java.net.MalformedURLException]: unknown protocol: ivy Any ideas what I might be doing wrong? |
Administrator
|
You need an ivySettingsURL in the console configuration file (glu-coonsole-webapp.groovy) which should be added accordingly to the method you use (meta model or manual).
Yan |
Much appreciated - that fixed it.
|
Administrator
|
Glad to hear. It's true that it is absent from the documentation... Yan |
In reply to this post by frenchyan
I'm getting the error that the other gentlemen was having earlier:
Run [install] phase for [/ddc-java] on [onrddc2] - 540ms [+] org.linkedin.glu.agent.api.ScriptExecutionException: script=com.rgm.glu.scripts.SimpleJavaService [/foo], action=install [+] org.linkedin.glu.agent.api.ScriptExecutionCauseException: [java.io.FileNotFoundException]: ivy:/org/module/version/config [+] org.linkedin.glu.agent.api.ScriptExecutionCauseException: [org.apache.tools.ant.BuildException]: Can't get ivy:/org/module/version/config to /var/glu/data/tmp/foo/__tmp1475510086Dir/jar-name-here.jar Any thoughts? I can verify that the file being copied is indeed in the .ivy2 cache for the user running the Glu Agent. Is this a file permissions problem? Both the .ivy2 cache and the temp folder are owned by the same user/group and the permissions on the temp folder are drwxr-xr-x. |
Administrator
|
I am not entirely sure what is happening... I would suggest changing the log level on the agent and try to see if we can get more information. Edit the log4j.xml file and set it to "debug" instead of "warn". Stop and restart the agent. Try to reproduce the error and check the agent log file... Maybe the debug info will give us a clue
Thanks Yan |
Free forum by Nabble | Edit this page |