<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/gitlab/gitlab-ce.git/lib/backup, branch trigger-hooks</title>
<subtitle>gitlab.com: gitlab-org/gitlab-ce.git
</subtitle>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gitlab/gitlab-ce.git/'/>
<entry>
<title>Merge branch 'master' of github.com:gitlabhq/gitlabhq</title>
<updated>2015-08-03T09:04:04+00:00</updated>
<author>
<name>Dmitriy Zaporozhets</name>
<email>dmitriy.zaporozhets@gmail.com</email>
</author>
<published>2015-08-03T09:04:04+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gitlab/gitlab-ce.git/commit/?id=b118f648cb393d9ef4e1e510e86b72cb3e8c98f3'/>
<id>b118f648cb393d9ef4e1e510e86b72cb3e8c98f3</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Stricter mkdir's in 'rake gitlab:backup:create'</title>
<updated>2015-07-30T08:17:34+00:00</updated>
<author>
<name>Jacob Vosmaer</name>
<email>contact@jacobvosmaer.nl</email>
</author>
<published>2015-07-30T08:17:34+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gitlab/gitlab-ce.git/commit/?id=baa157926d432f404a41c31ad6514ff8d5366269'/>
<id>baa157926d432f404a41c31ad6514ff8d5366269</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Set internal backup directory modes on create</title>
<updated>2015-07-29T09:18:55+00:00</updated>
<author>
<name>Jacob Vosmaer</name>
<email>contact@jacobvosmaer.nl</email>
</author>
<published>2015-07-29T09:18:55+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gitlab/gitlab-ce.git/commit/?id=c5aae3077335ab0eaafb73f51548d4c85413a1d1'/>
<id>c5aae3077335ab0eaafb73f51548d4c85413a1d1</id>
<content type='text'>
This sidesteps problems with running 'chmod' on some CIFS mounts.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This sidesteps problems with running 'chmod' on some CIFS mounts.
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge branch 'master' of dev.gitlab.org:gitlab/gitlabhq into backup-archive-permissions</title>
<updated>2015-07-27T09:22:35+00:00</updated>
<author>
<name>Jacob Vosmaer</name>
<email>contact@jacobvosmaer.nl</email>
</author>
<published>2015-07-27T09:22:35+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gitlab/gitlab-ce.git/commit/?id=0be6debb0b3350f35bf4b6a904c60da826314b3b'/>
<id>0be6debb0b3350f35bf4b6a904c60da826314b3b</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Don't stop if database.sql.gz already exists</title>
<updated>2015-07-21T08:37:27+00:00</updated>
<author>
<name>Jacob Vosmaer</name>
<email>contact@jacobvosmaer.nl</email>
</author>
<published>2015-07-21T08:37:27+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gitlab/gitlab-ce.git/commit/?id=346b07497989c824b201e501dfa24b8af630da8a'/>
<id>346b07497989c824b201e501dfa24b8af630da8a</id>
<content type='text'>
The existing behavior of the backups is to overwrite whatever data
was still there in the scratch directories. This broke when we added
a 'gzip' step because 'gzip database.sql' will fail if 'database.sql.gz'
already exists. Doing 'rm -f database.sql.gz' before the 'gzip'
avoids this failure.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The existing behavior of the backups is to overwrite whatever data
was still there in the scratch directories. This broke when we added
a 'gzip' step because 'gzip database.sql' will fail if 'database.sql.gz'
already exists. Doing 'rm -f database.sql.gz' before the 'gzip'
avoids this failure.
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge branch 'improve-postgres-restore-cleaning' into 'master'</title>
<updated>2015-07-07T23:02:48+00:00</updated>
<author>
<name>Dmitriy Zaporozhets</name>
<email>dzaporozhets@gitlab.com</email>
</author>
<published>2015-07-07T23:02:48+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gitlab/gitlab-ce.git/commit/?id=b9452d7bcd76f519f391595559531cf893960ab6'/>
<id>b9452d7bcd76f519f391595559531cf893960ab6</id>
<content type='text'>

Use native Postgres database cleaning during backup restore

We were using hacks to drop tables etc during a Postgres backup
restore. With this change, we let pg_dump insert the DROP TABLE
statements it needs at the start of the SQL dump.

See merge request !1891</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>

Use native Postgres database cleaning during backup restore

We were using hacks to drop tables etc during a Postgres backup
restore. With this change, we let pg_dump insert the DROP TABLE
statements it needs at the start of the SQL dump.

