djoos-cookbooks / newrelic

Development repository for the newrelic cookbook
https://supermarket.chef.io/cookbooks/newrelic
MIT License
143 stars 247 forks source link

`sudo java -jar newrelic.jar -s /opt/newrelic/java install` is failing #203

Closed henri-tremblay closed 9 years ago

henri-tremblay commented 9 years ago

This call is returning 1 and so is failing. With the following output:

       ---- Begin output of sudo java -jar newrelic.jar -s /opt/newrelic/java install ----
       STDOUT: ***** ( ( o))  New Relic Java Agent Installer
       ***** Installing version 3.19.0 ...
       Could not edit start script because:
        .:. Could not locate a Tomcat, Jetty, JBoss, JBoss7 or Glassfish instance in /opt/newrelic/java
       Try re-running the install command with the -s <AppServerRootDirectory> option or from <AppServerRootDirectory>/newrelic.
       If that doesn't work, locate and edit the start script manually.
       No need to create New Relic configuration file because:
        .:. A config file already exists: /opt/newrelic/java/newrelic.yml
       ***** Install incomplete
       ***** Next steps:
       For help completing the install, see https://newrelic.com/docs/java/new-relic-for-java
       STDERR:
       ---- End output of sudo java -jar newrelic.jar -s /opt/newrelic/java install ----

The recipe already has created the newrelic.yml, so it's normal that it doesn't want to write it again. No application server is deployed on this machine. It is a standalone process.

henri-tremblay commented 9 years ago

I found a workaround.

Setting default['newrelic']['java_agent']['execute_agent_action'] to false make it pass

djoos commented 9 years ago

Hi @henri-tremblay,

setting execute agent to false is the right thing in his situation as there's no application server on the machine...

Hope this helps!

Kind regards, David

karankapur999 commented 7 years ago

@henri-tremblay @djoos where did you made these changes?

djoos commented 7 years ago

Hi @karankapur999,

please have a look at the java_agent-attributes if running the recipe. Alternatively just use the attribute on the LWRP.

Hope this helps!

Kind regards, David

karankapur999 commented 7 years ago

@djoos In newrelic folder following files are their -: CHANGELOG extension-example.xml newrelic-api-sources.jar newrelic.yml LICENSE extension.xsd newrelic-api.jar nrcerts README.txt newrelic-api-javadoc.jar newrelic.jar

I should make changes to which file/folder

djoos commented 7 years ago

Hi @karankapur999,

you actually don't make the changes to the newrelic files...

What is your Chef setup? (ie. how are you making use of the newrelic cookbook exactly)

Thanks in advance!

Kind regards, David

karankapur999 commented 7 years ago

@djoos I followed following steps

https://docs.newrelic.com/docs/agents/java-agent/installation/java-agent-self-installer

i am trying to integrate newrelic with jetty standalone java app

but getting this error

***** ( ( o)) New Relic Java Agent Installer

***** Installing version 3.34.0 ...

***** Install incomplete

djoos commented 7 years ago

...ah ok, so you're not using any configuration management tool (in casu Chef) at all to deploy newrelic, but you're deploying it manually, right?

karankapur999 commented 7 years ago

yup

karankapur999 commented 7 years ago

@djoos i am unable to find solution for same :/

djoos commented 7 years ago

Hi @karankapur999, in that case ignore this thread, as this is for deploying New Relic via Chef.

I'd probably best recommend you to reach out to New Relic support or the Java installer's manual installation troubleshooting section over at New Relic.

Hope this helps!

Kind regards, David

yovan-escobar commented 6 years ago

I am also running into this issue, same error. I am trying to use chef 12 to deploy a newrelic in our AEM 6.1. I set the flag to false for "default['newrelic']['java_agent']['execute_agent_action'] = false" I don't see the error but did not install newrelic on my

      ***** Installing version 3.46.0 ...

        * Could not edit start script because:
        Could not locate a Tomcat, Jetty, JBoss, JBoss7 or Glassfish instance in /opt/newrelic

        * Try re-running the install command with the -s <AppServerRootDirectory> option or from <AppServerRootDirectory>/newrelic.
        If that doesn't work, locate and edit the start script manually.

        * No need to create New Relic configuration file because:
         A config file already exists: /opt/newrelic/newrelic.yml

        ***** Install incomplete

        ***** Next steps:
        For help completing the install, see https://newrelic.com/docs/java/new-relic-for-java

Thanks in Advance Yovan

djoos commented 6 years ago

Hi @yovan-escobar,

you're running AEM 6.1 (AEM ~ Adobe CQ5), right? This thread might shed some more light on why the NR install doesn't pick things up automatically...

Please let me know how you get on! David

yovan-escobar commented 6 years ago

Hi @djoos

Thanks for that thread I will look into it, just another question can you explain in more detail what is the following attribute below, did not understand much on readme file. Is that the same as the app_name? What should I be setting that too? can you provide an example if possible? default['newrelic']['java_agent']['app_location'] = nil

djoos commented 6 years ago

Hi @yovan-escobar,

the app_location attribute is used to point to your application server's location, ie. /opt/tomcat_java_test_app. If not specific, the cookbook will use the install_dir, however the correct value will depend on your exact application/setup.

Hope this helps! David

yovan-escobar commented 6 years ago

Hi @djoos

Could you explain more about the default recipe, what does it installs by default, I see it installed the server_monitor_agent.rb but what exactly does this agent do in terms does it install the infustructure?

https://infrastructure.newrelic.com

Thanks in advance Yovan

yovan-escobar commented 6 years ago

I see it install this in the default provider but what is service_name, just wondering if we need the default in our cookbook or not.

def install_newrelic_service_linux package new_resource.service_name do action new_resource.action end

abhishekops commented 4 years ago

I found a workaround.

Setting default['newrelic']['java_agent']['execute_agent_action'] to false make it pass

This worked like a charm.