TryGhost / migrate

MIT License
42 stars 19 forks source link

TypeError when trying to migrate medium content (Cannot read properties of undefined (reading 'split')) #886

Closed Gelob closed 1 year ago

Gelob commented 1 year ago

I'm facing an error when trying to migrate my medium export. Happy to provide the export directly to someone if needed or let me know what I should look at.

ryan@ryans-M1-Mac medium % migrate medium --pathToZip medium.zip
(node:98007) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 unpipe listeners added to [WriteStream]. Use emitter.setMaxListeners() to increase limit
(Use `node --trace-warnings ...` to show where the warning was created)
(node:98007) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 error listeners added to [WriteStream]. Use emitter.setMaxListeners() to increase limit
(node:98007) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 close listeners added to [WriteStream]. Use emitter.setMaxListeners() to increase limit
(node:98007) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 finish listeners added to [WriteStream]. Use emitter.setMaxListeners() to increase limit
[2023-10-18 13:19:42] INFO
[2023-10-18 13:19:42] INFO
[2023-10-18 13:19:42] INFO
[2023-10-18 13:19:42] INFO
 ✔ https://medium.com/@what_if/cisco-cloud-services-router-csr-1000v-restful-api-wont-start-29e368efcfb3
 ✔ https://medium.com/@what_if/net-framework-4-7-2-install-error-0x80092004-cannot-find-object-or-property-9f46de27b980
 ✔ https://medium.com/@what_if/azure-backup-agent-slow-transfer-speeds-6726693c4477
 ✔ https://medium.com/p/fc8b17944ee2
 ✔ https://medium.com/@what_if/cisco-cloud-services-router-csr-1000v-ssh-generated-key-hostname-domain-ad3d24e7e1ac
 ✔ https://medium.com/p/23b4cb79ad9e
 ✔ https://medium.com/p/a1c15f2a3b97
 ✔ https://medium.com/p/39350942c904
 ✔ https://medium.com/p/1edc4bdf334c
 ✔ https://medium.com/p/fa8facf2683b
 ✔ https://medium.com/p/c04a63dfb988
 ✔ https://medium.com/p/a79f4149ab20
 ✔ https://medium.com/@what_if/juniper-ex4500-class-of-service-error-on-vty-console-497c7747810e
 ✔ https://medium.com/p/2a9b46b3859c
 ✔ https://medium.com/p/85bf531dee53
 ✔ https://medium.com/p/64d284c8dadf
✔ Build Link Map
✔ Format data as Ghost JSON
› Fetch images via AssetScraper
 ✔ Initializing AssetScraper cache
 ✔ Finding files
 › Finding file types
  ⠹ 09/60: Checking file type: https://www.networktocode.com/community/
  ⠹ 20/60: Checking file type: https://m.dotdev.co/how-to-set-a-featured-image-and-set-its-focal-point-on-medium-b3b57ab986bb
  ⠹ 26/60: Checking file type: https://download.microsoft.com/download/E/F/2/EF23C21D-7860-4F05-88CE-39AA114B014B/SQLEXPR_x64_ENU.exe
  ⠹ 27/60: Checking file type: https://stackoverflow.com/questions/39835986/sql-server-2016-express-full-download
  ⠹ 28/60: Checking file type: https://download.microsoft.com/download/D/D/4/DD495084-ADA7-4827-ADD3-FC566EC05B90/SSMS-Setup-ENU.exe
  Total: 60. Complete: 0, Failed: 0, Skipped: 23, Disabled: 0
   Downloading files
   Fixing asset references
   Finalizing
  Update links in content via LinkFixer
  Convert HTML -> MobileDoc
  Write Ghost import JSON File
  Write Ghost import zip
file:///opt/homebrew/lib/node_modules/@tryghost/migrate/node_modules/@tryghost/mg-assetscraper/lib/AssetScraper.js:617
                        const parts = disposition.split('.');
                                                  ^

TypeError: Cannot read properties of undefined (reading 'split')
    at Request.<anonymous> (file:///opt/homebrew/lib/node_modules/@tryghost/migrate/node_modules/@tryghost/mg-assetscraper/lib/AssetScraper.js:617:51)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

Node.js v20.8.1

Verbose output wasn't much different

ryan@ryans-M1-Mac medium % migrate medium --pathToZip medium.zip -V
info Migrating from export at medium.zip
[STARTED] Initializing Workspace
[OUTPUT] Workspace initialized at /var/folders/0r/pct6smwx02ngk0vww_6ghcvw0000gn/T/mg/17be23c2a764ace11d217bb33ee639f9-medium-medium
[COMPLETED] Initializing Workspace
[STARTED] Read Medium export zip
(node:98240) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 unpipe listeners added to [WriteStream]. Use emitter.setMaxListeners() to increase limit
(Use `node --trace-warnings ...` to show where the warning was created)
(node:98240) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 error listeners added to [WriteStream]. Use emitter.setMaxListeners() to increase limit
(node:98240) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 close listeners added to [WriteStream]. Use emitter.setMaxListeners() to increase limit
(node:98240) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 finish listeners added to [WriteStream]. Use emitter.setMaxListeners() to increase limit
[COMPLETED] Read Medium export zip
[2023-10-18 13:23:12] INFO
[STARTED] Fetch missing data via WebScraper
[STARTED] https://medium.com/p/f7c05aae6f8b
[STARTED] https://medium.com/@what_if/openshift-ipi-install-failed-to-get-power-state-for-node-error-redfish-exception-occurred-533164040f1d
[STARTED] https://medium.com/@what_if/automate-enabling-of-ipmi-over-lan-access-on-hpe-ilo-7d9d8c55b83e
[COMPLETED] https://medium.com/@what_if/automate-enabling-of-ipmi-over-lan-access-on-hpe-ilo-7d9d8c55b83e
[STARTED] https://medium.com/@what_if/f5-big-iq-vm-fails-online-activation-b909145c7e68
[COMPLETED] https://medium.com/p/f7c05aae6f8b
[STARTED] https://medium.com/@what_if/f5-big-ip-or-big-iq-cant-run-config-tool-on-cli-f81aeb2561d9
[COMPLETED] https://medium.com/@what_if/openshift-ipi-install-failed-to-get-power-state-for-node-error-redfish-exception-occurred-533164040f1d
[STARTED] https://medium.com/@what_if/encrypting-decrypting-arista-bgp-bmp-ospf-passwords-ff2072460942
[COMPLETED] https://medium.com/@what_if/f5-big-iq-vm-fails-online-activation-b909145c7e68
[STARTED] https://medium.com/@what_if/automatically-query-the-azure-cdn-edge-nodes-list-5024951bd420
[COMPLETED] https://medium.com/@what_if/f5-big-ip-or-big-iq-cant-run-config-tool-on-cli-f81aeb2561d9
[STARTED] https://medium.com/@what_if/vmware-nsx-invalid-applied-to-value-41bb3e8f7eed
[COMPLETED] https://medium.com/@what_if/encrypting-decrypting-arista-bgp-bmp-ospf-passwords-ff2072460942
[STARTED] https://medium.com/@what_if/cant-see-all-images-in-featured-image-selection-82e7f76d6f6b
[COMPLETED] https://medium.com/@what_if/automatically-query-the-azure-cdn-edge-nodes-list-5024951bd420
[STARTED] https://medium.com/@what_if/disable-tls-1-0-on-windows-server-2012-r2-with-remote-desktop-services-configured-c6d0c881cb47
[COMPLETED] https://medium.com/@what_if/cant-see-all-images-in-featured-image-selection-82e7f76d6f6b
[STARTED] https://medium.com/@what_if/cisco-cloud-services-router-csr-1000v-restconf-wont-respond-on-https-1aa36fc5e75
[COMPLETED] https://medium.com/@what_if/vmware-nsx-invalid-applied-to-value-41bb3e8f7eed
[STARTED] https://medium.com/@what_if/disable-tls-1-0-on-arista-eapi-7bc27d016bbb
[COMPLETED] https://medium.com/@what_if/disable-tls-1-0-on-windows-server-2012-r2-with-remote-desktop-services-configured-c6d0c881cb47
[STARTED] https://medium.com/@what_if/cisco-cloud-services-router-csr-1000v-restful-api-wont-start-29e368efcfb3
[COMPLETED] https://medium.com/@what_if/cisco-cloud-services-router-csr-1000v-restconf-wont-respond-on-https-1aa36fc5e75
[STARTED] https://medium.com/@what_if/net-framework-4-7-2-install-error-0x80092004-cannot-find-object-or-property-9f46de27b980
[COMPLETED] https://medium.com/@what_if/disable-tls-1-0-on-arista-eapi-7bc27d016bbb
[STARTED] https://medium.com/@what_if/azure-backup-agent-slow-transfer-speeds-6726693c4477
[COMPLETED] https://medium.com/@what_if/cisco-cloud-services-router-csr-1000v-restful-api-wont-start-29e368efcfb3
[STARTED] https://medium.com/p/fc8b17944ee2
[COMPLETED] https://medium.com/@what_if/net-framework-4-7-2-install-error-0x80092004-cannot-find-object-or-property-9f46de27b980
[STARTED] https://medium.com/@what_if/cisco-cloud-services-router-csr-1000v-ssh-generated-key-hostname-domain-ad3d24e7e1ac
[COMPLETED] https://medium.com/@what_if/azure-backup-agent-slow-transfer-speeds-6726693c4477
[STARTED] https://medium.com/p/23b4cb79ad9e
[COMPLETED] https://medium.com/p/fc8b17944ee2
[STARTED] https://medium.com/p/a1c15f2a3b97
[COMPLETED] https://medium.com/@what_if/cisco-cloud-services-router-csr-1000v-ssh-generated-key-hostname-domain-ad3d24e7e1ac
[STARTED] https://medium.com/p/39350942c904
[COMPLETED] https://medium.com/p/23b4cb79ad9e
[STARTED] https://medium.com/p/1edc4bdf334c
[COMPLETED] https://medium.com/p/a1c15f2a3b97
[STARTED] https://medium.com/p/fa8facf2683b
[COMPLETED] https://medium.com/p/39350942c904
[STARTED] https://medium.com/p/c04a63dfb988
[COMPLETED] https://medium.com/p/1edc4bdf334c
[STARTED] https://medium.com/p/a79f4149ab20
[COMPLETED] https://medium.com/p/fa8facf2683b
[STARTED] https://medium.com/@what_if/juniper-ex4500-class-of-service-error-on-vty-console-497c7747810e
[COMPLETED] https://medium.com/p/c04a63dfb988
[STARTED] https://medium.com/p/2a9b46b3859c
[COMPLETED] https://medium.com/p/a79f4149ab20
[STARTED] https://medium.com/p/85bf531dee53
[COMPLETED] https://medium.com/@what_if/juniper-ex4500-class-of-service-error-on-vty-console-497c7747810e
[STARTED] https://medium.com/p/64d284c8dadf
[COMPLETED] https://medium.com/p/2a9b46b3859c
[COMPLETED] https://medium.com/p/85bf531dee53
[COMPLETED] https://medium.com/p/64d284c8dadf
[COMPLETED] Fetch missing data via WebScraper
[2023-10-18 13:23:12] INFO
[STARTED] Build Link Map
[COMPLETED] Build Link Map
[2023-10-18 13:23:12] INFO
[STARTED] Format data as Ghost JSON
[COMPLETED] Format data as Ghost JSON
[2023-10-18 13:23:12] INFO
[STARTED] Fetch images via AssetScraper
[STARTED] Initializing AssetScraper cache
[COMPLETED] Initializing AssetScraper cache
[STARTED] Finding files
[COMPLETED] Finding files
[STARTED] Finding file types
[STARTED] Checking file type: https://miro.medium.com/v2/resize:fill:144:144/2*v2YRpBNYEk5PVN4GKTw5vg.png
[STARTED] Checking file type: https://www.microchip.com/en-us/products/clock-and-timing/systems/ptp-grandmaster-clocks/timeprovider-4100
[STARTED] Checking file type: https://cdn-images-1.medium.com/max/800/0*B3L6nNZX8JfdFtRn.png
[STARTED] Checking file type: https://youriloiphere/redfish/v1/Managers/1/NetworkProtocol/
[STARTED] Checking file type: https://cdn-images-1.medium.com/max/800/1*aAvP-lktw0g2x-mFq8Eo-Q.png
[SKIPPED] Checking file type: https://miro.medium.com/v2/resize:fill:144:144/2*v2YRpBNYEk5PVN4GKTw5vg.png
[SKIPPED] Checking file type: https://www.microchip.com/en-us/products/clock-and-timing/systems/ptp-grandmaster-clocks/timeprovider-4100
[SKIPPED] Checking file type: https://cdn-images-1.medium.com/max/800/0*B3L6nNZX8JfdFtRn.png
[SKIPPED] Checking file type: https://youriloiphere/redfish/v1/Managers/1/NetworkProtocol/
[SKIPPED] Checking file type: https://cdn-images-1.medium.com/max/800/1*aAvP-lktw0g2x-mFq8Eo-Q.png
[STARTED] Checking file type: https://cdn-images-1.medium.com/max/800/1*6dMfQnlv2Z9qhYiKN0yrng.png
[STARTED] Checking file type: https://cdn-images-1.medium.com/max/800/1*qKgr0p2X9bC_4OEV5EUyHQ.gif
[STARTED] Checking file type: https://cdn-images-1.medium.com/max/800/1*9lFkfGJ4_DJAeugax2NehQ.png
[STARTED] Checking file type: https://www.networktocode.com/community/
[STARTED] Checking file type: https://docs.microsoft.com/en-us/rest/api/cdn/edgenodes/list#code-try-0
[SKIPPED] Checking file type: https://cdn-images-1.medium.com/max/800/1*6dMfQnlv2Z9qhYiKN0yrng.png
[SKIPPED] Checking file type: https://cdn-images-1.medium.com/max/800/1*qKgr0p2X9bC_4OEV5EUyHQ.gif
[SKIPPED] Checking file type: https://cdn-images-1.medium.com/max/800/1*9lFkfGJ4_DJAeugax2NehQ.png
[SKIPPED] Checking file type: https://docs.microsoft.com/en-us/rest/api/cdn/edgenodes/list#code-try-0
[STARTED] Checking file type: https://github.com/Gelob/get-azure-cdn-ips
[STARTED] Checking file type: https://portal.azure.com/
[STARTED] Checking file type: https://cdn-images-1.medium.com/max/800/1*PRz4Yb-XbCEMZg9W5awFXA.png
[STARTED] Checking file type: https://cdn-images-1.medium.com/max/800/1*KaYS9Ogv4EoODvnDjDaMrA.png
[SKIPPED] Checking file type: https://github.com/Gelob/get-azure-cdn-ips
[SKIPPED] Checking file type: https://portal.azure.com/
[SKIPPED] Checking file type: https://cdn-images-1.medium.com/max/800/1*PRz4Yb-XbCEMZg9W5awFXA.png
[SKIPPED] Checking file type: https://cdn-images-1.medium.com/max/800/1*KaYS9Ogv4EoODvnDjDaMrA.png
[STARTED] Checking file type: https://cdn-images-1.medium.com/max/800/1*_IBXZkIc8bcEbTMl9NMbqg.png
[STARTED] Checking file type: https://cdn-images-1.medium.com/max/800/1*DMjEnlADSay3pgn8h2WoGg.png
[STARTED] Checking file type: https://cdn-images-1.medium.com/max/800/1*UTAPz8UelAcumZIE8W5ivg.png
[STARTED] Checking file type: https://cdn-images-1.medium.com/max/800/1*c_EJQfzsYYtYqT398Ygl6A.png
[SKIPPED] Checking file type: https://cdn-images-1.medium.com/max/800/1*_IBXZkIc8bcEbTMl9NMbqg.png
[SKIPPED] Checking file type: https://cdn-images-1.medium.com/max/800/1*DMjEnlADSay3pgn8h2WoGg.png
[SKIPPED] Checking file type: https://cdn-images-1.medium.com/max/800/1*UTAPz8UelAcumZIE8W5ivg.png
[SKIPPED] Checking file type: https://cdn-images-1.medium.com/max/800/1*c_EJQfzsYYtYqT398Ygl6A.png
[STARTED] Checking file type: https://cdn-images-1.medium.com/max/800/1*qqQqDfvRsUvdNaJIq5Cr0w.png
[STARTED] Checking file type: https://m.dotdev.co/how-to-set-a-featured-image-and-set-its-focal-point-on-medium-b3b57ab986bb
[STARTED] Checking file type: https://help.medium.com/hc/en-us/articles/215680047-Featured-image
[STARTED] Checking file type: https://cdn-images-1.medium.com/max/800/1*SyGx73Zgl7urR-E5SH7gyw.png
[SKIPPED] Checking file type: https://cdn-images-1.medium.com/max/800/1*qqQqDfvRsUvdNaJIq5Cr0w.png
[SKIPPED] Checking file type: https://help.medium.com/hc/en-us/articles/215680047-Featured-image
[SKIPPED] Checking file type: https://cdn-images-1.medium.com/max/800/1*SyGx73Zgl7urR-E5SH7gyw.png
[STARTED] Checking file type: https://en.wikipedia.org/wiki/Windows_Internal_Database
[STARTED] Checking file type: https://support.microsoft.com/en-us/help/4036954/disabling-tls1-0-can-cause-rds-connection-broker-or-rdms-to-fail
[STARTED] Checking file type: https://support.microsoft.com/en-us/help/2833839/guidelines-for-installing-the-remote-desktop-session-host-role-service
[SKIPPED] Checking file type: https://en.wikipedia.org/wiki/Windows_Internal_Database
[SKIPPED] Checking file type: https://support.microsoft.com/en-us/help/4036954/disabling-tls1-0-can-cause-rds-connection-broker-or-rdms-to-fail
[SKIPPED] Checking file type: https://support.microsoft.com/en-us/help/2833839/guidelines-for-installing-the-remote-desktop-session-host-role-service
[STARTED] Checking file type: https://download.microsoft.com/download/E/F/2/EF23C21D-7860-4F05-88CE-39AA114B014B/SQLEXPR_x64_ENU.exe
[STARTED] Checking file type: https://stackoverflow.com/questions/39835986/sql-server-2016-express-full-download
[STARTED] Checking file type: https://download.microsoft.com/download/D/D/4/DD495084-ADA7-4827-ADD3-FC566EC05B90/SSMS-Setup-ENU.exe
file:///opt/homebrew/lib/node_modules/@tryghost/migrate/node_modules/@tryghost/mg-assetscraper/lib/AssetScraper.js:617
                        const parts = disposition.split('.');
                                                  ^

TypeError: Cannot read properties of undefined (reading 'split')
    at Request.<anonymous> (file:///opt/homebrew/lib/node_modules/@tryghost/migrate/node_modules/@tryghost/mg-assetscraper/lib/AssetScraper.js:617:51)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

Node.js v20.8.1
PaulAdamDavis commented 1 year ago

Hi @Gelob, thanks for the detailed report! This is fixed and released in v0.34.1