See merge request !1891</pre>
</div>
</content>
</entry>
<entry>
<title>Use native Postgres database cleaning during backup restore</title>
<updated>2015-07-07T13:34:06+00:00</updated>
<author>
<name>Jacob Vosmaer</name>
<email>contact@jacobvosmaer.nl</email>
</author>
<published>2015-07-07T13:34:06+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gitlab/gitlab-ce.git/commit/?id=90ab5a59bb28053c9da768679b8036caa7885e95'/>
<id>90ab5a59bb28053c9da768679b8036caa7885e95</id>
<content type='text'>
We were using hacks to drop tables etc during a Postgres backup
restore. With this change, we let pg_dump insert the DROP TABLE
statements it needs at the start of the SQL dump.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We were using hacks to drop tables etc during a Postgres backup
restore. With this change, we let pg_dump insert the DROP TABLE
statements it needs at the start of the SQL dump.
</pre>
</div>
</content>
</entry>
<entry>
<title>Allow custom backup archive permissions</title>
<updated>2015-07-06T16:43:17+00:00</updated>
<author>
<name>Jacob Vosmaer</name>
<email>contact@jacobvosmaer.nl</email>
</author>
<published>2015-07-06T16:43:17+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gitlab/gitlab-ce.git/commit/?id=bb50b7fcd0161a7b9f0f87cb395e355a87a9dd17'/>
<id>bb50b7fcd0161a7b9f0f87cb395e355a87a9dd17</id>
<content type='text'>
This change helps system administrators who want to replicate
GitLab backup files without needing root permissions.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This change helps system administrators who want to replicate
GitLab backup files without needing root permissions.
</pre>
</div>
</content>
</entry>
<entry>
<title>Compress database backup</title>
<updated>2015-07-06T15:14:17+00:00</updated>
<author>
<name>Kamil Trzcinski</name>
<email>ayufan@ayufan.eu</email>
</author>
<published>2015-06-23T13:45:24+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gitlab/gitlab-ce.git/commit/?id=69c659ebd3387ec331a30d6bf53d989803f7276f'/>
<id>69c659ebd3387ec331a30d6bf53d989803f7276f</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge branch 'restore_uploads_fix' into 'master'</title>
<updated>2015-06-22T09:52:42+00:00</updated>
<author>
<name>Dmitriy Zaporozhets</name>
<email>dmitriy.zaporozhets@gmail.com</email>
</author>
<published>2015-06-22T09:52:42+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gitlab/gitlab-ce.git/commit/?id=0214a21db515caba029bca2c2f431840bdfee895'/>
<id>0214a21db515caba029bca2c2f431840bdfee895</id>
<content type='text'>
Avoid "cannot copy directory ... to itself" error on restore (on Docker?)

