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

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 opened this issue Aug 1, 2023 · 9 comments · Fixed by #2251
Labels
bug Something isn't working server
Milestone

Comments

@slavus
Copy link
Contributor

slavus commented Aug 1, 2023

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).
@slavus slavus added the bug Something isn't working label Aug 1, 2023
@qwerty287
Copy link
Contributor

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

@slavus
Copy link
Contributor Author

slavus commented Aug 1, 2023

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 qwerty287 reopened this Aug 1, 2023
@qwerty287
Copy link
Contributor

Sorry, I did not see that.

@qwerty287
Copy link
Contributor

qwerty287 commented Aug 1, 2023

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
Copy link
Contributor

lafriks commented Aug 2, 2023

I can confirm that it fails also for me same way

@lafriks lafriks added the server label Aug 2, 2023
@qwerty287 qwerty287 added this to the 1.0.1 milestone Aug 2, 2023
@6543
Copy link
Member

6543 commented Aug 3, 2023

:/

@6543 6543 self-assigned this Aug 3, 2023
@6543 6543 modified the milestones: 1.0.1, 1.0.2 Aug 7, 2023
@qwerty287 qwerty287 modified the milestones: 1.0.2, v1.0.3, 1.0.3 Aug 8, 2023
@fcool
Copy link

fcool commented Aug 15, 2023

here too

@6543
Copy link
Member

6543 commented Aug 20, 2023

-> #2251

@6543
Copy link
Member

6543 commented Aug 20, 2023

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

@6543 6543 removed their assignment Aug 20, 2023
qwerty287 added a commit that referenced this issue Aug 21, 2023
close #2079

as we sett the global vars **after** migrations we did never had a
chance to propagate a **true** in WOODPECKER_MIGRATIONS_ALLOW_LONG to
the migrations ...

---------

Co-authored-by: qwerty287 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working server
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants