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

Having some trouble updating #149

Closed
ovizii opened this issue Jun 30, 2017 · 17 comments

Comments

Projects
None yet
2 participants
@ovizii
Copy link

commented Jun 30, 2017

I followed the instructions given here: https://github.com/mattermost/mattermost-docker

docker-compose down
git pull
docker-compose build
docker-compose up -d

and got an error at the git pull part:

git pull
Your configuration specifies to merge with the ref 'refs/heads/team-and-enterprise'
from the remote, but no such ref was fetched.

I am running:

Mattermost Enterprise Edition

Modern communication from behind your firewall.

Version: 3.6.0 (3.6.2)
Database: postgres

@pichouk

This comment has been minimized.

Copy link
Collaborator

commented Jul 1, 2017

It seems that your local Git repository is on team-and-enterprise branch but it doesn't exists anymore.
I think you should use master branch :

git checkout master
@ovizii

This comment has been minimized.

Copy link
Author

commented Jul 1, 2017

I don't have much experience with git, I just remember following the instructions for how to install 3.6 back in the days. Does the command you gave above delete anything i.e. my dockerfile or the data?

@pichouk

This comment has been minimized.

Copy link
Collaborator

commented Jul 1, 2017

The command will set your local repository on the master branch, than you will be able to git pull to get the new code from Github. It should not delete your data (which is, I guess, in a volumes/ folder) but it will modify the Dockerfile to the new version.

If you're really not confident, you could provide the result of the git status command to see how is your local repository currently.

@ovizii

This comment has been minimized.

Copy link
Author

commented Jul 3, 2017

Well here it is:

root@internal-docker:/mnt/mattermost-docker# git status
On branch team-and-enterprise
Your branch is up-to-date with 'origin/team-and-enterprise'.
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

        modified:   docker-compose.yml

Untracked files:
  (use "git add <file>..." to include in what will be committed)

        volumes/

no changes added to commit (use "git add" and/or "git commit -a")
root@internal-docker:/mnt/mattermost-docker#

I can backup the files of course, do the command you suggested then adapt my docker file again? Am I the first one to upgrade from this team-and-enterprise version? (couldn't find anyone else with this issue)

@pichouk

This comment has been minimized.

Copy link
Collaborator

commented Jul 3, 2017

The team-and-entreprise seems to be an old branch, not existing anymore on this repository.

I suggest the following workaround :

cp docker-compose.yml /tmp/docker-compose.yml.save # Backup docker compose file
git stash # Stash changes
git checkout master # Checkout master branch
git pull origin master # Update master branch from repository
git stash pop # Unstash changes

At the last step, it is possible that you get an issue if you made a lot of modifications on your docker-compose.yml, that's why I suggest to backup it at the beginning. If you get any problem, you will just have to get your file back like this : cp /tmp/ocker-xompose.yml.save docker-compose.yml.

@ovizii

This comment has been minimized.

Copy link
Author

commented Jul 4, 2017

Thanks for your help, I'll give that a try this weekend and will update this thread.

@pichouk

This comment has been minimized.

Copy link
Collaborator

commented Jul 15, 2017

@ovizii Did you succeed in updating your git repository ? :)

@ovizii

This comment has been minimized.

Copy link
Author

commented Jul 16, 2017

sorry, I got side tracked so seeing your follow-up I just tried and followed your directives:

git stash
Saved working directory and index state WIP on team-and-enterprise: c59ac91 Export vars to fix the postgres container error
HEAD is now at c59ac91 Export vars to fix the postgres container error
 checkout master
Branch master set up to track remote branch master from origin.
Switched to a new branch 'master'
git pull origin master
remote: Counting objects: 5, done.
remote: Compressing objects: 100% (2/2), done.
remote: Total 5 (delta 3), reused 5 (delta 3), pack-reused 0
Unpacking objects: 100% (5/5), done.
From https://github.com/mattermost/mattermost-docker
 * branch            master     -> FETCH_HEAD
   7590cef..c9a33c7  master     -> origin/master
Updating 7590cef..c9a33c7
Fast-forward
 app/docker-entry.sh | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)
git stash pop
Auto-merging docker-compose.yml
CONFLICT (content): Merge conflict in docker-compose.yml

docker-compose build
ERROR: yaml.scanner.ScannerError: mapping values are not allowed here
  in "./docker-compose.yml", line 2, column 8

getting this error with the new docker-compose.yml file so I have no placed my old docker-compose.yml file back and attempted docker-compose build + docker-compose up -d

but docker-compose build fails:

...
mattermost/webapp/dist/5.2429f4590e5ccd71db19.js.map
  3 48.2M    3 1652k    0     0   5072      0  2:46:06  0:05:33  2:40:33     0
curl: (56) SSL read: error:00000000:lib(0):func(0):reason(0), errno 104

gzip: stdin: unexpected end of file
tar: Unexpected EOF in archive
tar: Unexpected EOF in archive
tar: Error is not recoverable: exiting now
ERROR: Service 'app' failed to build: The command '/bin/sh -c mkdir -p /mattermost/data     && curl https://releases.mattermost.com/$MM_VERSION/mattermost-team-$MM_VERSION-linux-amd64.tar.gz | tar -xvz     && cp /mattermost/config/config.json /config.json.save     && rm -rf /mattermost/config/config.json' returned a non-zero code: 2

