I'm having issues running the provision on the LAMP box.
The version of the Vagrant: 1.3.0
I have created a VM and ran Vagrant up. I get a time out error but the VM seems to be up and running (vagrant status shows the status of the VM).
When I tried running the "vagrant provision" I received the following error.
$ vagrant provision
[default] Running provisioner: shell...
DL is deprecated, please use Fiddle
[default] Running: C:/Users/vjay/AppData/Local/Temp/vagrant-shell20140127-4496-wgoaz8
/bin/bash: /vagrant/shell/os-detect.sh: No such file or directory
/bin/bash: /vagrant/shell/os-detect.sh: No such file or directory
cat: /vagrant/shell/self-promotion.txt: No such file or directory
Created directory /.puphpet-stuff
[default] Running provisioner: shell...
[default] Running: C:/Users/vjay/AppData/Local/Temp/vagrant-shell20140127-4496-1mc5ktv
/bin/bash: /vagrant/shell/os-detect.sh: No such file or directory
/bin/bash: /vagrant/shell/os-detect.sh: No such file or directory
/bin/bash: /vagrant/shell/os-detect.sh: No such file or directory
[default] Running provisioner: shell...
[default] Running: C:/Users/vjay/AppData/Local/Temp/vagrant-shell20140127-4496-1beurlg
/bin/bash: /vagrant/shell/os-detect.sh: No such file or directory
/bin/bash: /vagrant/shell/os-detect.sh: No such file or directory
Installing git
Finished installing git
cp: Copied Puppetfile
cannot stat `/vagrant/puppet/Puppetfile': No such file or directory
Installing librarian-puppet
Finished installing librarian-puppet
Running initial librarian-puppet
/usr/lib/ruby/1.8/pathname.rb:770:in `read': No such file or directory - /etc/puppet/Puppetfile (Errno::ENOENT)
from /usr/lib/ruby/1.8/pathname.rb:770:in `read'
from /usr/lib/ruby/gems/1.8/gems/librarian-puppet-0.9.10/vendor/librarian/lib/librarian/specfile.rb:14:in `read'
from /usr/lib/ruby/gems/1.8/gems/librarian-puppet-0.9.10/vendor/librarian/lib/librarian/action/resolve.rb:12:in `run'
from /usr/lib/ruby/gems/1.8/gems/librarian-puppet-0.9.10/vendor/librarian/lib/librarian/cli.rb:161:in `resolve!'
from /usr/lib/ruby/gems/1.8/gems/librarian-puppet-0.9.10/lib/librarian/puppet/cli.rb:63:in `install'
from /usr/lib/ruby/gems/1.8/gems/thor-0.18.1/lib/thor/command.rb:27:in `__send__'
from /usr/lib/ruby/gems/1.8/gems/thor-0.18.1/lib/thor/command.rb:27:in `run'
from /usr/lib/ruby/gems/1.8/gems/thor-0.18.1/lib/thor/invocation.rb:120:in `invoke_command'
from /usr/lib/ruby/gems/1.8/gems/thor-0.18.1/lib/thor.rb:363:in `dispatch'
from /usr/lib/ruby/gems/1.8/gems/thor-0.18.1/lib/thor/base.rb:439:in `start'
from /usr/lib/ruby/gems/1.8/gems/librarian-puppet-0.9.10/vendor/librarian/lib/librarian/cli.rb:29:in `bin!'
from /usr/lib/ruby/gems/1.8/gems/librarian-puppet-0.9.10/bin/librarian-puppet:9
from /usr/bin/librarian-puppet:19:in `load'
from /usr/bin/librarian-puppet:19
Finished running initial librarian-puppet
[default] Running provisioner: puppet...
Shared folders that Puppet requires are missing on the virtual machine.
This is usually due to configuration changing after already booting the
machine. The fix is to run a `vagrant reload` so that the proper shared
folders will be prepared and mounted on the VM.
Just to add on to that, I dug through several blog posts and one of those posts asked to try the command line git utility (because apparently there were issues around CRLF and LF). I deleted everything and tried the command line git but to no avail.
Can someone please help resolve this issue.
Update: Vagrant file attached:
VAGRANTFILE_API_VERSION = "2"
BOX_NAME = "dct-lamp-local"
RELATIVE = '../..'
ROOT = '/vagrant'
load '../common.include'
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.synced_folder "#{RELATIVE}/www/", "/var/www/html", id: "apache", :nfs => false, :mount_options => ["uid=510,gid=510"]
config.vm.provider :virtualbox do |virtualbox|
virtualbox.customize ["modifyvm", :id, "--name", BOX_NAME]
virtualbox.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
virtualbox.customize ["modifyvm", :id, "--memory", "1024"]
virtualbox.customize ["setextradata", :id, "--VBoxInternal2/SharedFoldersEnableSymlinksCreate/v-root", "1"]
end
config.vm.box = BOX_NAME
config.vm.hostname = "#{BOX_NAME}.local"
end
It looks like you should change the ROOT line in the vagrant file to point to the actual location of the vagrant file you got from PuPHPet.
The first error indicates that it is looking for a script in the shell directory under /vagrant, and ROOT is set to /vagrant in your vagrant file.
/bin/bash: /vagrant/shell/os-detect.sh: No such file or directory
Related
Trying to add .conf files to /etc/httpd/conf.d/ directory on the E2 instance from elastic beanstalk during deployment of Elastic Beanstalk Application. I've added the .ebextensions directory with a .config file that is defined as follows:
files:
"/etc/php.d/project.ini" :
mode: "000644"
owner: root
group: root
content: |
max_input_vars = 10000
upload_max_filesize = 256M
post_max_size = 256M
container_commands:
01_enable_mod_deflate:
command: "cp .ebextensions/enable_mod_deflate.conf /etc/httpd/conf.d/enable_mod_deflate.conf"
02_enable_mod_expires:
command: "cp .ebextensions/enable_mod_expires.conf /etc/httpd/conf.d/enable_mod_expires.conf"
03_secure_wordpress:
command: "cp .ebextensions/secure_wordpress.conf /etc/httpd/conf.d/secure_wordpress.conf"
04_restart_apache:
command: "sudo apachectl restart"
the .conf files are all in the .ebextensions folder, but they are not getting copied over, which is causing an issue with .htaccess in the root of the wordpress site. The error that is being generated looks like this:
Command 01_enable_mod_deflate (cp /var/app/current/.ebextensions/enable_mod_deflate.conf /etc/httpd/conf.d/enable_mod_deflate.conf) failed
2020-10-05 13:45:59,944 [ERROR] Error encountered during build of postbuild_0_Benefits_Bridge_2: Command 01_enable_mod_deflate failed
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/cfnbootstrap/construction.py", line 542, in run_config
CloudFormationCarpenter(config, self._auth_config).build(worklog)
File "/usr/lib/python2.7/site-packages/cfnbootstrap/construction.py", line 260, in build
changes['commands'] = CommandTool().apply(self._config.commands)
File "/usr/lib/python2.7/site-packages/cfnbootstrap/command_tool.py", line 117, in apply
raise ToolError(u"Command %s failed" % name)
ToolError: Command 01_enable_mod_deflate failed
Not sure what any of that even means, but it's generating the same error for each file. What is wrong here? I just spun up a new instance of Elastic Beanstalk and shouldn't this work by default? Is there an issue with the Instance or something? The site is generating a 500 error because of the .htaccess file in the root, but if I remove it, than only the homepage loads and all other pages give 404 errors. I need these .conf files added to the /etc/httpd/conf.d/ directory of all instances, but they aren't added at all to any of the instances because of the error above, which I have no idea how to fix, or if this is an issue with the instance which is the default that gets created with Elastic Beanstalk?
How to fix this problem? I've restarted the Environment, but that didn't help. I'm a bit hestitant to Rebuild the Environment since that will wipe out the database that is connected to the application and not sure if that would help any.
You are probably using Amazon Linux 2 that changed the location of configuration files for proxy (NGINX or Apache).
Put your proxy configuration files under .platform instead of .ebextensions:
Ex:
|____wp-signup.php
|____.platform
| |____httpd
| | |____conf.d
| | | |____http-redirect.conf
More details in the documentation:
Migrating your Elastic Beanstalk Linux application to Amazon Linux 2
I have configured the elasticbeanstalk hook to download the file from s3 bucket to windows elasticbeanstalk instance.
file downloaded successfully on Desktop of administrator user of elasticbeanstalk, but I am unable to copy that file to c:/Windows/fonts directory.
below is the .config file.
sources:
"C:/Users/Administrator/Desktop": https://test.s3-ap-southeast-1.amazonaws.com/font/ARIALUNI.zip
commands:
copyfile:
command: copy C:/Users/Administrator/Desktop/ARIALUNI.TTF C:/Windows/Fonts
It's giving below error in elasticbeanstalk.
Error occurred during build: Command copyfile failed
nfra-WriteRuntimeConfig, Infra-EmbeddedPreBuild, Hook-PreAppDeploy,
Infra-EmbeddedPostBuild, Hook-EnactAppDeploy, Hook-PostAppDeploy]
Command failed on instance. Return code: 1 Output: null.
I have also tried to hook file like but that doesn't work.
sources:
"c:/myproject/myapp": https://test.s3-ap-southeast-1.amazonaws.com/font/ARIALUNI.zip
It's giving below error in elasticbeanstalk.
Error occurred during build: [Errno 22] invalid mode ('wb') or
filename: u'c:\Windows\Fonts\ARIALUNI.TTF'
Updated config file with the below code and it works.
Refrence url : https://richardspowershellblog.wordpress.com/2008/03/20/special-folders/
sources:
"c:/windows/temp/fonts": https://test.s3-ap-southeast-1.amazonaws.com/font/ARIALUNI.zip
files:
"C:\\scripts\\install_font.ps1":
content: |
#Commands
$Destination = (New-Object -ComObject Shell.Application).Namespace(0x14)
#Font Location
$Font = "C:\Windows\Temp\Fonts\ARIALUNI.TTF"
#Install
$Destination.CopyHere($Font,0x10)
commands:
install_font:
command: powershell.exe -ExecutionPolicy Bypass -Command "C:\\scripts\\install_font.ps1"
ignoreErrors: false
waitAfterCompletion: 5
I'm deploying my app in Ubuntu 14.4, Ruby 2.3.3, Nginx and Passenger. When I deploy using capistrano, I get the error:
SSHKit::Command::Failed: passenger-config exit status: 1
passenger-config stdout: Nothing written
passenger-config stderr: *** ERROR: Phusion Passenger doesn't seem to be running. If you are sure that it
is running, then the causes of this problem could be one of:
1. You customized the instance registry directory using Apache's
PassengerInstanceRegistryDir option, Nginx's
passenger_instance_registry_dir option, or Phusion Passenger Standalone's
--instance-registry-dir command line argument. If so, please set the
environment variable PASSENGER_INSTANCE_REGISTRY_DIR to that directory
and run this command again.
2. The instance directory has been removed by an operating system background
service. Please set a different instance registry directory using Apache's
PassengerInstanceRegistryDir option, Nginx's passenger_instance_registry_dir
option, or Phusion Passenger Standalone's --instance-registry-dir command
line argument.
Tasks: TOP => passenger:restart
(See full trace by running task with --trace)
The deploy has failed with an error: Exception while executing as user#IP-Address: passenger-config exit status: 1
passenger-config stdout: Nothing written
passenger-config stderr: *** ERROR: Phusion Passenger doesn't seem to be running. If you are sure that it
is running, then the causes of this problem could be one of:
1. You customized the instance registry directory using Apache's
PassengerInstanceRegistryDir option, Nginx's
passenger_instance_registry_dir option, or Phusion Passenger Standalone's
--instance-registry-dir command line argument. If so, please set the
environment variable PASSENGER_INSTANCE_REGISTRY_DIR to that directory
and run this command again.
2. The instance directory has been removed by an operating system background
service. Please set a different instance registry directory using Apache's
PassengerInstanceRegistryDir option, Nginx's passenger_instance_registry_dir
option, or Phusion Passenger Standalone's --instance-registry-dir command
line argument.
I have tried several suggestions such as: https://www.pistolfly.com/weblog/en/2016/01/passenger-config-and-passenger-status-result-in-an-error-on-centos7.html
Passenger doesn't seem to be running (Capistrano/Rails/Apache/Ubuntu)
But nothing helped! I have checked my Nginx default_sites to see if I point to current rails path and everything looks correct.
Any help is appreciated!
This issue was fixed by adding restart.txt in my_app_name/current/tmp:
*It's done in the server:
*touch my_app_name/current/tmp/restart.txt
And add:
set :passenger_restart_with_touch, true in deploy.rb
UPDATE
In the newest version of capistrano, this is taken care of by gem 'capistrano-passenger' and adding adding require 'capistrano/passenger' in your capfile
I am working on testing my Rails app which has bower-rails gem on wercker.com.
The wercker.yml has the following setting.
- script:
name: rake bower:install
code: bundle exec rake bower:install
And the bower.json on the app has some dependencies which have my private git repository.
So, during the test an error occurs because the wercker couldn't access to the private repository. The error was like below.
bower foo#* ECMDERR Failed to execute "git ls-remote --tags --heads git#bitbucket.org:myrepository/foo.git", exit code of #128 Warning: Permanently added the RSA host key for IP address 'xxx.xxx.xxx.xxx' to the list of known hosts. Permission denied (publickey). fatal: The remote end hung up unexpectedly
Additional error details:
Warning: Permanently added the RSA host key for IP address 'xxx.xxx.xxx.xxx' to the list of known hosts.
Permission denied (publickey).
fatal: The remote end hung up unexpectedly
rake aborted!
Any solutions?
Can anyone explain why I am getting the following error
"Vagrant: Network type 'bridged' is invalid. Please use a valid network type."
when I try to bring vagrant up on Virtual Box with the following Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.hostname = "gitserver"
config.berkshelf.enabled = true
config.vm.box = "centos57"
config.vm.box_url = "http://xx.xx.xx.xx/os/centos-5.7-x86_64.box"
config.vm.network :bridged, :bridge => 'eth0'
# Provision VM using chef
config.vm.provision :chef_solo do |chef|
chef.cookbooks_path = "cookbooks"
chef.add_recipe "mysqlserver"
end
config.vm.customize ["modifyvm", :id, "--memory", 1024]
end
I have tried all possible combinations with bridged configuration, but it simply does not like it. I cannot find any additional info as to why. Any help here would be hugely appreciated.
Since you are using a Vagrant config file version 2 (and therefore Vagrant 1.1+) instead of :bridge there is now the new type :public_network.
To use v1 code, you can insert it into a config 1 block like this:
Vagrant.configure("1") do |config|
config.vm.network :bridged, :bridge => 'eth0'
end
For Vagrant 1.3.5 in used the following:
config.vm.network :public_network, bridge: "en0: Wi-Fi (AirPort)"
It worked for me.
I am installing vagrant on ubuntu 10.04 with Virtualbox VirtualBox 4.1.24 from https://www.virtualbox.org/wiki/Linux_Downloads and then downloaded recent version of vagrant.
$ vagrant -v
Vagrant version 1.2.2
$ dpkg -l virtualbox*
ii virtualbox-4.1 4.1.26-84997~U Oracle VM VirtualBox
In order to use bridge network and specifically wifi i just added the line below inside Vagrantfile
config.vm.network :public_network, :public_network => "wlan0"
When you will do
$ vagrant up
You will see option asking for device for bridge interface you can use 1 for wlan0. Hope it helps.