Is there a problem with Docker Manager?
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?:
  
  
    
  
  
    
    
      
        committed 05:17PM - 19 Apr 23 UTC 
      
      
      
     
   
 
  
    * FEATURE: Adds support for git tags
* Detects when the tracked branch has be… en deleted from `origin` and forces a rebuild on the command line
* Allows updating when a tag is tracked and the tag was moved to a new commit
* Improves support for shallow clones
* Works with partial clones
* Adds lots of specs for git commands and replaces the existing specs. All specs use real git repositories instead of mocks 
   
   
  
    
    
  
  
 
Specifically this change?:
&
Yet it is still referenced here?:
  
  
    
    
      
            Process.kill("TSTP", unicorn_master_pid) 
            sleep 1 
            # older versions do not have support, so quickly send a cont so master process is not hung 
            Process.kill("CONT", unicorn_master_pid) 
          end 
          
           
# HEAD@{upstream} is just a fancy way how to say origin/main (in normal case) 
          # see http://stackoverflow.com/a/12699604/84283 
          @repos.each_with_index do |repo, index| 
            # We automatically handle renames from `master` -> `main` 
            if repo.upstream_branch == "origin/master" && repo.branch == "origin/main" 
              log "Branch has changed to #{repo.branch}" 
          
           
    # Just in case `main` exists locally but is not used. Perhaps it was fetched? 
              if repo.has_local_main? 
                run "cd #{repo.path} && git checkout main" 
              else 
                run "cd #{repo.path} && git branch -m master main" 
              end 
          
           
    run "cd #{repo.path} && git fetch origin --tags --force" 
       
     
   
  
    
    
  
  
 
Thanks in advance!
             
            
               
               
              「いいね!」 1 
            
            
           
          
            
              
                pfaffman  
                (Jay Pfaffman)
               
              
                  
                    2023 年 4 月 20 日午後  2:44
                   
                   
              2 
               
             
            
              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?
             
            
               
               
              「いいね!」 1 
            
            
           
          
            
            
              this was a tests_passed upgrade.
I’m fairly sure it’s a bug.
             
            
               
               
              「いいね!」 3 
            
            
           
          
            
              
                gerhard  
                (Gerhard Schlager)
               
              
                  
                    2023 年 4 月 20 日午後  3:34
                   
                   
              5 
               
             
            
              Indeed, it looks like I broke it and didn’t notice because all my repos had a main branch.  
I’ll fix it soon.
             
            
               
               
              「いいね!」 2 
            
            
           
          
            
            
              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 
             
            
               
               
               
            
            
           
          
            
              
                gerhard  
                (Gerhard Schlager)
               
              
                  
                    2023 年 4 月 20 日午後  4:00
                   
                   
              7 
               
             
            
              
That won’t fix it until docker_manager is fixed. Give me a couple of minutes to verify my solution and create a PR…
  
  
    
    
  
      
    
      discourse:main ← discourse:fix-branch
    
      
        
          opened 04:15PM - 20 Apr 23 UTC 
        
        
        
       
   
 
  
    See https://meta.discourse.org/t/upgrade-failure-docker-manager-bug/262404
   
   
  
    
    
  
  
 
             
            
               
               
              「いいね!」 2 
            
            
           
          
            
              
                gerhard  
                (Gerhard Schlager)
               
              
                  
                    2023 年 4 月 20 日午後  4:25
                   
                   
              8 
               
             
            
              Thanks for reporting that regression. It’s fixed now.
             
            
               
               
              「いいね!」 6