woodpecker-ci / woodpecker

Woodpecker is a simple, yet powerful CI/CD engine with great extensibility.
https://woodpecker-ci.org
Apache License 2.0
4.2k stars 364 forks source link

After migration from 0.15.11 getting error "error":"Migrating logs to log_entries is skipped, as we have 49180 entries to convert on app start #2079

Closed slavus closed 1 year ago

slavus commented 1 year ago

Component

server

Describe the bug

After migration form 0.15.11 After migration from 0.15.11 during start of server, we get this error:

wodpecker-server_1  | {"time":"2023-08-01T07:07:19Z","message":"LogLevel = info"}
woodpecker-server_1  | {"level":"error","error":"Migrating logs to log_entries is skipped, as we have 49180 entries to convert. Set 'WOODPECKER_MIGRATIONS_ALLOW_LONG' to 'true' to migrate anyway","time":"2023-08-01T07:07:19Z","message":"migration task 'migrate-logs-to-log_entries' failed but is not required"}
woodpecker-server_1  | {"level":"info","time":"2023-08-01T07:07:19Z","message":"Starting Woodpecker server with version '1.0.0'"}

Setting WOODPECKER_MIGRATIONS_ALLOW_LONG to true does nothing.

System Info

{"source":"https://github.com/woodpecker-ci/woodpecker","version":"1.0.0"}

version: '3'

services:
  woodpeckerdb:
    image: postgres:14.5-alpine
    restart: always
    environment:
      POSTGRES_DB: xxxxx
      POSTGRES_USER: xxx
      POSTGRES_PASSWORD: xxx
      TZ: Europe/Zagreb
    volumes:
      - ./_data/db/postgres:/var/lib/postgresql/data

  woodpecker-server:
    #image: woodpeckerci/woodpecker-server:v0.15.11-alpine
    image: woodpeckerci/woodpecker-server:v1.0.0-alpine
    restart: always
    depends_on:
        - woodpeckerdb
    volumes:
      - ./_data/woodpecker:/var/lib/woodpecker
    environment:
      - WOODPECKER_OPEN=true
       - WOODPECKER_OPEN=true
      - WOODPECKER_HOST=https://ci.domain.local
      - WOODPECKER_AGENT_SECRET=xxxx
      - WOODPECKER_GITEA=true
      - WOODPECKER_GITEA_URL=https://gitea.domain.local
      - WOODPECKER_GITEA_CLIENT=085e34c6-a362-42d2-9344-d4ab5f556bb4
      - WOODPECKER_GITEA_SECRET=gto_53npywpjlwwp4planwetxa2ixqbjloh4rq37sl6dfwqqzlej547q
      - WOODPECKER_AUTHENTICATE_PUBLIC_REPOS=true
      - WOODPECKER_BACKEND_DOCKER_NETWORK=fronted_network
      - WOODPECKER_DATABASE_DRIVER=postgres
      - WOODPECKER_DATABASE_DATASOURCE=postgres://woodpecker:woodpecker@woodpeckerdb:5432/woodpeckerdb?sslmode=disable
      - WOODPECKER_MIGRATIONS_ALLOW_LONG=true


### Additional context

_No response_

### Validations

- [X] Read the [Contributing Guidelines](https://github.com/woodpecker-ci/woodpecker/blob/main/CONTRIBUTING.md).
- [X] Read the [docs](https://woodpecker-ci.org/docs/intro).
- [X] Check that there isn't [already an issue](https://github.com/woodpecker-ci/woodpecker/issues) that reports the same bug to avoid creating a duplicate.
- [X] Checked that the bug isn't fixed in the `next` version already [https://woodpecker-ci.org/faq#which-version-of-woodpecker-should-i-use]
- [X] Check that this is a concrete bug. For Q&A join our [Discord Chat Server](https://discord.gg/fcMQqSMXJy) or the [Matrix room](https://matrix.to/#/#woodpecker:matrix.org).
qwerty287 commented 1 year ago

This is pretty clear. Please read the error message before opening an issue.

slavus commented 1 year ago

Hi it is not clear? I have set WOODPECKER_MIGRATIONS_ALLOW_LONG=true. but migrations fails with no explanation it says 'migrate-logs-to-log_entries' failed but is not required" But I would not like to have this error msg for the future.

qwerty287 commented 1 year ago

Sorry, I did not see that.

qwerty287 commented 1 year ago

In theory, you can also ignore the error if you don't need the old pipeline logs. I'd need to take a look at it again to see why it fails.

lafriks commented 1 year ago

I can confirm that it fails also for me same way

6543 commented 1 year ago

:/

fcool commented 1 year ago

here too

6543 commented 1 year ago

-> #2251

6543 commented 1 year ago

well you might want to run https://codeberg.org/6543/woodpecker_logs_migrator next to your woodpecker instance instead

so you dont have to have downtime at all