My computer is Win7 64 and I have install vagrant and virtualbox.
I have installed portia through follow way:
git clone https://github.com/scrapinghub/portia
vagrant up
The result in the cmd can be showed in this:
==> default: Installing collected packages: slybot
==> default: Running setup.py develop for slybot
==> default:
==> default: warning: no files found matching 'slybot/splash-script-combined
.js'
==> default: Creating /usr/local/lib/python2.7/dist-packages/slybot.egg-link
(link to .)
==> default: Adding slybot 0.13.0b32 to easy-install.pth file
==> default: Installing slybot script to /usr/local/bin
==> default: Installing portiacrawl script to /usr/local/bin
==> default:
==> default: Installed /vagrant/slybot
==> default: Successfully installed slybot
==> default: Cleaning up...
==> default: Executing command: configure_nginx
==> default: Executing command: configure_initctl
==> default: Starting slyd service
==> default: =====================
The SSH command responded with a non-zero exit status. Vagrant
assumes that this means the command failed. The output for this command
should be in the log above. Please read the output to determine what
went wrong
.
Given to this result,I think I have successful install portia.
But when I open http://localhost:9001 or http://127.0.0.1:9001 in my chrome browser, there is nothing happened.
And when I open 'http://127.0.0.1:2222', I can find:
SSH-2.0-OpenSSH_6.6.1p1 Ubuntu-2ubuntu2.8
Protocol mismatch.
And when I open 'http://33.33.33.10', I can find:
Welcome to nginx!
If you see this page, the nginx web server is successfully installed and working. Further configuration is required.
For online documentation and support please refer to nginx.org.
Commercial support is available at nginx.com.
Thank you for using nginx.
I also try it again in my Win7_Child_VHD system,but the results is the same.
I also try to install portia in the docker, but it is also failed and I am not remembering the result.
I have also try to install portia in my vmware of ubuntu:14.04 ,but it is too complicated for me and I have to give up.
It has puzzled me for almost three weeks, and I have to give up if i couldn't solve the problem.
I know i can run portia in scrapinghub/portia.
But I really want to know how to run portia locally. So i want to know how to resolve the problems.
Related
I'm been learning how to use Packer this week on my home lab where I have an ESXi 7 host.
I'm simply trying to deploy a Ubuntu 18.04 VM however at the end of the build I get this error in the packer console:
sudo: no tty present and no askpass program specified
This is what I have done.
Build.json
Preseed.cfg
variables.json
Command I run:
sudo packer build -var-file=variables.json build.json
In ESXi I see the VM build and complete and reboot and it gets an IP and I get a SSH prompt briefly before Packer deletes the VM after I see the above message.
This is the full error:
==> Ubuntu-18.04: Connecting to VNC over websocket...
==> Ubuntu-18.04: Waiting 10s for boot...
==> Ubuntu-18.04: Typing the boot command over VNC...
==> Ubuntu-18.04: Waiting for SSH to become available...
==> Ubuntu-18.04: Connected to SSH!
==> Ubuntu-18.04: Provisioning with shell script: /tmp/packer-shell382031289
==> Ubuntu-18.04: sudo: no tty present and no askpass program specified
==> Ubuntu-18.04: Provisioning step had errors: Running the cleanup provisioner, if present...
==> Ubuntu-18.04: Stopping virtual machine...
==> Ubuntu-18.04: Destroying virtual machine...
Build 'Ubuntu-18.04' errored after 8 minutes 21 seconds: Script exited with non-zero exit status: 1.Allowed exit codes are: [0]
==> Wait completed after 8 minutes 21 seconds
==> Some builds didn't complete successfully and had errors:
--> Ubuntu-18.04: Script exited with non-zero exit status: 1.Allowed exit codes are: [0]
==> Builds finished but no artifacts were created.
What am I doing wrong?
You need to tell sudo to read from stdin like this:
echo 'password' | sudo -S echo "I am groot"
This way your sudo command should work.
I'm trying to install aerospike in my local by following the steps here.
mkdir ~/aerospike-vm && cd ~/aerospike-vm
vagrant init aerospike/aerospike-ce
vagrant up
All the above commands are successful and there are no error.
Below is the minimal log of the vagrant up command.
default: Successfully added box 'aerospike/aerospike-ce' (v4.5.0.5) for 'virtualbox'!
.
.
.
Going on, assuming VBoxService is correct...
==> default: Checking for guest additions in VM...
default: The guest additions on this VM do not match the installed version of
default: VirtualBox! In most cases this is fine, but in rare cases it can
default: prevent things such as shared folders from working properly. If you see
default: shared folder errors, please make sure the guest additions within the
default: virtual machine match the version of VirtualBox you have installed on
default: your host and reload your VM.
default:
default: Guest Additions Version: 5.2.12
default: VirtualBox Version: 6.0
==> default: Configuring and enabling network interfaces...
==> default: Mounting shared folders...
default: /vagrant => /Users/rajkumar.natarajan/aerospike-vm
Below command clearly show only amc is running but not aerospike.
BOSM0001-RANATA:aerospike-vm rajkumar.natarajan$ vagrant ssh -c "sudo service aerospike status"
asd is stopped
Connection to 127.0.0.1 closed.
BOSM0001-RANATA:aerospike-vm rajkumar.natarajan$ vagrant ssh -c "sudo service amc status"
amc (pid 1458) is running...
Connection to 127.0.0.1 closed.
BOSM0001-RANATA:aerospike-vm rajkumar.natarajan$ vagrant ssh -c "sudo grep -i cake /var/log/aerospike/aerospike.log"
Connection to 127.0.0.1 closed.
Any idea what is wrong here.
Do: $ vagrant ssh
that will get you inside the shell. Then see why aerospike did not start.
First try:
$ sudo service aerospike start
then
$ sudo service aerospike status
If it is not running, go through /var/log/aerospike/aerospike.log and see what the log file is showing as the error.
Host OS: Windows 10
Vagrant: 2.2.4
VirtualBox: 6.0.6 r130049
When I run vagrant up, it prints this error message:
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!
setup
Stdout from the command:
Stderr from the command:
bash: line 4: setup: command not found
The machine can be booted normally and SSH from my host to Virtual machine is OK but the synced folder is not working. I know this may not be a critical issue but still feel frustrated as I use my host machine to develop codes and "sync" these codes so that they can be loaded in my virtual machine.
Any advice is highly appreciated.
ps: When I boot a full UI virtual machine (different from my above mentioned) from my VirtualBox directly, it seems OK to have a "sync" directory and the VBGuestAdditions can be installed without errors.
It is a bug in VirtualBox 6.0.6 and it still exists in 6.0.8. The solution is to downgrade your VirtualBox itself and the Guest Extensions to 6.0.4.
Is there a way to use after.sh to run php artisan migrate?
I tried this:
#!/bin/bash
cd exercise-8
vagrant ssh
php artisan migrate
I realized a few things
you have to vagrant ssh before you do migrations
the bash script runs from /home/vagrant
vagrant ssh returns /tmp/vagrant-shell: line 3: vagrant: command not found
php artisan returns
==> default:
==> default: [PDOException]
==> default: SQLSTATE[HY000] [1045] Access denied for user 'forge'#'localhost' (using password: NO)
==> default:
Try this:
cd *
php artisan migrate
Explanation:
cd * enter the only folder you'll have on /home/vagrant
Since these commands are executed on Homestead you do not need vagrant ssh.
I imported the precise32 box, then installed some packages and other data on the VM. My plan is to then repackage it into a box, to save on complicated provisioning when sharing.
However.
vagrant package --base dev-vm --output /box/vm.box
Always returns
[dev-vm] VM not created . Moving on
My directory structure is:
-dev-vm
--.vagrant
--Logs
--box.ovf
--box-disk1.vmdk
--dev-vm_13345342.vbpx
--metadata.json
--Vagrantfile
Ive
set VAGRANT_LOG=debug
Which shows no extra info on whats going on.
Windows 7 using Cygwin
UPDATE:
export VAGRANT_LOG=debug
for Cygwin to set debug log.
I then get
DEBUG subprocess: Waiting for process to exit. Remaining to timeout: 32000
DEBUG subprocess: Exit status: 0
INFO warden: Calling action: #<Vagrant::Action::Builtin::Call:0x2abb800>
INFO runner: Running action: #<Vagrant::Action::Builder:0x2695920>
INFO warden: Calling action: #<VagrantPlugins::ProviderVirtualBox::Action::Created:0x267c078>
INFO runner: Running action: #<Vagrant::Action::Warden:0x2ac6c48>
INFO warden: Calling action: #<VagrantPlugins::ProviderVirtualBox::Action::MessageNotCreated:0x2ac6c00>
INFO interface: info: VM not created. Moving on...
When you package a box, the box name has to be the specific machine name that you can get from VirtualBox (e.g. lucid_1372711888). Just execute following command in cmd:
vboxmanage list vms
Notice that "vboxmanage" should prior be added to PATH variable. See here how to do that.
Also notice that virtual maschine name must not contain spaces. Otherwise it won't be recognized by "vagrant package" command. For instance:
vagrant package --base win7_vbox_base --output win7_base.box #CORRECT
------------------------------------------------------------------------
vagrant package --base win7 vbox base --output win7_base.box #INCORRECT
If you are in the folder that contains your Vagrantfile, you can also simply run:
vagrant package --output your-box-name.box
The following image shows the content of the .box file created with this command: