Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

[BUG] Backup restore say "Error while restoring: invalid block type"

Closed
#53 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
48/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Active
Tech stack
docker, java
Domain
backend

Research direction

Start at org.nzbhydra.backup.BackupAndRestore and ExtractZipFileVisitor.java, then reproduce the restore using the reported backup and container setup. Trace the ZIP extraction failure and verify that a backup created by the official amd64-linux binary can be restored successfully in the Docker installation.

Written by the indexing model from the issue text.

Description

Is there an existing issue for this?
  • I have searched the existing issues
Current Behavior
Image
Expected Behavior

No response

Steps To Reproduce
  1. Backup export made from official binary for amd64-linux version (theotherp/nzbhydra2), v9.0.2.
  2. Check the zip with any archive manager.
  3. Try to import it from a fresh install of linuxserver/nzbhydra2
  4. Try again with new backups and restarts of service/systemd and container
Environment
- OS+FS of my install and backup source: CashyOS + btrfs
- OS+FS of my Docker install and restore target: Debian 13 + ext4
- How docker service was installed: standard APT method
CPU architecture

x86-64

Docker creation
nzbhydra:
    image: lscr.io/linuxserver/nzbhydra2
    container_name: nzbhydra
    restart: unless-stopped
    stop_grace_period: 120s
    depends_on: [gluetun]
    network_mode: "service:gluetun"
    security_opt:
      - no-new-privileges:true
    volumes:
      - /opt/containers/nzbhydra/AppData:/config
      - /data/downloads:/downloads
    environment:
      PUID: 1000
      PGID: 1000
    healthcheck:
      test: ["CMD-SHELL", "wget -qO- http://localhost:5076/ >/dev/null"]
      interval: 30s
      timeout: 10s
      retries: 3
Container logs
User UID:    1000
User GID:    1000
───────────────────────────────────────
Linuxserver.io version: v9.0.2-ls105
Build-date: 2026-09-20T12:36:25+00:00
───────────────────────────────────────
    
[custom-init] No custom files found, skipping...
Logging wrapper output to /config/logs/wrapper.log
INFO - Determined release type: native
INFO - Starting NZBHydra main process with command line: ./core -Xmx256M -DfromWrapper=true -DinternalApiKey=nndhpxzwftvkkyuneyka -Dsun.security.pkcs11.enable-solaris=false -Dfile.encoding=UTF8 -Dspring.output.ansi.enabled=ALWAYS --nobrowser --datafolder /config in folder /app/nzbhydra2
17:05:34.715 [main] INFO org.nzbhydra.NzbHydra -- Version: 9.0.2
17:05:34.715 [main] INFO org.nzbhydra.NzbHydra -- Build timestamp: 2026-09-20 06:38
.__   __.  ________  .______   __    __  ____    ____  _______  .______          ___          ___
|  \ |  | |       /  |   _  \ |  |  |  | \   \  /   / |       \ |   _  \        /   \        |__ \
|   \|  | `---/  /   |  |_)  ||  |__|  |  \   \/   /  |  .--.  ||  |_)  |      /  ^  \          ) |
|  . `  |    /  /    |   _  < |   __   |   \_    _/   |  |  |  ||      /      /  /_\  \        / /
|  |\   |   /  /----.|  |_)  ||  |  |  |     |  |     |  '--'  ||  |\  \----./  _____  \      / /_
|__| \__|  /________||______/ |__|  |__|     |__|     |_______/ | _| `._____/__/     \__\    |____|
 INFO --- [              main] org.nzbhydra.NzbHydra                    : Starting AOT-processed NzbHydra using Java 25.0.4.1 with PID 184 (/app/nzbhydra2/core started by abc in /app/nzbhydra2)
 INFO --- [              main] org.nzbhydra.NzbHydra                    : The following 1 profile is active: "default"
 INFO --- [              main] o.s.boot.tomcat.TomcatWebServer          : Tomcat initialized with port 5076 (http)
 INFO --- [              main] b.w.c.s.WebApplicationContextInitializer : Root WebApplicationContext: initialization completed in 71 ms
 INFO --- [              main] org.nzbhydra.config.BaseConfigHandler    : Using data folder /config
 INFO --- [              main] o.n.a.HydraAnonymousAuthenticationFilter : Granting basic user rights to anonymous users
 INFO --- [              main] o.n.a.HydraAnonymousAuthenticationFilter : Granting stats rights to anonymous users
 INFO --- [              main] o.n.a.HydraAnonymousAuthenticationFilter : Granting admin rights to anonymous users
 INFO --- [              main] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Starting...
 INFO --- [              main] com.zaxxer.hikari.pool.HikariPool        : HikariPool-1 - Added connection conn0: url=jdbc:h2:file:/config/database/nzbhydra user=<r>
 INFO --- [              main] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Start completed.
 WARN --- [              main] org.flywaydb.core.FlywayExecutor         : Unable to scan location: /18!/migration (unsupported protocol: resource)
 WARN --- [              main] org.flywaydb.core.FlywayExecutor         : Unable to scan location: /18!/migration (unsupported protocol: resource)
 INFO --- [              main] org.flywaydb.core.FlywayExecutor         : Database: jdbc:h2:file:/config/database/nzbhydra (H2 2.4)
 WARN --- [              main] o.f.c.i.s.classpath.ClassPathScanner     : Unable to scan location: /18!/migration (unsupported protocol: resource)
 WARN --- [              main] o.f.c.i.s.classpath.ClassPathScanner     : Unable to scan location: /18!/migration (unsupported protocol: resource)
 WARN --- [              main] o.f.c.internal.database.base.Database    : Using H2 2.4.240 which is newer than the version Flyway has been verified with. The latest verified version of H2 is 2.3.232.
 INFO --- [              main] o.f.core.internal.command.DbValidate     : Successfully validated 9 migrations (execution time 00:00.040s)
 INFO --- [              main] o.f.core.internal.command.DbMigrate      : Current version of schema "PUBLIC": 9
 INFO --- [              main] o.f.core.internal.command.DbMigrate      : Schema "PUBLIC" is up to date. No migration necessary.
 INFO --- [              main] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default'
 INFO --- [              main] org.nzbhydra.update.UpdateManager        : Running version 9.0.2
 WARN --- [              main] org.nzbhydra.NzbHydra                    : Overwritten settings will be displayed with their original value in the config section of the GUI
 INFO --- [              main] o.s.d.j.r.query.QueryEnhancerFactories   : Hibernate is in classpath; If applicable, HQL parser will be used.
 INFO --- [              main] o.n.d.downloaders.DownloaderProvider     : Loading downloaders
 INFO --- [              main] o.n.d.downloaders.DownloaderProvider     : Finished initializing active downloaders
 INFO --- [              main] o.n.d.downloaders.DownloaderProvider     : No downloaders configured
 INFO --- [              main] o.n.searching.SearchModuleProvider       : Loading indexers
 INFO --- [              main] o.n.searching.SearchModuleProvider       : Finished initializing active indexers
 WARN --- [              main] o.n.searching.SearchModuleProvider       : No indexers configured
 INFO --- [              main] r$InitializeUserDetailsManagerConfigurer : Global AuthenticationManager configured with UserDetailsService bean with name hydraUserDetailsManager
 INFO --- [              main] o.n.auth.HeaderAuthenticationFilter      : Using internal API key
 WARN --- [              main] o.s.w.s.resource.ResourceHandlerUtils    : Appended trailing slash to static resource location: file:/config/additionalStatic/
 WARN --- [              main] i.m.c.i.binder.jvm.JvmGcMetrics          : GC notifications will not be available because no GarbageCollectorMXBean of the JVM provides any. GCs=[young generation scavenger, complete scavenger]
 INFO --- [              main] o.s.b.a.e.web.EndpointLinksResolver      : Exposing 14 endpoints beneath base path '/actuator'
 INFO --- [              main] org.nzbhydra.tasks.HydraTaskScheduler    : Scheduling task "Problem detector" to be run every 1 hour
 INFO --- [              main] org.nzbhydra.tasks.HydraTaskScheduler    : Scheduling task "Check for and install updates" to be run every 1 hour
 INFO --- [              main] org.nzbhydra.tasks.HydraTaskScheduler    : Scheduling task "Delete temporary ZIP files" to be run every 1 hour
 INFO --- [              main] org.nzbhydra.tasks.HydraTaskScheduler    : Scheduling task "Delete short term storage results" to be run every 12 hours
 INFO --- [              main] org.nzbhydra.tasks.HydraTaskScheduler    : Scheduling task "Delete old history entries" to be run every 1 hour
 INFO --- [              main] org.nzbhydra.tasks.HydraTaskScheduler    : Scheduling task "Scheduled restart" to be run every 1 minute
 INFO --- [              main] org.nzbhydra.tasks.HydraTaskScheduler    : Scheduling task "Download queue check" to be run every 10 seconds
 INFO --- [              main] org.nzbhydra.tasks.HydraTaskScheduler    : Scheduling task "Backup" to be run every 1 hour
 INFO --- [              main] org.nzbhydra.tasks.HydraTaskScheduler    : Scheduling task "Clean up indexer statuses" to be run every 1 minute
 INFO --- [              main] org.nzbhydra.tasks.HydraTaskScheduler    : Scheduling task "Download history check" to be run every 10 minutes
 INFO --- [              main] org.nzbhydra.tasks.HydraTaskScheduler    : Scheduling task "Delete old search results" to be run every 1 hour
 INFO --- [              main] o.s.m.s.b.SimpleBrokerMessageHandler     : Starting...
 INFO --- [              main] o.s.m.s.b.SimpleBrokerMessageHandler     : BrokerAvailabilityEvent[available=true, SimpleBrokerMessageHandler [org.springframework.messaging.simp.broker.DefaultSubscriptionRegistry@5bdc9950]]
 INFO --- [              main] o.s.m.s.b.SimpleBrokerMessageHandler     : Started.
 INFO --- [              main] o.s.boot.tomcat.TomcatWebServer          : Tomcat started on port 5076 (http) with context path '/'
 INFO --- [              main] org.nzbhydra.NzbHydra                    : Started NzbHydra in 1.31 seconds (process running for 1.385)
 INFO --- [              main] org.nzbhydra.NzbHydra                    : You seem to be running NZBHydra 2 in docker. You can access Hydra using your local address and the IP you provided
 INFO --- [              main] o.nzbhydra.database.DatabaseStatistics   : H2 database statistics: info.BUILD_ID = 240, info.CACHE_HIT_RATIO = 96, info.CACHE_MAX_SIZE = 16, info.CACHE_SIZE = 0, info.CHUNKS_FILL_RATE = 80, info.CHUNKS_FILL_RATE_RW = 87, info.CHUNK_COUNT = 3, info.CURRENT_VERSION = 7, info.FILE_READ = 45, info.FILE_READ_BYTES = 58944, info.FILE_SIZE = 94208, info.FILE_WRITE = 1, info.FILE_WRITE_BYTES = 8192, info.FILL_RATE = 58, info.LEAF_RATIO = 80, info.OLDEST_VERS_TO_KEEP = 7, info.PAGE_COUNT = 33, info.PAGE_COUNT_LIVE = 23, info.PAGE_SIZE = 16384, info.TOC_CACHE_HIT_RATIO = 0, info.UPDATE_FAILURE_PERCENT = 0.00%, info.VERSION = 2.4.240 (2025-09-22), info.VERSIONS_TO_KEEP = 0, info.VERSION_MAJOR = 2, info.VERSION_MINOR = 4
Connection to localhost (127.0.0.1) 5076 port [tcp/*] succeeded!
[ls.io-init] done.
 INFO --- [http-nio-0.0.0.0-5] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring DispatcherServlet 'dispatcherServlet'
 INFO --- [http-nio-0.0.0.0-5] o.s.web.servlet.DispatcherServlet        : Initializing Servlet 'dispatcherServlet'
 INFO --- [http-nio-0.0.0.0-5] o.s.web.servlet.DispatcherServlet        : Completed initialization in 1 ms
     INFO --- [http-nio-0.0.0.0-5] org.nzbhydra.backup.BackupAndRestore     : [Host: 192.168.1.110] Extracting from file /tmp/nzbhydra-restore11347946211993312084.zip to folder /config/restore
    ERROR --- [http-nio-0.0.0.0-5] org.nzbhydra.backup.BackupAndRestore     : [Host: 192.168.1.110] Error while restoring
    java.util.zip.ZipException: invalid block type
    	at [email protected]/java.util.zip.InflaterInputStream.read(InflaterInputStream.java:214)
    	at [email protected]/java.io.InputStream.transferTo(InputStream.java:795)
    	at [email protected]/java.nio.file.Files.copy(Files.java:2864)
    	at [email protected]/java.nio.file.CopyMoveHelper.copyToForeignTarget(CopyMoveHelper.java:147)
    	at [email protected]/java.nio.file.Files.copy(Files.java:1195)
    	at org.nzbhydra.backup.ExtractZipFileVisitor.visitFile(ExtractZipFileVisitor.java:32)
    	at org.nzbhydra.backup.ExtractZipFileVisitor.visitFile(ExtractZipFileVisitor.java:14)
    	at [email protected]/java.nio.file.Files.walkFileTree(Files.java:2543)
    	at [email protected]/java.nio.file.Files.walkFileTree(Files.java:2609)
    	at org.nzbhydra.backup.BackupAndRestore.extractZip(BackupAndRestore.java:334)
    	at org.nzbhydra.backup.BackupAndRestore.restoreFromFile(BackupAndRestore.java:321)
    	at org.nzbhydra.backup.BackupAndRestore.restoreFromFile(BackupAndRestore.java:298)
    	at org.graalvm.nativeimage.builder/com.oracle.svm.core.reflect.SubstrateMethodAccessor.invoke(SubstrateMethodAccessor.java:118)
    	at org.nzbhydra.backup.BackupAndRestore$$SpringCGLIB$$0.restoreFromFile(<generated>) [3 skipped]
    	at org.nzbhydra.backup.BackupWeb.restoreFromUpload(BackupWeb.java:80)
     INFO --- [http-nio-0.0.0.0-5] org.nzbhydra.backup.BackupAndRestore     : [Host: 192.168.1.110] Extracting from file /tmp/nzbhydra-restore11945049185920457717.zip to folder /config/restore
    ERROR --- [http-nio-0.0.0.0-5] org.nzbhydra.backup.BackupAndRestore     : [Host: 192.168.1.110] Error while restoring
    java.util.zip.ZipException: invalid block type
    	at [email protected]/java.util.zip.InflaterInputStream.read(InflaterInputStream.java:214)
    	at [email protected]/java.io.InputStream.transferTo(InputStream.java:795)
    	at [email protected]/java.nio.file.Files.copy(Files.java:2864)
    	at [email protected]/java.nio.file.CopyMoveHelper.copyToForeignTarget(CopyMoveHelper.java:147)
    	at [email protected]/java.nio.file.Files.copy(Files.java:1195)
    	at org.nzbhydra.backup.ExtractZipFileVisitor.visitFile(ExtractZipFileVisitor.java:32)
    	at org.nzbhydra.backup.ExtractZipFileVisitor.visitFile(ExtractZipFileVisitor.java:14)
    	at [email protected]/java.nio.file.Files.walkFileTree(Files.java:2543)
    	at [email protected]/java.nio.file.Files.walkFileTree(Files.java:2609)
    	at org.nzbhydra.backup.BackupAndRestore.extractZip(BackupAndRestore.java:334)
    	at org.nzbhydra.backup.BackupAndRestore.restoreFromFile(BackupAndRestore.java:321)
    	at org.nzbhydra.backup.BackupAndRestore.restoreFromFile(BackupAndRestore.java:298)
    	at org.graalvm.nativeimage.builder/com.oracle.svm.core.reflect.SubstrateMethodAccessor.invoke(SubstrateMethodAccessor.java:118)
    	at org.nzbhydra.backup.BackupAndRestore$$SpringCGLIB$$0.restoreFromFile(<generated>) [3 skipped]
    	at org.nzbhydra.backup.BackupWeb.restoreFromUpload(BackupWeb.java:80)
     INFO --- [http-nio-0.0.0.0-5] o.n.d.downloaders.sabnzbd.Sabnzbd        : [Host: 192.168.1.110] Connection check with sabNZBd using URL http://127.0.0.1:5086/api?apikey=<apikey>&output=json&mode=queue successful
     INFO --- [http-nio-0.0.0.0-5] org.nzbhydra.config.ConfigWeb            : [Host: 192.168.1.110] Received new config
     WARN --- [http-nio-0.0.0.0-5] o.n.c.validation.BaseConfigValidator     : [Host: 192.168.1.110] Config validation returned warnings:
    No indexers configured. You won't get any results
     INFO --- [http-nio-0.0.0.0-5] o.n.a.HydraAnonymousAuthenticationFilter : [Host: 192.168.1.110] Granting basic user rights to anonymous users
     INFO --- [http-nio-0.0.0.0-5] o.n.a.HydraAnonymousAuthenticationFilter : [Host: 192.168.1.110] Granting stats rights to anonymous users
     INFO --- [http-nio-0.0.0.0-5] o.n.a.HydraAnonymousAuthenticationFilter : [Host: 192.168.1.110] Granting admin rights to anonymous users
     INFO --- [http-nio-0.0.0.0-5] o.n.d.downloaders.DownloaderProvider     : [Host: 192.168.1.110] Loading downloaders
     INFO --- [http-nio-0.0.0.0-5] o.n.d.downloaders.DownloaderProvider     : [Host: 192.168.1.110] Initializing downloader SABnzbd
     INFO --- [http-nio-0.0.0.0-5] o.n.d.downloaders.DownloaderProvider     : [Host: 192.168.1.110] Finished initializing active downloaders
     INFO --- [http-nio-0.0.0.0-5] o.n.searching.SearchModuleProvider       : [Host: 192.168.1.110] Loading indexers
     INFO --- [http-nio-0.0.0.0-5] o.n.searching.SearchModuleProvider       : [Host: 192.168.1.110] Finished initializing active indexers
     WARN --- [http-nio-0.0.0.0-5] o.n.searching.SearchModuleProvider       : [Host: 192.168.1.110] No indexers configured
Dominant language
Dockerfile
Stars
89
Forks
15
PR merge metrics
No merged PRs in 30d

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from linuxserver/docker-nzbhydra2

All issues in linuxserver/docker-nzbhydra2

Similar issues

More Backend & API Design issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.