# Upgrade failure: Docker Manager bug?

**URL:** <https://meta.discourse.org/t/upgrade-failure-docker-manager-bug/262404>\
**Category:** Bug\
**Created:** [April 20, 2023, 2:11pm UTC](https://meta.discourse.org/t/upgrade-failure-docker-manager-bug/262404 "2023-04-20T14:11:51Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![merefield](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/merefield/32/176214_2.png) [@merefield](https://meta.discourse.org/u/merefield)\
**Post date:** [April 20, 2023, 2:11pm UTC](https://meta.discourse.org/t/upgrade-failure-docker-manager-bug/262404/1 "2023-04-20T14:11:51Z")

</div>

Is there a problem with Docker Manager?

```plaintext
Docker Manager: FAILED TO UPGRADE
#<NoMethodError: undefined method `branch' for #<DockerManager::GitRepo:0x00007f1132b2ce20 @path="/var/www/discourse/plugins/discourse-onebox-assistant", @name="discourse-onebox-assistant", @memoize={"rev-parse HEAD"=>"0bf6e034f9a3ce0d23139417d05d2937132f2eaa", "symbolic-ref -q HEAD"=>"refs/heads/master", "for-each-ref --format='%(upstream:short)' refs/heads/master"=>"origin/master", "rev-parse --is-shallow-repository"=>"false", "show-branch remotes/origin/main"=>nil, "rev-parse origin/master^{}"=>"681fe5f804f444503c64a75e620b81f4f48dd1bf"}, @upgrade_key="upgrade:/var/www/discourse/plugins/discourse-onebox-assistant", @upgrade_version=nil>>
/var/www/discourse/plugins/docker_manager/lib/docker_manager/upgrader.rb:73:in `block in upgrade'
/var/www/discourse/plugins/docker_manager/lib/docker_manager/upgrader.rb:71:in `each'
/var/www/discourse/plugins/docker_manager/lib/docker_manager/upgrader.rb:71:in `each_with_index'
/var/www/discourse/plugins/docker_manager/lib/docker_manager/upgrader.rb:71:in `upgrade'
/var/www/discourse/plugins/docker_manager/scripts/docker_manager_upgrade.rb:19:in `block in <main>'
/var/www/discourse/plugins/docker_manager/scripts/docker_manager_upgrade.rb:6:in `fork'
/var/www/discourse/plugins/docker_manager/scripts/docker_manager_upgrade.rb:6:in `<main>'

```

Am I missing anything or this a bug in docker\_manager?

Could it be related to this commit?:

[https://github.com/discourse/docker\_manager/commit/6293c3d948f027fd48d9141b5c26a08541916b4d#diff-b7cf961a7ca9c83bda8f14283b867bc3f371c2f2e217e03166c6472ecd678504](https://github.com/discourse/docker_manager/commit/6293c3d948f027fd48d9141b5c26a08541916b4d#diff-b7cf961a7ca9c83bda8f14283b867bc3f371c2f2e217e03166c6472ecd678504)

Specifically this change?:

 ![image](https://global.discourse-cdn.com/meta/original/4X/3/7/7/3775360604760ae3f1547e833977e078ea22832d.png)

&

 ![image](https://global.discourse-cdn.com/meta/original/4X/c/f/8/cf8da18d1871b0bbba8455a361f3b8038705a12f.png)

Yet it is still referenced here?:

> <https://github.com/discourse/docker_manager/blob/6293c3d948f027fd48d9141b5c26a08541916b4d/lib/docker_manager/upgrader.rb#L73>

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)\
**Post date:** [April 20, 2023, 2:44pm UTC](https://meta.discourse.org/t/upgrade-failure-docker-manager-bug/262404/2 "2023-04-20T14:44:19Z")

</div>

I had someone last night complain that a UX upgrade had crashed their site. I didn’t see the error. I’m pretty sure it was after the bump to the new base image, so this might explain their problem. It would seem like it would affect only those on beta, though?

---

<div class="post-metadata">

**Author:** ![merefield](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/merefield/32/176214_2.png) [@merefield](https://meta.discourse.org/u/merefield)\
**Post date:** [April 20, 2023, 2:45pm UTC](https://meta.discourse.org/t/upgrade-failure-docker-manager-bug/262404/3 "2023-04-20T14:45:12Z")

</div>

this was a `tests_passed` upgrade.

I’m fairly sure it’s a bug.

---

<div class="post-metadata">

**Author:** ![gerhard](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gerhard/32/119479_2.png) [@gerhard](https://meta.discourse.org/u/gerhard)\
**Post date:** [April 20, 2023, 3:34pm UTC](https://meta.discourse.org/t/upgrade-failure-docker-manager-bug/262404/5 "2023-04-20T15:34:36Z")

</div>

Indeed, it looks like I broke it and didn’t notice because all my repos had a `main` branch. 🤦‍♂️  
I’ll fix it soon.

---

<div class="post-metadata">

**Author:** ![merefield](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/merefield/32/176214_2.png) [@merefield](https://meta.discourse.org/u/merefield)\
**Post date:** [April 20, 2023, 3:35pm UTC](https://meta.discourse.org/t/upgrade-failure-docker-manager-bug/262404/6 "2023-04-20T15:35:24Z")

</div>

Yeah, thanks! Looks like an edge case 🙂

I’m tempted to move the branch now, but might help to test the resolution if I don’t 🤔

---

<div class="post-metadata">

**Author:** ![gerhard](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gerhard/32/119479_2.png) [@gerhard](https://meta.discourse.org/u/gerhard)\
**Post date:** [April 20, 2023, 4:00pm UTC](https://meta.discourse.org/t/upgrade-failure-docker-manager-bug/262404/7 "2023-04-20T16:00:38Z")

</div>

> [@merefield](#):
>
> I’m tempted to move the branch now, but might help to test the resolution if I don’t 🤔

That won’t fix it until docker\_manager is fixed. Give me a couple of minutes to verify my solution and create a PR…

[https://github.com/discourse/docker\_manager/pull/180](https://github.com/discourse/docker_manager/pull/180)

---

<div class="post-metadata">

**Author:** ![gerhard](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gerhard/32/119479_2.png) [@gerhard](https://meta.discourse.org/u/gerhard)\
**Post date:** [April 20, 2023, 4:25pm UTC](https://meta.discourse.org/t/upgrade-failure-docker-manager-bug/262404/8 "2023-04-20T16:25:36Z")

</div>

Thanks for reporting that regression. It’s fixed now.

---

<div class="post-metadata">

**Author:** ![gerhard](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gerhard/32/119479_2.png) [@gerhard](https://meta.discourse.org/u/gerhard)\
**Post date:** [April 20, 2023, 4:25pm UTC](https://meta.discourse.org/t/upgrade-failure-docker-manager-bug/262404/9 "2023-04-20T16:25:42Z")

</div>


