Comments (8)
thanks for the PR, kmmceachern, unfortunately i'm still having this problem even after using your changes. what fixed it for me finally was making your code use -y for apt-get install, so changes to jenkins would be like so:
add-apt-repository ppa:openjdk-r/ppa
apt-get update
apt-get install -y openjdk-8-jre openjdk-8-jre-headless openjdk-8-jdk
from devops-intro-project.
Finally figured out a solution for this error after digging around some.
First off, I had two problems initially:
- As a new free tier AWS user, I had an instance limit of 0 for t1.micros, which is what the provided
control-server.json
file uses for the Ubuntu AMI. To fix this I changed my control-server.json to
{
"type": "amazon-ebs",
"access_key": "{{ user `AWS_ACCESS_KEY_ID` }}",
"secret_key": "{{ user `AWS_SECRET_ACCESS_KEY` }}",
"region": "us-east-1",
"source_ami": "ami-772aa961",
"instance_type": "t2.micro",
"ssh_username": "ubuntu",
"ami_name": "control-{{ user `PACKER_BOX_NAME` }}-{{timestamp}}"
},
The above source-ami
is the only Ubuntu 14.04 AMI I could access as a free tier user through AWS's EC2 console, as it uses a t2.micro
instead of t1.micro
.
- The Jenkins script would not execute properly because the script file located at
/packer-templates/scripts/jenkins.sh
tries to install a Java version that's incompatible with the latest version of Jenkins.
To fix this I replaced these lines injenkins.sh
:
# JDK and JRE are required for Jenkins
apt-get install -y openjdk-7-jre openjdk-7-jdk unzip dos2unix
with (edited below to reflect @stevenconner's suggestion of adding the -y
flag)
# JDK and JRE are required for Jenkins
add-apt-repository ppa:openjdk-r/ppa
apt-get update
apt-get install -y openjdk-8-jre openjdk-8-jre-headless openjdk-8-jdk
after seeing this resolution to a similar problem filed as a Jenkins JIRA issue here (last comment): https://issues.jenkins-ci.org/browse/JENKINS-43495?page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel&showAll=true
After both of these changes, my AMI FINALLY built properly.
I've put up a PR with all the file changes I needed to properly build and deploy the AMI, so future course takers will hopefully have an easier time with this than I did: #35
from devops-intro-project.
I'm having the same issue. Did you find a solution?
from devops-intro-project.
Similar issue here. I'm going to dig through the config files to see if I can find anything....
from devops-intro-project.
same problem :/
from devops-intro-project.
Same issue/solution in case of deploying onto gcloud.
from devops-intro-project.
Thanks so much to @kmmceachern and @stevenconner for your solutions. I had to add a little more code before I could get mine to build.
First, I had to use a more recent Ubuntu server version and checksum (see README.md
and here) in control-server.json
:
{
"variables": {
...
"PACKER_BOX_NAME": "ubuntu-14.04.5-server-amd64",
...
...
"builders": [
{
...
...
"iso_checksum": "dde07d37647a1d2d9247e33f14e91acb10445a97578384896b4e1d985f754cc1",
...
...
}
Second, I had to install dos2unix (see here) in jenkins.sh
by adding
# install dos2unix
sudo apt-get install dos2unix
after these lines 👇
apt-get update
apt-get install -y jenkins
apt-get upgrade
I am running Windows 10 by the way.
Update
I still had to do a bit more work. Apparently, my Windows converted Unix-style endings (\n
) into Windows-style endings (\r\n
) and this caused errors in install_jenkins_plugins.sh
. To fix this, I added this line
dos2unix /tmp/jenkins-config/install_jenkins_plugins.sh
after this line
dos2unix /etc/default/jenkins
in jenkins.sh
.
Still, the installPlugins()
function in install_jenkins_plugins.sh
threw errors indicating that it could not find the unzip
command. So I included these lines
# install unzip for use in install_jenkins_plugins.sh
sudo apt-get install zip unzip
just above these lines
# install some extra plugins
/bin/bash /tmp/jenkins-config/install_jenkins_plugins.sh
My artifacts built successfully but I still could not figure out how to view the Jenkins server in my browser. This may be obvious to more experienced users but the course does not give clear instructions for a first-time user like me. The solution involved two steps:
- First, I had to configure the AWS security group used by the VM to allow inbound access on port 8080 (in addition to SSH access on port 22).
- Second, the actual URL to access the Jenkins server in the browser is
<Public DNS (IPv4)>:8080/jenkins
. You can find the value of<Public DNS (IPv4)>
from the running instance in your AWS EC2 dashboard. So your URL will look something like this:ec2-12-345-678-901.compute-1.amazonaws.com:8080/jenkins
.
from devops-intro-project.
@CodeWithOz I've merged/closed all, but one PR in this repo. If you can submit a PR fixing Jenkin's I'll merge it. LMK. Thanks!
from devops-intro-project.
Related Issues (20)
- aws problems HOT 1
- Vagrant box add problem 'URL using bad/illegal format or missing URL' HOT 1
- Devops pr1
- Packer-Templates - Packer Build - Failed to retrieve the pre-configuration file HOT 1
- Dev
- google compute problem HOT 1
- Failed to parse template: open appilcation-server.json: The system cannot find the file specified. HOT 2
- Issues with installing the webapp HOT 6
- Grunt installation failing HOT 1
- Command 'vagrant up' throws error HOT 2
- Unable to download ISO file HOT 3
- Packer.exe is just flashing HOT 1
- Error waiting for SSH: Packer experienced an authentication error when trying to connect via SSH. HOT 1
- Issues ubuntu-14.04.6-server-amd64-appserver_virtualbox.box HOT 3
- bash: cd: packer-templates: No such file or directory HOT 1
- jenkins public key is not available
- asd HOT 1
- Deprecated configuration key iso_checksum_type HOT 1
- FATAL ERROR WHILE CLONING..... HOT 1
- Help wanted HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from devops-intro-project.