question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ZipFile invalid LOC header

See original GitHub issue

Hi there!

Starting to get random 500 errors in keycloak backend caused by ZIP (jar?) file with such stack trace. We are copying our build .jar output to src/keycloak/theme which is copying by gitlab ci to .keycloakconf/theme folder on node and being picked-up by keycloak engine in providers folder, e.g in our docker compose:

volumes:
      - ./.keycloakconf/theme/:/opt/keycloak/providers/:rw

It keeps occur more frequent, so this is will be disaster on production. Any thoughts on these?

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
hookenfulcommented, Aug 31, 2022

Original problem I think was caused by someone’s rebasing in repository when there was theme in recent commits. So additional stage with build was the solution.

0reactions
hookenfulcommented, Aug 31, 2022

Hey @garronej ,

I dunno if is this still relevant, I have written a stage for gitlab ci to build theme. REACT_APP_STAGE is our trigger env to let our app build only in keycloak mode, because we have it in same package with main app.

build-keycloak-theme:
  stage: build-theme
  tags:
    - docker
  rules:
    - if: $CI_COMMIT_REF_NAME =~ /release/
    - if: $CI_COMMIT_BRANCH == "devserver"
  before_script:
    - apk add --update npm yarn curl maven
    - unset CI
    - export REACT_APP_STAGE=keycloak
    - cd src/web
  script:
    - yarn install --immutable
    - yarn build
    - npx build-keycloak-theme
    - mkdir $CI_PROJECT_DIR/src/keycloak/theme
    - cp -r $(pwd)/build_keycloak/target/*.jar $CI_PROJECT_DIR/src/keycloak/theme
    - ls -la $CI_PROJECT_DIR/src/keycloak/theme
  artifacts:
    paths:
      - src/keycloak/theme/*.jar
Read more comments on GitHub >

github_iconTop Results From Across the Web

Deploying Maven project throws java.util.zip.ZipException
This answer is not for DevOps/ system admin guys, but for them who are using IDE like eclipse and facing invalid LOC header...
Read more >
Handling Maven Invalid LOC Header Error - Baeldung
Sometimes when a jar in our local Maven repo is corrupt, we'll see the error: Invalid LOC Header. In this tutorial, we're going...
Read more >
Lots of ZipFile invalid LOC header (bad signature) in the logs
Lots of ZipFile invalid LOC header (bad signature) in the logs ... Apparently this happens when Java accesses a JAR file on disk,...
Read more >
ZipException – “invalid LOC header” - Shirish Ranjit
If you get following error, that means your local maven repository is corrupted. Delete your repository and rebuild your application. Error looks like...
Read more >
Deploying Maven project throws java util zip ZipException ...
ZipException: invalid LOC header (bad signature) at java.util.zip.ZipFile.read(Native Method) at java.util.zip.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found