Docker Image unable to start after update from 10.8.0 to 10.9.7 (OD-1993)
kdop opened 1 year ago

Hi, stopped and removed old image and started new one but it won't boot.

In the mounted volume, file onedev/logs/check-data-version.log there is an error: "ERROR - Database is not populated yet"

Do you know what caused this, and is there a way to recover?

  • Robin Shen commented 1 year ago

    Looks like OneDev can not find the database upon upgrade. Please make sure you are mounting correct volumes.

  • Cody Robinson commented 1 year ago

    Hi, stopped and removed old image and started new one but it won't boot.

    In the mounted volume, file onedev/logs/check-data-version.log there is an error: "ERROR - Database is not populated yet"

    Do you know what caused this, and is there a way to recover?

    To add on, make sure you mounted a volume for the onedev database. If you just started the docker container without doing that, you database will have been lost as containers are not virtual machines, they are mean to be started and stopped without saving data on them.

    If you post your commands or docker-compose file taking out any sensitive information I can assist.

  • kdop commented 1 year ago

    I am deploying via ansible. I am using the same script for months now - I only bumped the version when there is a new release. I moved the persistent folder to a different path and re-run the script. Basically a brand new installation - it started right up. So the location is correct.

    - hosts: main
      vars_files:
        - 'secrets.yml'
        - '../../common_vars.yml'
        - 'vars.yml'
      tasks:
        - name: Remove existing container
          community.general.docker_container:
            name: "{{ ONEDEV_CONTAINER_NAME }}"
            state: absent
    
        - name: Start container
          remote_user: "{{ remote_username_normal }}"
          community.general.docker_container:
            container_default_behavior: no_defaults
            networks_cli_compatible: yes
            name: "{{ ONEDEV_CONTAINER_NAME }}"
            image: "1dev/server:{{ ONEDEV_VERSION }}"
            command: ""
            state: started
            recreate: yes
            detach: yes
            restart_policy: unless-stopped
            env:
              initial_user: "{{ remote_username_normal }}"
              initial_password: "{{ initial_password }}"
              initial_email: "{{ initial_email }}"
              initial_server_url: "https://{{ SERVER_DOMAIN }}"
            volumes:
              - /var/run/docker.sock:/var/run/docker.sock
              - "{{ ONEDEV_PERSISTENT_PATH }}:/opt/onedev"
            network_mode: "host"
    
  • Cody Robinson commented 1 year ago

    For your {{ ONEDEV_PERSISTENT_PATH }}

    Can you do a ls -lah to confirm the database is intact?

  • kdop commented 1 year ago

    Not sure how to check the database for integrity. The files are there. I moved {{ ONEDEV_PERSISTENT_PATH }} to {{ ONEDEV_PERSISTENT_PATH }}_backup and executed the script again. {{ ONEDEV_PERSISTENT_PATH }} is regenerated and onedev starts just fine but of course my projects are missing.

  • Cody Robinson commented 1 year ago

    It seems you are executing the script on the vm/physical server.

    Can you use the official OneDev docker container, mount the directory and backup inside the container and run the restore?

    If you need assistance with the commands, let me know.

  • kdop commented 1 year ago

    I will try to use the restore script and if that doesn't work I will re-create projects from scratch (fortunately just a few). Thanks for the help!

  • Cody Robinson commented 1 year ago

    You're welcome. If you need any more assistance, please update this issue.

  • Cody Robinson changed fields 1 year ago
    Name Previous Value Current Value
    Assignee
    robin
    crobinson
  • Robin Shen commented 1 year ago

    @kdop you may also start onedev with below command to see what happens:

    docker run --name onedev -it -v <onedev data dir>:/opt/onedev -p 6610:6610 1dev/server:10.9.7 
    
  • Robin Shen changed state to 'Closed' 1 year ago
    Previous Value Current Value
    Open
    Closed
  • Robin Shen commented 1 year ago

    Please reopen if there is more info

issue 1/1
Type
Question
Priority
Normal
Assignee
Labels
No labels
Issue Votes (0)
Watchers (2)
Reference
OD-1993
Please wait...
Connection lost or session expired, reload to recover
Page is in error, reload to recover