Bug 1147946 - Snapshot restore is not working (two scenarios)
Summary: Snapshot restore is not working (two scenarios)
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OpenShift Online
Classification: Red Hat
Component: Containers
Version: 1.x
Hardware: x86_64
OS: Mac OS
unspecified
medium
Target Milestone: ---
: 2.x
Assignee: Jhon Honce
QA Contact: libra bugs
URL:
Whiteboard:
Depends On:
Blocks: 1154649
TreeView+ depends on / blocked
 
Reported: 2014-09-30 11:37 UTC by German
Modified: 2015-02-18 16:51 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 1154649 (view as bug list)
Environment:
Last Closed: 2015-02-18 16:51:31 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description German 2014-09-30 11:37:41 UTC
Description of problem:

I have recently migrated my account to a new account with a different domain. In order to mantain my actual apps I have loged in with rhc tools to my old account and executed two successful snapshot save <appname>. After that I have loged out of my old app and loged in again to my new app, created same two apps with same gears and cartridges and executed snapshot restore <appname> <filename> without expected results.

Specific results per app:

* Scalable php 5.3 + mysql 5.1 
    snapshot save: OK
    snapshot restore:
      - Database restore OK
      - User data folder OK
      - Code restore NOOK. After restore, default openshift landing page is showing when access app url.

* Scalable jboas7 + postgresql 9.2
    snapshot save: OK
    snapshot restore: 
      - Database restore NOOK.
      - User data folder NOOK.
      - Code restore NOOK. After long time executing rhc restore command doing restoring app-root data operation, ruby error pops out. 


Expected results:

Have my app running as it was on my old openshift account automatically.

Further actions:

I have migrated my code manualy merging new app git repo with my existing external git repo (both cases) and restoring db with pgadmin doing a port-forward rhc command.

Comment 1 Jessica Forrester 2014-09-30 15:20:16 UTC
What were the exact commands you ran?
What was the ruby error you saw?
What OS and ruby version are you running rhc on?

Comment 2 German 2014-09-30 21:49:07 UTC
1) What were the exact commands you ran?

rhc setup -l <user> (old account)
rhc snapshot save <appname>
rhc logout
rhc setup -l <user> (new account)
created app jboss7 scalable with postgresql 9.2 via web console.
rhc snapshot restore <appname> -f <local folder tar>


2) What was the ruby error you saw?

Removing old data dir: ~/app-root/data/*
Restoring ~/app-root/data
/opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-node-1.30.5/lib/openshift-origin-node/utils/shell_exec.rb:140:in `rescue in block (2 levels) in oo_spawn': Shell command '/bin/tar --strip=2 --overwrite -xmz ./*/app-root/data ./*/app-deployments --transform="s|${OPENSHIFT_GEAR_NAME}/data|app-root/data|" --transform="s|git/.*\.git|git/${OPENSHIFT_GEAR_NAME}.git|" --exclude="./*/app-root/runtime/data" --exclude="./*/jbossas/data" --exclude="./*/haproxy/data" 1>&2' exceeded timeout of 3596 (OpenShift::Runtime::Utils::ShellExecutionException)
	from /opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-node-1.30.5/lib/openshift-origin-node/utils/shell_exec.rb:123:in `block (2 levels) in oo_spawn'
	from /opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-node-1.30.5/lib/openshift-origin-node/utils/shell_exec.rb:96:in `pipe'
	from /opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-node-1.30.5/lib/openshift-origin-node/utils/shell_exec.rb:96:in `block in oo_spawn'
	from /opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-node-1.30.5/lib/openshift-origin-node/utils/shell_exec.rb:95:in `pipe'
	from /opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-node-1.30.5/lib/openshift-origin-node/utils/shell_exec.rb:95:in `oo_spawn'
	from /opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-container-selinux-0.10.1/lib/openshift/runtime/containerization/selinux_container.rb:368:in `run_in_container_context'
	from /opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-node-1.30.5/lib/openshift-origin-node/model/application_container.rb:795:in `run_in_container_context'
	from /opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-node-1.30.5/lib/openshift-origin-node/model/application_container_ext/snapshots.rb:259:in `extract_restore_archive'
	from /opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-node-1.30.5/lib/openshift-origin-node/model/application_container_ext/snapshots.rb:162:in `restore'
	from /usr/bin/gear:585:in `block (2 levels) in <main>'
	from /opt/rh/ruby193/root/usr/share/gems/gems/commander-4.0.3/lib/commander/command.rb:180:in `call'
	from /opt/rh/ruby193/root/usr/share/gems/gems/commander-4.0.3/lib/commander/command.rb:180:in `call'
	from /opt/rh/ruby193/root/usr/share/gems/gems/commander-4.0.3/lib/commander/command.rb:155:in `run'
	from /opt/rh/ruby193/root/usr/share/gems/gems/commander-4.0.3/lib/commander/runner.rb:385:in `run_active_command'
	from /opt/rh/ruby193/root/usr/share/gems/gems/commander-4.0.3/lib/commander/runner.rb:62:in `run!'
	from /opt/rh/ruby193/root/usr/share/gems/gems/commander-4.0.3/lib/commander/delegates.rb:11:in `run!'
	from /opt/rh/ruby193/root/usr/share/gems/gems/commander-4.0.3/lib/commander/import.rb:10:in `block in <top (required)>'


3) What OS and ruby version are you running rhc on?

MACOS maveriks - ruby 2.0.0p481 (2014-05-08 revision 45883) [universal.x86_64-darwin13]

Comment 3 Lili Nader 2014-10-01 19:33:06 UTC
I could not reproduce this problem.  The problem could be the restore times out because of size of snapshot.  Can you take a look inside your tar file and see if there are any large files inside app-root/data?

Comment 4 German 2014-10-01 20:31:48 UTC
That folder has an sql backup of 15 MB nothing else. But tar snapshot size has 328 MB. Where jbossas and app deployments are the biggest folders. I can see that snapshot includes jbossas/standalone/tmp folder of 121 MB. 

As an idea maybe you could exclude some unnecessary folders like this tmp and others inside app-deployments when generating the snapshot via snapshot save?

Comment 5 Lili Nader 2014-10-02 04:18:27 UTC
You can try setting a the timeout for the restore command to larger value (5 minutes or greater) and see if it works. 

rhc snapshot restore <appname> -f <local folder tar> --timeout 600

Comment 6 German 2014-10-02 22:15:16 UTC
I have tested right now with timeout 600 but after a long time, same error as before. I suppose I could increase that timeout parameter but I don't know if this is an acceptable solution.

Any other suggestions?

Comment 7 openshift-github-bot 2014-10-20 01:35:40 UTC
Commit pushed to master at https://github.com/openshift/origin-server

https://github.com/openshift/origin-server/commit/b906cc06f105f4895f97859024012e6d400d63c5
Bug 1147946 - Do not snapshot jboss*/standalone/tmp

* Save time and diskspace by not snapshot'ing standalone/tmp.  Content
  will be recreated when cartridge started during restore.

Comment 8 Yan Du 2014-10-21 03:41:24 UTC
Test on devenv_5253

Both non-scaling and scaling apps in old account can be restored successfully to the new apps in new account with different domain.

Move bug to verified.

Comment 9 Yan Du 2014-10-21 05:27:30 UTC
Also test on mac os(ruby-2.0), issue could not be reproduced.


Note You need to log in before you can comment on or make changes to this bug.