Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Welcome to emergency mode!After logging in,type "systemctl default" or ^D to try again to boot into default mode #9

Open
guestart opened this issue Aug 1, 2017 · 8 comments

Comments

@guestart
Copy link

guestart commented Aug 1, 2017

Hello,Mr bamcgill.
I have a problem about executing script file ‘start.sh' after installing '==> virtualbox-iso: Pausing 3m20s before the next provisioner...
==> virtualbox-iso: Provisioning with shell script: /tmp/packer-shell494569482' in Virtual Box 5.1.10 of my linux server 'CentOS 6.6 x86_64',then show info such as 'Welcome to emergency mode! After logging in, type "journalctl -xb" to view system logs, "systemctl reboot to reboot, "systemctl default" or ^D to try again to boot into default mode. (or type Control-D to continue): ',i press ^D,next show info such as ' Error getting authority: Error initializing authority: Could not connect: No such file or directory (g-io-error-quark, 1)',and how to solve it ?
Thanks!
Best Regards
Quanwen Zhao

@totierne
Copy link
Contributor

totierne commented Aug 2, 2017

Hi Quanwen Zhao,

I will give some information for general startup issues.
Please send in the full output of start.sh

One issue is if a network proxy is required (initial .iso file to virtual hard drive) it needs to be specified (or move the build to where a proxy is not required).

Another issue could be 10 seconds is not enough time to wait to give the boot instructions.
see Relevant startup settings.

Regards,
Turloch

1/It takes a while to go from iso to disk before any database things are added (20mins?)

2/Network proxy:
bash start.sh "http://and_proxy_as_first_arg_if_wanted" export
"http://and_proxy_as_first_arg_if_wanted" is optional
export - it you want exported to .ova file.