what do I do now? Luckily docker-compose up -d manages to bring it up again, with the old version I was using before.

@pichouk

This comment has been minimized.

Copy link
Collaborator

commented Jul 16, 2017

You have some merge-conflict on your docker-compose.yml file.
You have 2 options :

  • solve the merge conflict : should open your docker-compose.yml to fix it
  • use a new clean file and customize it with your volumes and passwords

If you have trouble, you could dump your file content here but BE CAREFUL it may contain some sensitive data (username/password) that you should obfuscate first.

@pichouk

This comment has been minimized.

Copy link
Collaborator

commented Aug 4, 2017

Hi @ovizii, did you manage to made it work ?

@ovizii

This comment has been minimized.

Copy link
Author

commented Aug 4, 2017

thanks for checking in, its scheduled for this afternoon, it only became a priority now as some mobile clients demanded a newer server version :-)
will update this thread in a few hours.

@ovizii

This comment has been minimized.

Copy link
Author

commented Aug 4, 2017

oh, if you want to have a look, here is my "old" docker-compose file, there is absolutely nothing secret in there.

db:
  build: db
  restart: always
  volumes:
    - ./volumes/db/var/lib/postgresql/data:/var/lib/postgresql/data
    - /etc/localtime:/etc/localtime:ro
  # uncomment the following to enable backup
  #environment:
  #  - AWS_ACCESS_KEY_ID=XXXX
  #  - AWS_SECRET_ACCESS_KEY=XXXX
  #  - WALE_S3_PREFIX=s3://BUCKET_NAME/PATH
  #  - AWS_REGION=us-east-1
app:
  build: app
  links:
    - db:db
  restart: always
  volumes:
    - ./volumes/app/mattermost/config:/mattermost/config:rw
    - ./volumes/app/mattermost/data:/mattermost/data:rw
    - /etc/localtime:/etc/localtime:ro
web:
  build: web
  ports:
    - "180:80"
    - "1443:443"
  links:
    - app:app
  restart: always
  volumes:
      # This directory must have cert files
    - ./volumes/web/cert:/cert:ro
    - /etc/localtime:/etc/localtime:ro
  environment:
    - MATTERMOST_ENABLE_SSL=false
    - PLATFORM_PORT_80_TCP_PORT=80
@pichouk

This comment has been minimized.

Copy link
Collaborator

commented Aug 4, 2017

First, I think there is a merge conflict you should solve on the current docker-compose.yml. I think the file contain some <<<<<<< HEAD and ======= created by Git when you tried to stash pop. When solved, I think it will work.

@ovizii

This comment has been minimized.

Copy link
Author

commented Aug 4, 2017

you are right, the new file started like this:

<<<<<<< Updated upstream
version: "2"

services:

  db:

so basically, I just remove the first line, then continue with your instructions. Will update in a few minutes.

@ovizii

This comment has been minimized.

Copy link
Author

commented Aug 4, 2017

After replacing docker-compose.yml with the version which caused the error I tried following your instructions:

I suggest the following workaround :

cp docker-compose.yml /tmp/docker-compose.yml.save # Backup docker compose file
git stash # Stash changes
git checkout master # Checkout master branch
git pull origin master # Update master branch from repository
git stash pop # Unstash changes

git stash
docker-compose.yml: needs merge
docker-compose.yml: needs merge
docker-compose.yml: unmerged (0802ba58865bde0ab352073c1c850bac5ecd23ce)
docker-compose.yml: unmerged (e037ad1482bf023a722b22b09586f9c54799e69a)
docker-compose.yml: unmerged (1f143e3ece4259f2544172cc96669c7ca59c82a2)
fatal: git-write-tree: error building trees
Cannot save the current index state

git checkout master
docker-compose.yml: needs merge
error: you need to resolve your current index first

really not sure where to go from here - I am unfamiliar with git and the likes, getting the container started in the first place was very easy but this update is getting weirder and weirder.

@pichouk

This comment has been minimized.

Copy link
Collaborator

commented Aug 4, 2017

Ok, it's quite difficult to sort out this issue without having the hand on your Git repository. Git is great but you can, sometimes, be in a tricky situation...

My advice is to start from a fresh setup :

  • clone the current git repository in another repository
  • edit the new docker-compose.yml file to add your custom data (database credentials, using Team edition if need)
  • copy your "old" volumes to the new folder (something like sudo cp -p -r /old/repository/volumes /new/repository/)
  • then run docker-compose up

If everything works, you could, then, remove your old directory.
Use the README.md file to reconfigure your docker-compose.yml file correctly.

@ovizii

This comment has been minimized.

Copy link
Author

commented Aug 4, 2017

Thanks. I'll give this information to one of my colleagues from the development department if he can't sort it out I'll just start fresh.

@ovizii ovizii closed this Aug 4, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.