I started to use puppet recently, and i'm trying to deploy a web server using gce_compute and apache-tomcat. To deploy the web server i install the modules puppetlabs-java and puppetlabs-tomcat, and to create an instance of apache-tomcat i'm using the code provided by puppet :
class { 'java': }
class { 'tomcat': }
class { 'epel': }->
tomcat::instance { 'default':
install_from_source => false,
package_name => 'tomcat',
}->
tomcat::service { 'default':
use_jsvc => false,
use_init => true,
service_name => 'tomcat',
}
But when my agent pulls the manifest i'm getting this error:
Execution of '/usr/bin/apt-get -q -y -o DPkg::Options::=--force-confold install tomcat' returned 100: Reading package lists...
puppet-agent[3302]: Building dependency tree...
puppet-agent[3302]: Reading state information...
puppet-agent[3302]: E: Unable to locate package tomcat
Can you help me to figure out why this happens and how i fix this error. Thanks in advance.
That error comes from apt-get. Puppet uses a package manager available on the system it is running on. In the case of Debian, it uses apt.
If you ran apt-get install tomcat you would get the same error, because there is no package named simply tomcat. Perhaps you mean tomcat6 or tomcat7?
Puppet uses the autoloader (https://docs.puppetlabs.com/puppet/latest/reference/lang_namespaces.html) to find that class, which it is doing correctly since it's running apt to download the package.
The best way to troubleshoot this is to run apt-get install on the version of tomcat you want. You might find you get the same output as you saw from stdout in the puppet output from your agent run. If that's the case, make sure you can reach your apt repos and you have the correct configuration in /etc/apt *.d directories.
check out this https://itsfoss.com/unable-to-locate-package-error-ubuntu/
-> my ubuntu version was 22.04,
to check your ubuntu version: lsb_release -a
tomcat8 was not getting installed so I changed version to tomcat9
and problem got resolved.
Related
I've been looking at this for days.
I've created an instance of Jenkins in Docker to run locally using this DockerFile -
`FROM jenkins/jenkins:2.346.2-jdk11
USER root
RUN curl -sSL https://get.docker.com/ | sh
RUN usermod -a -G docker jenkins
USER jenkins
COPY plugins.txt /usr/share/jenkins/ref/plugins.txt
RUN jenkins-plugin-cli --plugin-file /usr/share/jenkins/ref/plugins.txt
COPY seedJob.xml /usr/share/jenkins/ref/jobs/seed-job/config.xml
ENV JAVA_OPTS -Djenkins.install.runSetupWizard=false`
I have then installed the JDK in Jenkins
I have then installed Maven in Jenkins
I have then created a simple Pipeline to test for Maven
`pipeline {
agent any
tools {
// Install the Maven version configured as "M3" and add it to the path.
maven '3.8.6'
jdk 'openjdk-171'
}
stages {
stage('Example') {
steps {
sh 'mvn --version'
}
}
}
}
`
AND I get this message
"Could not open '/lib/ld-linux-aarch64.so.1': No such file or directory"
I've tried rebuilding from Scratch, followed youtube tutorials - still nothing
(I'm also running on a Mac). Any help massively appreciated!
I expect it to return the version number of Maven
ld-linux-aarch64.so.1 is the dynamic linker for the guest binary. If you have a dynamically linked guest binary then you need to tell the emulator about not just the binary itself but also the dynamic linker and all the dynamic libraries that the guest binary links to (usually by passing it an option to tell it about a directory which has all the libraries in the usual places they would be on the real filesystem of the guest).
For gem5 you can use --redirects and --interp-dir
I am trying to run the command
apt-get install php5-gd php-mysql
but whenever I run the command it states this:
E: Unable to locate package php-mysql
My Dedicated Server is running Ubuntu 14.04, it is hosted by So You Start.
The thing is, it was working before, along with java, and mysql, and php.
Is it possible that this is just a side effect of a bigger problem that needs to be fixed? When I try to install java, this shows up:
apt-get install openjdk-7-jre-headless
Reading package lists... Done
Building dependency tree
Reading state information... Done
openjdk-7-jre-headless is already the newest version.
The following packages were automatically installed and are no longer required:
libdbi-perl libterm-readkey-perl mysql-client-core-5.5
Use 'apt-get autoremove' to remove them.
0 to upgrade, 0 to newly install, 0 to remove and 0 not to upgrade.
2 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up oracle-java8-installer (8u121-1~webupd8~0) ...
Installing from local file /var/cache/oracle-jdk8-installer/jdk-8u121-linux- x64.tar.gz
Removing outdated cached downloads...
update-alternatives: using /usr/lib/jvm/java-8-oracle/jre/bin/ControlPanel to provide /usr/bin/ControlPanel (ControlPanel) in auto mode
update-alternatives: error: error creating symbolic link `/etc/alternatives/ControlPanel.dpkg-tmp': No such file or directory
No apport report written because the error message indicates it's a follow- up error from a previous failure.
dpkg: error processing package oracle-java8- installer (--configure):
subprocess installed post-installation script returned error exit status 2
dpkg: dependency problems prevent configuration of oracle-java8-set-default:
oracle-java8-set-default depends on oracle-java8-installer; however:
Package oracle-java8-installer is not configured yet.
dpkg: error processing package oracle-java8-set-default (--configure):
dependency problems - leaving unconfigured
Errors were encountered while processing:
oracle-java8-installer
oracle-java8-set-default
E: Sub-process /usr/bin/dpkg returned an error code (1)
I'm on 14.04, and php5-mysql is fine:
$ apt-cache search php5-mysql
php5-mysql - MySQL module for php5
php5-mysqlnd - MySQL module for php5 (Native Driver)
php5-mysqlnd-ms - MySQL replication and load balancing module for PHP
Try doing an update first before doing the install:
sudo apt-get update
sudo apt-get install php5-mysql
When attempting to start Elasticsearch 5.1.1 via
$ elasticsearch
I get the output:
Error: Could not find or load main class -Xms2g
I've looked into:
I read it may be an error in how a class is called? But I'm not exposed to doing that. This thread doesn't help and isn't really my problem as I'm not installing a plugin.
I installed via Homebrew. Here is some output from that:
$ brew info elasticsearch
elasticsearch: stable 5.1.1, HEAD
Distributed search & analytics engine
https://www.elastic.co/products/elasticsearch
Conflicts with: elasticsearch#1.7, elasticsearch#2.4
/usr/local/Cellar/elasticsearch/5.1.1 (98 files, 35.2M) *
Built from source on 2016-12-14 at 09:23:56
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/elasticsearch.rb
==> Requirements
Required: java >= 1.8 ✔
==> Caveats
Data: /usr/local/var/elasticsearch/elasticsearch_GabbAHH/
Logs: /usr/local/var/log/elasticsearch/elasticsearch_GabbAHH.log
Plugins: /usr/local/Cellar/elasticsearch/5.1.1/libexec/plugins/
Config: /usr/local/etc/elasticsearch/
plugin script: /usr/local/Cellar/elasticsearch/5.1.1/libexec/bin/plugin
To have launchd start elasticsearch now and restart at login:
brew services start elasticsearch
Or, if you don't want/need a background service you can just run:
elasticsearch
$ brew doctor
Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry and just ignore them. Thanks!
Warning: You have unlinked kegs in your Cellar
Leaving kegs unlinked can lead to build-trouble and cause brews that depend on
those kegs to fail to run properly once built. Run `brew link` on these:
mongodb
ruby
I also tried originally installing via manually extracting the .tar.gz package. I at first got some Java permission denied errors, but after running a chown to admin for myself I also got this same Error: Could not find or load main class type error.
I just updated my Java JDK to the latest: 1.8.0_112 and set my JAVA_HOME variable to that directory accordingly.
The most recent version of Elasticsearch 2 (2.4.3) works. Meanwhile, Elasticsearch v5.0.2 fails.
What can I do to have Elasticsearch properly installed on my Mac?
Watch out with this line in your .bashrc or similar:
export GREP_OPTIONS='--color=always'
That will break many shell's pipes, so many runners will fail without giving you any clue.
Distros as Ubuntu usually have this enabled by default for system users. Be careful and check that shell environment variable.
This problem was solved on my servers by just unsetting this variable.
You most likely have a problem in your .bash_profile. Usually elastic starts out of the box on a mac.
What I usually do to make upgrading and using multiple projects on my machine is using the following script:
#!/bin/bash
CURRENT_PROJECT=$(pwd)
CONFIG=$CURRENT_PROJECT/config
DATA=$CURRENT_PROJECT/data
LOGS=$CURRENT_PROJECT/logs
BASH_ES_OPTS="-Epath.conf=$CONFIG -Epath.data=$DATA -Epath.logs=$LOGS"
ELASTICSEARCH=$HOME/Development/elastic/elasticsearch/elasticsearch-5.1.1
$ELASTICSEARCH/bin/elasticsearch $BASH_ES_OPTS
Notice the options in BASH_ES_OPTS, these are the ones that changes a lot in version 5. My structure is a folder per project with this script and a few folders: config, data and logs. The config folder contains the files from the elastic distribution: elasticsearch.yml, jvm.properties and log4j2.properties.
I noticed that in the targeted SELinux policy for CentOS 7, there is no java.pp file in the
/etc/selinux/targeted/modules/active/modules
directory. Interestingly enough, in the source rpm selinux-policy-3.12.1-153.el7.src.rpm
from http://vault.centos.org, there are java.te, java.if, and java.fc, files, so I tried to get a java.pp by copying them in a seperate folder and running:
make NAME=targeted -f /usr/share/selinux/devel/Makefile
but I get an error 74:ERROR 'unknown type java_domain'and no java.pp file.
Does anyone the state of Java ans SELinux for CentOS 7. I noticed that my CentOS 6.5 servers have a java.pp module available.
Thanks,
greenaj
I just started looking at this myself and found:
https://github.com/TresysTechnology/refpolicy-contrib
Git clone the above and notice java.te, java.if, and java.fc
Try:
make -f /usr/share/selinux/devel/Makefile java.pp
If the make succeeds, load the new module via:
semodule -i java.pp
I actually get a /usr/bin/checkmodule syntax error on java.te,
but I'm trying this on RHEL 6.7 ...
May need to checkout a specific branch for one's OS-release.
Good luck.
I have created account on new relic and downloaded zip for new relic agent and uploaded to /etc directory in my linux machine(tomcat server).
As per documentations, I follow the following code
cd /etc/newrelic
java -jar newrelic.jar install
But I am getting following error:
Dec 31, 2013 06:14:04 +0000 NewRelic 1 INFO: Agent is using Logback
***** ( ( o)) New Relic Java Agent Installer
***** Installing version 3.2.3 ...
Could not edit start script because:
.:. Could not locate a Tomcat, Jetty, JBoss, JBoss7 or Glassfish instance in /etc
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: /etc/newrelic/newrelic.yml
***** Install incomplete
***** Next steps:
For help completing the install, see https://newrelic.com/docs/java/new-relic-for-java
Can anyone give me solution for this?
As the log information provide that it Could not locate a Tomcat, you need to provide env var like TOMCAT_HOME and so on.
In linux, even if you have installed some software, it can not be conveniently used without adding into PATH or some other env var.
In your situation, seems you need to add TOMCAT_HOME and export it.
Make sure the tomcat is correctly installed!
I was dealing with the same error, you only need to copy the new-relic.jar file inside the root of your tomcat server and then type:
java -jar new-relic.jar install
And that's it, it worked for me. Hope it helps
I work in support at New Relic, specializing in the Java agent.
Since Tomcat installations vary between Linux environments, your best bet is to follow the manual installation instructions:
https://docs.newrelic.com/docs/java/java-agent-manual-installation
Scroll down to the Tomcat instructions, which advise you to add the -javaagent flag to your Tomcat startup script. Once you've made that change and started your Tomcat instance, you can verify that the newrelic.jar is included in the startup arguments by issuing a ps -ef | grep java command.
If you need further help, please open a support ticket at support.newrelic.com and we'll be glad to assist.
Before installing the New Relic the code will fetch the requisite environment parameters like JAVA_HOME, TOMCAT_HOME, etc ( depends on your configuration) and then install the agent on your server. Make sure all the required env variables are defined.
After you have done the above, also check the following:
a) The New Relic should be extraced/installed in your home directory ( in my case /APP)
cd /APP
Unzip newrelic-java-3.26.1.zip –d /APP
b) The Java agent should be defined in the local properties file ( I have configured it for Hybris server in Dev environment)
vim /APP/hybris/config/local.properties
Add : -javaagent:/APP/newrelic/newrelic.jar –D newrelic.environment=Development
c) In some cases, it requirs the application specific yml file along with the newrelic.yml file ( in my case hybris.yml)
Cd /APP/newrelic
mkdir extensions
chmod 755 extensions
cd /APP/newrelic/extensions
vim hybris.yml
Hybris specific configuration for the hybris.yml file ( use jmx.yml)
Add the jmx.yml data in the hybris.yml after creating the file.
d) Restart your application:
I did it using the following commands:
cd /APP/hybris/bin/platform
ant clean all
e) You should see the data in sometime. Keep monitoring the new relic logs in:
tail -f /APP/newrelic/logs/newrelic_agent.log
Before you do any of these steps, make sure that your new relic folder is in inside the folder of your server. That immediately fixed my problem.
The folder newrelic belongs to /usr/share/tomcat/. At least on Ubuntu 16.04 with Tomcat 7. Then also the install command works. Please do not forget to read and adapt the whole newrelic.yml file.