rake gitlab:backup:restore fails for me in my Docker-hosted Gitlab-CE instance; during the restore, any existing "uploads" directory is backed up by [this code](https://gitlab.com/gitlab-org/gitlab-ce/blob/833bc30/lib/backup/uploads.rb#L23) --

```ruby
    def backup_existing_uploads_dir
      timestamped_uploads_path = File.join(app_uploads_dir, '..', "uploads.#{Time.now.to_i}")
      if File.exists?(app_uploads_dir)
        FileUtils.mv(app_uploads_dir, timestamped_uploads_path)
      end
    end
```

When this executes for me, the ```FileUtils.mv``` parameters are "/home/git/gitlab/public/uploads" and "/home/git/gitlab/public/uploads/../uploads.1407019546"; an exception is raised, producing this double stacktrace:

```
ArgumentError: cannot copy directory /home/git/gitlab/public/uploads to itself /home/git/gitlab/public/uploads/../uploads.1407019546
/home/git/gitlab/lib/backup/uploads.rb:26:in `backup_existing_uploads_dir'
/home/git/gitlab/lib/backup/uploads.rb:18:in `restore'
/home/git/gitlab/lib/tasks/gitlab/backup.rake:73:in `block (4 levels) in &lt;top (required)&gt;'
/home/git/gitlab/lib/tasks/gitlab/backup.rake:30:in `block (3 levels) in &lt;top (required)&gt;'
Errno::EXDEV: Invalid cross-device link @ sys_fail2 - (/home/git/gitlab/public/uploads, /home/git/gitlab/public/uploads/../uploads.1407019546)
/home/git/gitlab/lib/backup/uploads.rb:26:in `backup_existing_uploads_dir'
/home/git/gitlab/lib/backup/uploads.rb:18:in `restore'
/home/git/gitlab/lib/tasks/gitlab/backup.rake:73:in `block (4 levels) in &lt;top (required)&gt;'
/home/git/gitlab/lib/tasks/gitlab/backup.rake:30:in `block (3 levels) in &lt;top (required)&gt;'
Tasks: TOP =&gt; gitlab:backup:uploads:restore
(See full trace by running task with --trace)
```

I'm guessing from the first message that ```mv``` walks the destination path to ensure that we're not moving the source into itself -- it doesn't get as far as interpreting the '..', but throws when it sees that the destination appears to start with the source path.

The second stacktrace I have no clue about - maybe it's AUFS- or Docker-related?

I attempted to reproduce this separately with the omnibus distribution in a fresh Ubuntu 14.04 install without Docker involved, and was unable to - backup and restore worked fine. I then tested my theory by FileUtils.expand_path-ing the destination in my own Docker setup code, and that made the problem go away, so that's what this merge request does.

(I'm using backups created and restored on gitlab-ce 7-1-stable, at facfec4b2; this is on Ubuntu 14.04 with Docker 1.1.1)

I know I'd look askance at a PR without tests for an unreproducable problem, but even if this is rejected, I'm submitting it anyway because maybe someone else will Google it and find it useful. I'm happy to do more work to improve this if you have suggestions.

See merge request !165
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Avoid "cannot copy directory ... to itself" error on restore (on Docker?)

rake gitlab:backup:restore fails for me in my Docker-hosted Gitlab-CE instance; during the restore, any existing "uploads" directory is backed up by [this code](https://gitlab.com/gitlab-org/gitlab-ce/blob/833bc30/lib/backup/uploads.rb#L23) --

```ruby
    def backup_existing_uploads_dir
      timestamped_uploads_path = File.join(app_uploads_dir, '..', "uploads.#{Time.now.to_i}")
      if File.exists?(app_uploads_dir)
        FileUtils.mv(app_uploads_dir, timestamped_uploads_path)
      end
    end
```

When this executes for me, the ```FileUtils.mv``` parameters are "/home/git/gitlab/public/uploads" and "/home/git/gitlab/public/uploads/../uploads.1407019546"; an exception is raised, producing this double stacktrace:

```
ArgumentError: cannot copy directory /home/git/gitlab/public/uploads to itself /home/git/gitlab/public/uploads/../uploads.1407019546
/home/git/gitlab/lib/backup/uploads.rb:26:in `backup_existing_uploads_dir'
/home/git/gitlab/lib/backup/uploads.rb:18:in `restore'
/home/git/gitlab/lib/tasks/gitlab/backup.rake:73:in `block (4 levels) in &lt;top (required)&gt;'
/home/git/gitlab/lib/tasks/gitlab/backup.rake:30:in `block (3 levels) in &lt;top (required)&gt;'
Errno::EXDEV: Invalid cross-device link @ sys_fail2 - (/home/git/gitlab/public/uploads, /home/git/gitlab/public/uploads/../uploads.1407019546)
/home/git/gitlab/lib/backup/uploads.rb:26:in `backup_existing_uploads_dir'
/home/git/gitlab/lib/backup/uploads.rb:18:in `restore'
/home/git/gitlab/lib/tasks/gitlab/backup.rake:73:in `block (4 levels) in &lt;top (required)&gt;'
/home/git/gitlab/lib/tasks/gitlab/backup.rake:30:in `block (3 levels) in &lt;top (required)&gt;'
Tasks: TOP =&gt; gitlab:backup:uploads:restore
(See full trace by running task with --trace)
```

I'm guessing from the first message that ```mv``` walks the destination path to ensure that we're not moving the source into itself -- it doesn't get as far as interpreting the '..', but throws when it sees that the destination appears to start with the source path.

The second stacktrace I have no clue about - maybe it's AUFS- or Docker-related?

I attempted to reproduce this separately with the omnibus distribution in a fresh Ubuntu 14.04 install without Docker involved, and was unable to - backup and restore worked fine. I then tested my theory by FileUtils.expand_path-ing the destination in my own Docker setup code, and that made the problem go away, so that's what this merge request does.

(I'm using backups created and restored on gitlab-ce 7-1-stable, at facfec4b2; this is on Ubuntu 14.04 with Docker 1.1.1)

I know I'd look askance at a PR without tests for an unreproducable problem, but even if this is rejected, I'm submitting it anyway because maybe someone else will Google it and find it useful. I'm happy to do more work to improve this if you have suggestions.

See merge request !165
</pre>
</div>
</content>
</entry>
</feed>