3/Relavent Startup Settings that may cause issues:
packerConfig.json: (10 seconds might not be enough on a slower machine - put in multiple )
"boot_command": [
"",
...
(uses 4Gb and 2cpu for the VM)
"vboxmanage": [
[ "modifyvm", "{{.Name}}", "--memory", "4096" ],
[ "modifyvm", "{{.Name}}", "--cpus", "2" ],

Initial iso to virtual hard disk is controlled by:
upload/buildTimeConfig.cfg

Needs more than 60Gb free disk space - compressed output alone is 7.2 GB.

4/Sample output up until bash/shell scripts

  • packer build -var iso_downloaded=y -var oracle_database_downloaded=y -var pro
    xy= -var skip_export=false packerConfig.json
    ^[[1;32mvirtualbox-iso output will be in this color.^[[0m

^[[1;32m==> virtualbox-iso: Downloading or copying Guest additions^[[0m
^[[0;32m virtualbox-iso: Downloading or copying: file:///Applications/Virtua
lBox.app/Contents/MacOS/VBoxGuestAdditions.iso^[[0m
^[[1;32m==> virtualbox-iso: Downloading or copying ISO^[[0m
^[[0;32m virtualbox-iso: Downloading or copying: file:///Users/totierne/Desk
top/separation/unziphere/OracleLinux-R7-U3-Server-x86_64-dvd.iso^[[0m
^[[1;32m==> virtualbox-iso: Starting HTTP server on port 8429^[[0m
^[[1;32m==> virtualbox-iso: Creating virtual machine...^[[0m
^[[1;32m==> virtualbox-iso: Creating hard drive...^[[0m
^[[1;32m==> virtualbox-iso: Executing custom VBoxManage commands...^[[0m
^[[0;32m virtualbox-iso: Executing: modifyvm Oracle DB Developer VM --memory
4096^[[0m
^[[0;32m virtualbox-iso: Executing: modifyvm Oracle DB Developer VM --cpus 2
^[[0m
^[[0;32m virtualbox-iso: Executing: createhd --filename Oracle DB Developer
VM__2.vdi --size 30000^[[0m
^[[0;32m virtualbox-iso: Executing: storageattach Oracle DB Developer VM --s
toragectl SATA Controller --port 1 --device 0 --type hdd --medium Oracle DB Dev
eloper VM__2.vdi^[[0m
^[[0;32m virtualbox-iso: Executing: modifyvm Oracle DB Developer VM --clipbo
ard bidirectional^[[0m
^[[0;32m virtualbox-iso: Executing: modifyvm Oracle DB Developer VM --dragan
ddrop bidirectional^[[0m
^[[0;32m virtualbox-iso: Executing: modifyvm Oracle DB Developer VM --paravi
rtprovider kvm^[[0m
^[[0;32m virtualbox-iso: Executing: modifyvm Oracle DB Developer VM --natpf1
net8,tcp,,1521,,1521^[[0m
^[[0;32m virtualbox-iso: Executing: modifyvm Oracle DB Developer VM --natpf1
ssh,tcp,,2222,,22^[[0m
^[[0;32m virtualbox-iso: Executing: modifyvm Oracle DB Developer VM --natpf1
apex8080,tcp,,8080,,8080^[[0m
^[[0;32m virtualbox-iso: Executing: modifyvm Oracle DB Developer VM --natpf1
apex8081,tcp,,8081,,8081^[[0m
^[[0;32m virtualbox-iso: Executing: modifyvm Oracle DB Developer VM --audio
none^[[0m
^[[0;32m virtualbox-iso: Executing: modifyvm Oracle DB Developer VM --vram 1
28^[[0m
^[[1;32m==> virtualbox-iso: Starting the virtual machine...^[[0m
^[[1;32m==> virtualbox-iso: Waiting 10s for boot...^[[0m
^[[1;32m==> virtualbox-iso: Typing the boot command...^[[0m
^[[1;32m==> virtualbox-iso: Typing the boot command...^[[0m
^[[1;32m==> virtualbox-iso: Waiting for SSH to become available...^[[0m
^[[1;32m==> virtualbox-iso: Connected to SSH!^[[0m
^[[1;32m==> virtualbox-iso: Uploading VirtualBox version info (5.1.14)^[[0m
^[[1;32m==> virtualbox-iso: Uploading VirtualBox guest additions ISO...^[[0m
^[[1;32m==> virtualbox-iso: Uploading upload => /tmp^[[0m
^[[1;32m==> virtualbox-iso: Uploading put_files_here => /tmp^[[0m
^[[1;32m==> virtualbox-iso: Provisioning with shell script: /var/folders/np/0_y
vcr0s6_df9ghpdvqjdk1w0000gn/T/packer-shell169680144^[[0m
^[[0;32m virtualbox-iso:^[[0m
^[[0;32m virtualbox-iso: We trust you have received the usual lecture from t
he local System^[[0m
^[[0;32m virtualbox-iso: Administrator. It usually boils down to these three
things:^[[0m
^[[0;32m virtualbox-iso:^[[0m
^[[0;32m virtualbox-iso: #1) Respect the privacy of others.^[[0m
^[[0;32m virtualbox-iso: #2) Think before you type.^[[0m
^[[0;32m virtualbox-iso: #3) With great power comes great responsibility.^[[
0m
^[[0;32m virtualbox-iso:^[[0m
^[[0;32m virtualbox-iso: PROGRESS: Call Tree: 1updateLinux.sh^[[0m
^[[0;32m virtualbox-iso: PROGRESS: 1/4 1updateLinux.sh - first script run -
... (From there on it is mostly bash/shell)

@totierne
Copy link
Contributor

totierne commented Aug 2, 2017

packerConfig.json: (10 seconds might not be enough on a slower machine - put in multiple
LTwait10GT)
"boot_command": [
"LTwait10GT",

The greater than less than signs messed to the formatting GT greater than, LT less than

@guestart
Copy link
Author

guestart commented Aug 3, 2017 via email

@guestart
Copy link
Author

guestart commented Aug 3, 2017 via email

@totierne
Copy link
Contributor

totierne commented Aug 3, 2017

"LTwait10GTLTwait10GT" -> wait 2x wait 10 ie wait 20. (Unfortunately you cannot put wait30, there is a wait 10, wait5 and a wait1 (in packer)).
There may be a timeout to go to the graphical installer.
wait10 works on intel i7 macbook pro with ssd.

I do not see your enclosure I assume your issue is around here in the output to the packer command:
^[[1;32m==> virtualbox-iso: Waiting 10s for boot...
^[[0m ^[[1;32m==> virtualbox-iso: Typing the boot command...
^[[0m ^[[1;32m==> virtualbox-iso: Typing the boot command...
^[[0m ^[[1;32m==> virtualbox-iso: Waiting for SSH to become available...
^[[0m ^[[1;32m==> virtualbox-iso: Connected to SSH!^[[0m

Note you can see the boot command being typed in if you watch
the virtualbox graphical screen output,
should help you figure out what a suitable timeout is on your machine,
too small a wait - linux guest is not ready, too long a timeout, linux guest may go to graphical install or pick a default option.

"LTwait10GT", The greater than less than signs messed to the formatting GT greater than, LT less than

@guestart
Copy link
Author

guestart commented Aug 3, 2017

My enclosure is in email that I sent to you,actually i think about 'default wait 10s' that step is Ok,(just you say,only 1,5 and 10s in packer),because this comment area don't upload my error snapshot!

@guestart
Copy link
Author

guestart commented Aug 4, 2017

my start.sh executed content as follows,
......
==> virtualbox-iso: Provisioning with shell script: /tmp/packer-shell808038779
virtualbox-iso:
virtualbox-iso: We trust you have received the usual lecture from the local System
virtualbox-iso: Administrator. It usually boils down to these three things:
virtualbox-iso:
virtualbox-iso: #1) Respect the privacy of others.
virtualbox-iso: #2) Think before you type.
virtualbox-iso: #3) With great power comes great responsibility.
virtualbox-iso:
virtualbox-iso: PROGRESS: Call Tree: 1updateLinux.sh
virtualbox-iso: PROGRESS: 1/4 1updateLinux.sh - first script run - from plain iso. Set up second drive. Started: 5:17:49
virtualbox-iso: PROGRESS: XXXXXXXXXXXXXX mv for optional /tmp/1/jdk8x64.tar.gz failed XXXXXXXXXXXX
virtualbox-iso: PROGRESS: XXXXXXXXXXXXXX mv for optional /tmp/1/sqldev.zip failed XXXXXXXXXXXX
virtualbox-iso: PROGRESS: XXXXXXXXXXXXXX mv for optional /tmp/1/sqlcl.zip failed XXXXXXXXXXXX
virtualbox-iso: PROGRESS: XXXXXXXXXXXXXX mv for optional /tmp/1/apex.zip failed XXXXXXXXXXXX
virtualbox-iso: PROGRESS: XXXXXXXXXXXXXX mv for optional /tmp/1/ords.zip failed XXXXXXXXXXXX
virtualbox-iso: PROGRESS: XXXXXXXXXXXXXX mv for optional /tmp/1/demos.zip failed XXXXXXXXXXXX
virtualbox-iso: PROGRESS: XXXXXXXXXXXXXX mv for optional /tmp/1/mozillablob.zip failed XXXXXXXXXXXX
virtualbox-iso: PROGRESS: XXXXXXXXXXXXXX mv for optional /tmp/1/modeler.zip failed XXXXXXXXXXXX
virtualbox-iso: PROGRESS: XXXXXXXXXXXXXX mv for optional /tmp/1/restclient.jar failed XXXXXXXXXXXX
virtualbox-iso: PROGRESS: XXXXXXXXXXXXXX mv for optional /tmp/1/storm.zip failed XXXXXXXXXXXX
virtualbox-iso: [sudo] password for oracle: Shutdown scheduled for Fri 2017-08-04 05:18:53 EDT, use 'shutdown -c' to cancel.
virtualbox-iso: PROGRESS: XXXXXXXXXXXXXX mv for optional /tmp/1/reset_xmldbjson failed XXXXXXXXXXXX
virtualbox-iso: PROGRESS: XXXXXXXXXXXXXX mv for optional /tmp/1/master.zip failed XXXXXXXXXXXX
virtualbox-iso: PROGRESS: XXXXXXXXXXXXXX parallel mv failed XXXXXXXXXXXXXX
virtualbox-iso: PROGRESS: Ending 1updateLinux.sh Ended: 5:17:53 Duration: 00h:00m:04s
==> virtualbox-iso: Pausing 3m20s before the next provisioner...
==> virtualbox-iso: Provisioning with shell script: /tmp/packer-shell560861586

at the same time,my VBox is show content as follows,(previous omitting content is ok.)
......
[TIME] Timed out waiting for device dev-sdb1.device.
[DEPEND] Dependency failed for /u01.
[DEPEND] Dependency failed for Local File Systems.
[DEPEND] Dependency failed for Relabel all filesystems, if necessary.
[DEPEND] Dependency failed for Mark the need to relabel after reboot.
[ OK ] Reached target Login Prompts.
[ OK ] Reached target Network.
[ OK ] Reached target Network is Online.
[ OK ] Reached target Paths.
[ OK ] Reached target Sockets.
Starting Create Volatile Files and Directories...
[ OK ] Started Emergency Shell.
Starting Emergency Shell...
[ OK ] Reached target Emergency Mode.
[ OK ] Reached target Timers.
[ OK ] Started Create Volatile Files and Directories.
Starting Update UTMP about System Boot/Shutdown...
[ OK ] Started Update UTMP about System Boot/Shutdown.
Starting Update UTMP about System Runlevel Changes...
[ OK ] Started Update UTMp about System Runlevel Changes.
Welcome to emergency mode! After logging in, type "journalctl -xb" to view system logs, "systemctl reboot" to reboot, "systemctl default" or ^D to try again to boot into default mode.
Give root password for maintenance
(or type Control-D to continue):

wait a moment,
'start.sh' execution part next show is,
==> virtualbox-iso: Unregistering and deleting virtual machine...
==> virtualbox-iso: Deleting output directory...
Build 'virtualbox-iso' errored: Retryable error: Error uploading script: Timeout during SSH handshake

==> Some builds didn't complete successfully and had errors:
--> virtualbox-iso: Retryable error: Error uploading script: Timeout during SSH handshake

==> Builds finished but no artifacts were created.

Finally,'start.sh' exit and return to prompt '[oracle@orcl13 db-appdev-vm-master]$ 'of oracle user.
(I'm sorry,my enclosure is above,i write it)

@totierne
Copy link
Contributor

totierne commented Aug 4, 2017

Hi Quanwen Zhao,
"mv for optional"
is OK that is for optional additional files.
It also means you have reached 'bash/shell' side - maybe first reboot failed.
/u01 is second virtual disk set up by:
(cut and paste may destroy formatting: see file: uploads/1updateLinux_inner.sh )

function make_disks {
mkfs.xfs -f /dev/sdb1
mkdir /u01
chmod 777 /u01
mount -t xfs /dev/sdb1 /u01
chmod 755 /u01
chown oracle /u01
ed -s /etc/fstab <<EOF
$a
/dev/sdb1 /u01 xfs defaults 0 0
.
w
EOF
systemctl enable gdm.service
systemctl set-default graphical.target
}

If in
1updateLinux.sh
Formatting causes an issue with underscores
(/tmp/1/1updateLinux_inner.sh "$@" 2>&1) | tee -a ~oracle/log/thestdoutlog_basename $0$$ | egrep '^PROGRESS'
do
(bash -x /tmp/1/1updateLinux_inner.sh "$@" 2>&1) | tee -a ~oracle/log/thestdoutlog
basename $0_$$
you should get lots of feedback to the start.sh output changes being bash -x and remove the "| egrep '^PROGRESS'"
(bash -x echo out commands during execution, "| egrep '^PROGRESS'" remove the code to show only summary commands starting with "PROGRESS")

I am still thinking it might be a proxy setting issue (which I often hit myself) (which causes problems here as 'mkfs.xfs' not updated during the build).

You can send me email with large .txt attachments to turloch.otierney@oracle.com

Regards,
Turloch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants