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

Ensure v6 imports CNAME records when reading v5 archives #2057

Merged
merged 4 commits into from
Sep 12, 2024

Conversation

DL6ER
Copy link
Member

@DL6ER DL6ER commented Sep 9, 2024

What does this implement/fix?

Add missing import instruction for CNAME records file (if present in the archive)

Related issue or feature (if applicable): pi-hole/web#2964

Pull request in docs with documentation (if applicable): N/A


By submitting this pull request, I confirm the following:

  1. I have read and understood the contributors guide, as well as this entire template. I understand which branch to base my commits and Pull Requests against.
  2. I have commented my proposed changes within the code.
  3. I am willing to help maintain this change if there are issues with it later.
  4. It is compatible with the EUPL 1.2 license
  5. I have squashed any insignificant commits. (git rebase)

Checklist:

  • The code change is tested and works locally.
  • I based my code and PRs against the repositories developmental branch.
  • I signed off all commits. Pi-hole enforces the DCO for all contributions
  • I signed all my commits. Pi-hole requires signatures to verify authorship
  • I have read the above and my PR is ready for review.

@yubiuser
Copy link
Member

Could you please rebase on latest development?

@DL6ER DL6ER force-pushed the fix/teleporter_v5_cnames branch from 1361337 to 4887619 Compare September 11, 2024 18:21
@DL6ER
Copy link
Member Author

DL6ER commented Sep 11, 2024

Done

@yubiuser
Copy link
Member

You pushed away the changes made to the file path...

@DL6ER DL6ER force-pushed the fix/teleporter_v5_cnames branch from 4887619 to 35be58e Compare September 11, 2024 19:22
@DL6ER DL6ER force-pushed the fix/teleporter_v5_cnames branch from 35be58e to 7b60775 Compare September 11, 2024 19:22
@yubiuser
Copy link
Member

Still does not work. It's kind of difficult to debug, as the debug flags are overwritten on v5 backup import (where they are not set).
Maybe its because /etc/pihole/migration_backup_v6 does not exist? (Where should it have been created?)

2024-09-11 21:59:52.606 CEST [31252/T31514] DEBUG_API: Processing POST /api/teleporter in /api/teleporter
2024-09-11 21:59:52.606 CEST [31252/T31514] DEBUG_API: Found field: "import", filename: ""
2024-09-11 21:59:52.606 CEST [31252/T31514] DEBUG_API: Received field: "import" (length 178 bytes)
2024-09-11 21:59:52.607 CEST [31252/T31514] DEBUG_API: Found field: "file", filename: "piv5.tar.gz"
2024-09-11 21:59:52.607 CEST [31252/T31514] DEBUG_API: Received field: "file" (length 6511 bytes)
2024-09-11 21:59:52.607 CEST [31252/T31514] DEBUG_API: Received file (6511 bytes, buffer is now 6511 bytes)
2024-09-11 21:59:52.612 CEST [31252/T31514] DEBUG_API: Found file in TAR archive: "whitelist.exact.json" (3633 bytes)
2024-09-11 21:59:52.612 CEST [31252/T31514] DEBUG_API: Found file in TAR archive: "whitelist.regex.json" (428 bytes)
2024-09-11 21:59:52.612 CEST [31252/T31514] DEBUG_API: Found file in TAR archive: "blacklist.exact.json" (1041 bytes)
2024-09-11 21:59:52.613 CEST [31252/T31514] DEBUG_API: Found file in TAR archive: "blacklist.regex.json" (4862 bytes)
2024-09-11 21:59:52.613 CEST [31252/T31514] DEBUG_API: Found file in TAR archive: "adlist.json" (9212 bytes)
2024-09-11 21:59:52.613 CEST [31252/T31514] DEBUG_API: Found file in TAR archive: "domain_audit.json" (138 bytes)
2024-09-11 21:59:52.613 CEST [31252/T31514] DEBUG_API: Found file in TAR archive: "group.json" (320 bytes)
2024-09-11 21:59:52.613 CEST [31252/T31514] DEBUG_API: Found file in TAR archive: "client.json" (2 bytes)
2024-09-11 21:59:52.613 CEST [31252/T31514] DEBUG_API: Found file in TAR archive: "domainlist_by_group.json" (2202 bytes)
2024-09-11 21:59:52.613 CEST [31252/T31514] DEBUG_API: Found file in TAR archive: "adlist_by_group.json" (1108 bytes)
2024-09-11 21:59:52.614 CEST [31252/T31514] DEBUG_API: Found file in TAR archive: "client_by_group.json" (2 bytes)
2024-09-11 21:59:52.614 CEST [31252/T31514] DEBUG_API: Found file in TAR archive: "setupVars.conf" (431 bytes)
2024-09-11 21:59:52.614 CEST [31252/T31514] DEBUG_API: Found file in TAR archive: "dhcp.leases" (0 bytes)
2024-09-11 21:59:52.615 CEST [31252/T31514] DEBUG_API: Found file in TAR archive: "custom.list" (588 bytes)
2024-09-11 21:59:52.615 CEST [31252/T31514] DEBUG_API: Found file in TAR archive: "pihole-FTL.conf" (341 bytes)
2024-09-11 21:59:52.615 CEST [31252/T31514] DEBUG_API: Found file in TAR archive: "etc/hosts" (189 bytes)
2024-09-11 21:59:52.615 CEST [31252/T31514] DEBUG_API: Found file in TAR archive: "dnsmasq.d/06-rfc6761.conf" (2190 bytes)
2024-09-11 21:59:52.616 CEST [31252/T31514] DEBUG_API: Found file in TAR archive: "dnsmasq.d/05-pihole-custom-cname.conf" (108 bytes)
2024-09-11 21:59:52.616 CEST [31252/T31514] DEBUG_API: Found file in TAR archive: "dnsmasq.d/01-pihole.conf" (1442 bytes)
2024-09-11 21:59:52.616 CEST [31252/T31514] DEBUG_API: Found file in TAR archive: "dnsmasq.d/99-record.conf" (49 bytes)
2024-09-11 21:59:52.616 CEST [31252/T31514] DEBUG_API: Found file in TAR archive: "dnsmasq.d/66-strip.conf" (23 bytes)
2024-09-11 21:59:52.620 CEST [31252/T31514] INFO: import_json_table(adlist.json): JSON array contains 37 entries
2024-09-11 21:59:52.621 CEST [31252/T31514] DEBUG_API: import_json_table(adlist.json): Deleting all entries from table "adlist"
2024-09-11 21:59:52.652 CEST [31252/T31514] INFO: import_json_table(adlist_by_group.json): JSON array contains 37 entries
2024-09-11 21:59:52.654 CEST [31252/T31514] DEBUG_API: import_json_table(adlist_by_group.json): Deleting all entries from table "adlist_by_group"
2024-09-11 21:59:52.677 CEST [31252/T31514] INFO: import_json_table(blacklist.exact.json): JSON array contains 8 entries
2024-09-11 21:59:52.680 CEST [31252/T31514] DEBUG_API: import_json_table(blacklist.exact.json): Deleting all entries from table "domainlist" of type 1
2024-09-11 21:59:52.707 CEST [31252/T31514] INFO: import_json_table(blacklist.regex.json): JSON array contains 27 entries
2024-09-11 21:59:52.709 CEST [31252/T31514] DEBUG_API: import_json_table(blacklist.regex.json): Deleting all entries from table "domainlist" of type 3
2024-09-11 21:59:52.737 CEST [31252/T31514] INFO: import_json_table(client.json): JSON array contains 0 entries
2024-09-11 21:59:52.739 CEST [31252/T31514] DEBUG_API: import_json_table(client.json): Deleting all entries from table "client"
2024-09-11 21:59:52.750 CEST [31252/T31514] INFO: import_json_table(client_by_group.json): JSON array contains 0 entries
2024-09-11 21:59:52.752 CEST [31252/T31514] DEBUG_API: import_json_table(client_by_group.json): Deleting all entries from table "client_by_group"
2024-09-11 21:59:52.776 CEST [31252/T31514] INFO: import_json_table(domainlist_by_group.json): JSON array contains 64 entries
2024-09-11 21:59:52.778 CEST [31252/T31514] DEBUG_API: import_json_table(domainlist_by_group.json): Deleting all entries from table "domainlist_by_group"
2024-09-11 21:59:52.801 CEST [31252/T31514] INFO: import_json_table(group.json): JSON array contains 3 entries
2024-09-11 21:59:52.803 CEST [31252/T31514] DEBUG_API: import_json_table(group.json): Deleting all entries from table "group"
2024-09-11 21:59:52.821 CEST [31252/T31514] INFO: import_json_table(whitelist.exact.json): JSON array contains 26 entries
2024-09-11 21:59:52.822 CEST [31252/T31514] DEBUG_API: import_json_table(whitelist.exact.json): Deleting all entries from table "domainlist" of type 0
2024-09-11 21:59:52.846 CEST [31252/T31514] INFO: import_json_table(whitelist.regex.json): JSON array contains 3 entries
2024-09-11 21:59:52.848 CEST [31252/T31514] DEBUG_API: import_json_table(whitelist.regex.json): Deleting all entries from table "domainlist" of type 2
2024-09-11 21:59:52.868 CEST [31252/T31514] INFO: Writing file "custom.list" (588 bytes) to "/etc/pihole/custom.list"
2024-09-11 21:59:52.870 CEST [31252/T31514] INFO: Writing file "pihole-FTL.conf" (341 bytes) to "/etc/pihole/pihole-FTL.conf"
2024-09-11 21:59:52.873 CEST [31252/T31514] INFO: Writing file "setupVars.conf" (431 bytes) to "/etc/pihole/setupVars.conf"
2024-09-11 21:59:52.874 CEST [31252/T31514] INFO: Writing file "dnsmasq.d/05-pihole-custom-cname.conf" (108 bytes) to "/etc/pihole/migration_backup_v6/05-pihole-custom-cname.conf"
2024-09-11 21:59:52.874 CEST [31252/T31514] ERROR: Unable to open file "/etc/pihole/migration_backup_v6/05-pihole-custom-cname.conf" for writing: No such file or directory
2024-09-11 21:59:52.878 CEST [31252/T31514] DEBUG_API: Done
2024-09-11 21:59:52.879 CEST [31252/T31514] INFO: Restarting FTL due to API config change
2024-09-11 21:59:52.880 CEST [31252M] DEBUG_ANY: Received SIGTERM
2024-09-11 21:59:52.880 CEST [31252M] INFO: Asked to terminate by "/usr/bin/pihole-FTL -f" (PID 31252, user pihole UID 999)
2024-09-11 21:59:52.880 CEST [31252M] DEBUG_ANY: Sending SIGUSR6 to dnsmasq to stop DNS service
2024-09-11 21:59:52.881 CEST [31252M] DEBUG_ANY: dnsmasq received signal 41
2024-09-11 21:59:52.882 CEST [31252M] INFO: Shutting down... // exit code 22 // jmpret 0
2024-09-11 21:59:52.899 CEST [31252/T31508] INFO: Terminating timer thread
2024-09-11 21:59:52.953 CEST [31252/T31505] INFO: Terminating database thread
2024-09-11 21:59:53.348 CEST [31252M] INFO: Finished final database update
2024-09-11 21:59:53.348 CEST [31252M] INFO: Waiting for threads to join
2024-09-11 21:59:53.348 CEST [31252M] INFO: Thread housekeeper (1) is idle, terminating it.
2024-09-11 21:59:53.348 CEST [31252M] INFO: Thread dns-client (2) is idle, terminating it.
2024-09-11 21:59:53.348 CEST [31252M] INFO: Thread ntp-client (4) is idle, terminating it.
2024-09-11 21:59:53.348 CEST [31252M] INFO: All threads joined
2024-09-11 21:59:53.349 CEST [31252M] DEBUG_ANY: Closing gravity database
2024-09-11 21:59:53.352 CEST [31252M] INFO: Stored 1 API session in the database
2024-09-11 21:59:53.612 CEST [31252M] DEBUG_API: CLI password removed
2024-09-11 21:59:53.656 CEST [31252M] INFO: ########## FTL terminated after 1m  (code 22)! ##########
2024-09-11 21:59:53.660 CEST [31252M] INFO: Config file /etc/pihole/pihole.toml not available (r): No such file or directory
2024-09-11 21:59:53.660 CEST [31252M] INFO: ########## FTL started on nanopi! ##########
2024-09-11 21:59:53.660 CEST [31252M] INFO: FTL branch: fix/teleporter_v5_cnames
2024-09-11 21:59:53.661 CEST [31252M] INFO: FTL version: vDev-7b60775
2024-09-11 21:59:53.661 CEST [31252M] INFO: FTL commit: 7b60775f
2024-09-11 21:59:53.661 CEST [31252M] INFO: FTL date: 2024-02-21 19:48:40 +0100
2024-09-11 21:59:53.661 CEST [31252M] INFO: FTL user: pihole
2024-09-11 21:59:53.661 CEST [31252M] INFO: Compiled for linux/arm64/v8 (compiled on CI) using cc (Alpine 13.2.1_git20240309) 13.2.1 20240309
2024-09-11 21:59:53.662 CEST [31252M] INFO: Config file /etc/pihole/pihole.toml not available (r): No such file or directory
2024-09-11 21:59:53.663 CEST [31252M] INFO: Config backup file /etc/pihole/config_backups/pihole.toml.1 not available (r): No such file or directory
2024-09-11 21:59:53.663 CEST [31252M] INFO: Config backup file /etc/pihole/config_backups/pihole.toml.2 not available (r): No such file or directory
2024-09-11 21:59:53.663 CEST [31252M] INFO: Config backup file /etc/pihole/config_backups/pihole.toml.3 not available (r): No such file or directory
2024-09-11 21:59:53.664 CEST [31252M] INFO: Config backup file /etc/pihole/config_backups/pihole.toml.4 not available (r): No such file or directory
2024-09-11 21:59:53.664 CEST [31252M] INFO: Config backup file /etc/pihole/config_backups/pihole.toml.5 not available (r): No such file or directory
2024-09-11 21:59:53.664 CEST [31252M] INFO: Config backup file /etc/pihole/config_backups/pihole.toml.6 not available (r): No such file or directory
2024-09-11 21:59:53.664 CEST [31252M] INFO: Config backup file /etc/pihole/config_backups/pihole.toml.7 not available (r): No such file or directory
2024-09-11 21:59:53.664 CEST [31252M] INFO: Config backup file /etc/pihole/config_backups/pihole.toml.8 not available (r): No such file or directory
2024-09-11 21:59:53.665 CEST [31252M] INFO: Config backup file /etc/pihole/config_backups/pihole.toml.9 not available (r): No such file or directory
2024-09-11 21:59:53.665 CEST [31252M] INFO: Config backup file /etc/pihole/config_backups/pihole.toml.10 not available (r): No such file or directory
2024-09-11 21:59:53.665 CEST [31252M] INFO: Config backup file /etc/pihole/config_backups/pihole.toml.11 not available (r): No such file or directory
2024-09-11 21:59:53.665 CEST [31252M] INFO: Config backup file /etc/pihole/config_backups/pihole.toml.12 not available (r): No such file or directory
2024-09-11 21:59:53.665 CEST [31252M] INFO: Config backup file /etc/pihole/config_backups/pihole.toml.13 not available (r): No such file or directory
2024-09-11 21:59:53.666 CEST [31252M] INFO: Config backup file /etc/pihole/config_backups/pihole.toml.14 not available (r): No such file or directory
2024-09-11 21:59:53.666 CEST [31252M] INFO: No config file nor backup available, using defaults
2024-09-11 21:59:53.666 CEST [31252M] INFO: Reading legacy config files from /etc/pihole/pihole-FTL.conf
2024-09-11 21:59:53.666 CEST [31252M] INFO:    PIDFILE: Empty path is not possible, using default
2024-09-11 21:59:53.667 CEST [31252M] INFO:    SETUPVARSFILE: Empty path is not possible, using default
2024-09-11 21:59:53.667 CEST [31252M] INFO:    GRAVITYDB: Empty path is not possible, using default
2024-09-11 21:59:53.667 CEST [31252M] INFO:    WEBROOT: Empty path is not possible, using default
2024-09-11 21:59:53.667 CEST [31252M] INFO:    WEBHOME: Empty path is not possible, using default
2024-09-11 21:59:53.667 CEST [31252M] INFO:    API_INFO_LOG: Empty path is not possible, using default
2024-09-11 21:59:53.668 CEST [31252M] INFO:    WEBDOMAIN: Empty path is not possible, using default
2024-09-11 21:59:53.668 CEST [31252M] INFO: Moving /etc/pihole/pihole-FTL.conf to /etc/pihole/migration_backup_v6/pihole-FTL.conf
2024-09-11 21:59:53.668 CEST [31252M] WARNING: Unable to move /etc/pihole/pihole-FTL.conf to /etc/pihole/migration_backup_v6/pihole-FTL.conf: No such file or directory
2024-09-11 21:59:53.669 CEST [31252M] INFO: Migrating config from /etc/pihole/setupVars.conf
2024-09-11 21:59:53.669 CEST [31252M] INFO: setupVars.conf:WEBPASSWORD -> Setting webserver.api.pwhash to 908aaddeff20d2cbc95312fbc372754048fe5ebc91781754c201d4fcb9755577
2024-09-11 21:59:53.669 CEST [31252M] INFO: setupVars.conf:BLOCKING_ENABLED -> Setting dns.blocking.active to true
2024-09-11 21:59:53.670 CEST [31252M] INFO: setupVars.conf:TEMPERATURE_LIMIT -> Not set
2024-09-11 21:59:53.670 CEST [31252M] INFO: setupVars.conf:TEMPERATURE_UNIT -> Not set
2024-09-11 21:59:53.670 CEST [31252M] INFO: setupVars.conf:WEBUIBOXEDLAYOUT -> Setting webserver.interface.boxed to true
2024-09-11 21:59:53.670 CEST [31252M] INFO: setupVars.conf:WEBTHEME -> Setting webserver.interface.theme to default-dark
2024-09-11 21:59:53.671 CEST [31252M] INFO: setupVars.conf:PIHOLE_DNS_1 -> Setting dns.upstreams[1] = 172.19.0.2
2024-09-11 21:59:53.674 CEST [31252M] INFO: setupVars.conf:PIHOLE_DOMAIN -> Not set
2024-09-11 21:59:53.674 CEST [31252M] INFO: setupVars.conf:DNS_FQDN_REQUIRED -> Setting dns.domainNeeded to true
2024-09-11 21:59:53.675 CEST [31252M] INFO: setupVars.conf:DNS_FQDN_REQUIRED -> Setting dns.expandHosts to true
2024-09-11 21:59:53.675 CEST [31252M] INFO: setupVars.conf:DNS_bogusPriv -> Not set
2024-09-11 21:59:53.675 CEST [31252M] INFO: setupVars.conf:DNSSEC -> Setting dns.dnssec to false
2024-09-11 21:59:53.675 CEST [31252M] INFO: setupVars.conf:PIHOLE_INTERFACE -> Setting dns.interface to eth0
2024-09-11 21:59:53.676 CEST [31252M] INFO: setupVars.conf:HOSTRECORD -> Not set
2024-09-11 21:59:53.676 CEST [31252M] INFO: setupVars.conf:DNSMASQ_LISTENING -> Setting dns.listeningMode to ALL
2024-09-11 21:59:53.676 CEST [31252M] INFO: setupVars.conf:REV_SERVER -> Setting dns.revServers to true,10.0.1.0/24,10.0.1.1,fritz.box
2024-09-11 21:59:53.676 CEST [31252M] INFO: setupVars.conf:DHCP_ACTIVE -> Not set
2024-09-11 21:59:53.676 CEST [31252M] INFO: setupVars.conf:DHCP_START -> Not set
2024-09-11 21:59:53.676 CEST [31252M] INFO: setupVars.conf:DHCP_END -> Not set
2024-09-11 21:59:53.677 CEST [31252M] INFO: setupVars.conf:DHCP_ROUTER -> Not set
2024-09-11 21:59:53.677 CEST [31252M] INFO: setupVars.conf:DHCP_LEASETIME -> Not set
2024-09-11 21:59:53.677 CEST [31252M] INFO: setupVars.conf:DHCP_IPv6 -> Not set
2024-09-11 21:59:53.677 CEST [31252M] INFO: setupVars.conf:DHCP_RAPID_COMMIT -> Not set
2024-09-11 21:59:53.677 CEST [31252M] INFO: setupVars.conf:queryLogging -> Not set
2024-09-11 21:59:53.677 CEST [31252M] INFO: setupVars.conf:GRAVITY_TMPDIR -> Not set
2024-09-11 21:59:53.677 CEST [31252M] INFO: setupVars.conf:WEB_PORTS -> Setting webserver.port to 80,
2024-09-11 21:59:53.677 CEST [31252M] WARNING: Could not move /etc/pihole/setupVars.conf to /etc/pihole/migration_backup_v6/setupVars.conf
2024-09-11 21:59:53.677 CEST [31252M] INFO: Migration complete
2024-09-11 21:59:53.678 CEST [31252M] INFO: Moving /etc/pihole/custom.list to /etc/pihole/migration_backup_v6/custom.list
2024-09-11 21:59:53.678 CEST [31252M] WARNING: Unable to move /etc/pihole/custom.list to /etc/pihole/migration_backup_v6/custom.list: No such file or directory
2024-09-11 21:59:53.681 CEST [31252M] INFO: Wrote config file:
2024-09-11 21:59:53.681 CEST [31252M] INFO:  - 149 total entries
2024-09-11 21:59:53.681 CEST [31252M] INFO:  - 133 entries are default
2024-09-11 21:59:53.681 CEST [31252M] INFO:  - 16 entries are modified
2024-09-11 21:59:53.681 CEST [31252M] INFO:  - 0 entries are forced through environment
2024-09-11 21:59:53.682 CEST [31252M] INFO: Config file written to /etc/pihole/pihole.toml
2024-09-11 21:59:53.695 CEST [31252M] INFO: PID of FTL process: 31252
2024-09-11 21:59:53.696 CEST [31252M] INFO: Not sleeping as system has finished booting
2024-09-11 21:59:53.698 CEST [31252M] INFO: listening on 0.0.0.0 port 53
2024-09-11 21:59:53.698 CEST [31252M] INFO: listening on :: port 53
2024-09-11 21:59:53.701 CEST [31252M] INFO: PID of FTL process: 31252
2024-09-11 21:59:53.705 CEST [31252M] INFO: Database version is 19
2024-09-11 21:59:53.706 CEST [31252M] INFO: Database successfully initialized
2024-09-11 21:59:55.042 CEST [31252M] INFO: Imported 21302 queries from the on-disk database (it has 1221093 rows)
2024-09-11 21:59:55.043 CEST [31252M] INFO: Parsing queries in database
2024-09-11 21:59:55.827 CEST [31252M] INFO:   10000 queries parsed...
2024-09-11 21:59:56.265 CEST [31252M] INFO:   20000 queries parsed...
2024-09-11 21:59:56.321 CEST [31252M] INFO: Imported 21302 queries from the long-term database
2024-09-11 21:59:56.321 CEST [31252M] INFO:  -> Total DNS queries: 21302
2024-09-11 21:59:56.321 CEST [31252M] INFO:  -> Cached DNS queries: 6888
2024-09-11 21:59:56.321 CEST [31252M] INFO:  -> Forwarded DNS queries: 11034
2024-09-11 21:59:56.321 CEST [31252M] INFO:  -> Blocked DNS queries: 2543
2024-09-11 21:59:56.321 CEST [31252M] INFO:  -> Unknown DNS queries: 4
2024-09-11 21:59:56.322 CEST [31252M] INFO:  -> Unique domains: 1462
2024-09-11 21:59:56.322 CEST [31252M] INFO:  -> Unique clients: 11
2024-09-11 21:59:56.322 CEST [31252M] INFO:  -> DNS cache records: 3072
2024-09-11 21:59:56.322 CEST [31252M] INFO:  -> Known forward destinations: 3
2024-09-11 21:59:56.330 CEST [31252M] INFO: FTL is running as user pihole (UID 999)

nanopi@nanopi:~$ ls -lha /etc/pihole/migration_backup_v6/
ls: Zugriff auf '/etc/pihole/migration_backup_v6/' nicht möglich: Datei oder Verzeichnis nicht gefunden

@yubiuser
Copy link
Member

I found another bug: on import of a v6 backup, FTL is not restarted even when 'config' is imported - and elements are imported which usually require/trigger a FTL restart.
Reproduce: Set a upstream DNS server (1), take a backup, change the DNS server (2), import the backup > despite the upstream DNS server (1) is set back in the toml and "active" in the web interface, the server (2) is still used as upstream server.

@DL6ER
Copy link
Member Author

DL6ER commented Sep 12, 2024

Okay, two things here:

Maybe its because /etc/pihole/migration_backup_v6 does not exist? (Where should it have been created?)

2024-09-11 21:59:52.874 CEST [31252/T31514] ERROR: Unable to open file "/etc/pihole/migration_backup_v6/05-pihole-custom-cname.conf" for writing: No such file or directory

Yes, it should have been created here:

https://github.com/pi-hole/pi-hole/blob/23f6c3069a98b388355d613bcf8aba36b7c4efac/automated%20install/basic-install.sh#L2156

or, in dockerland:

https://github.com/pi-hole/docker-pi-hole/blob/3454f65bb358440269a1ff3223e114e7143e6604/src/bash_functions.sh#L158

This has only been added last week to the docker image, maybe your container is outdated somehow?


FTL is not restarted even when 'config' is imported - and elements are imported which usually require/trigger a FTL restart.

Ah yes, this was a clear oversight. I added the restarting request in the tar.gz but not in the zip handling routines. I fixed this in the most recent commit (also reducing code duplication).

@yubiuser
Copy link
Member

maybe your container is outdated somehow?

I'm running v6 bare metal. The issue was: the migration step checks for pihole.toml and returns early by assuming this is already a v6 instance and the dir already exists. I created it manually and now the CNAME import works.

However, the restart on v6 import does not work yet.

…led log messages. Also reduce code duplication by defining a common restart_ftl() routine

Signed-off-by: DL6ER <[email protected]>
@DL6ER DL6ER force-pushed the fix/teleporter_v5_cnames branch from 1289ef9 to db0054b Compare September 12, 2024 19:41
@DL6ER
Copy link
Member Author

DL6ER commented Sep 12, 2024

Thanks, I see I put the restart command in a place where it is not actually effective when ZIP files are handled. Should be fixed as of the latest commit.

@DL6ER DL6ER marked this pull request as ready for review September 12, 2024 19:42
…kers may detect more often that the config was not changed than faster ones. This is caused by inotify events arriving delayed and - in general - asynchroneous.

Signed-off-by: DL6ER <[email protected]>
@DL6ER DL6ER enabled auto-merge September 12, 2024 20:27
@DL6ER DL6ER merged commit 29f8c67 into development Sep 12, 2024
17 checks passed
@DL6ER DL6ER deleted the fix/teleporter_v5_cnames branch September 12, 2024 20:30
@PromoFaux PromoFaux mentioned this pull request Feb 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants