zrong / wiz2joplin

Migrate from WizNote to Joplin.
GNU General Public License v3.0
90 stars 21 forks source link

script crash during conversion #4

Open supotnitskiy opened 3 years ago

supotnitskiy commented 3 years ago

Dear zrong , thank you very much for your work. You are well done. With the help of your script, I have converted almost 1,700 documents. And they converted well.

There is only one drawback - tags have not been transferred to joplin. Perhaps this is due to the abnormal termination of the script described in this topic.

For a cleaner experiment, I performed these actions in a new profile.

error in program output

**w2j -o ~/w2j -w ~/.wiznote -u supotnitskiy@gmail.com -t 465b3ab34094296a56d*** -a

Please read [/home/deti/w2j/w2j.log] to check the conversion states.
Traceback (most recent call last):
  File "/home/deti/w2j/venv/bin/w2j", line 33, in <module>
    sys.exit(load_entry_point('w2j==0.4', 'console_scripts', 'w2j')())
  File "/home/deti/w2j/venv/lib/python3.9/site-packages/w2j/__init__.py", line 67, in main
    ad.sync_all()
  File "/home/deti/w2j/venv/lib/python3.9/site-packages/w2j/adapter.py", line 595, in sync_all
    self._sync_note(wd)
  File "/home/deti/w2j/venv/lib/python3.9/site-packages/w2j/adapter.py", line 541, in _sync_note
    jr: JoplinResource = self._upload_wiz_image(image)
  File "/home/deti/w2j/venv/lib/python3.9/site-packages/w2j/adapter.py", line 492, in _upload_wiz_image
    jr: JoplinResource = self.jda.post_resource(
  File "/home/deti/w2j/venv/lib/python3.9/site-packages/w2j/joplin.py", line 324, in post_resource
    raise ValueError(data['error'])
ValueError: Internal Server Error: Image is invalid or does not exist: /tmp/RTQupJTBLJP9g_WSYkDFTNMq.jpg:

error in logs /home/deti/w2j/w2j.log

在数据库 note_tag 中找到 note dfea669277f54e98af159b20539a133e 的 0 条 tag 记录。
正在处理 document badd20b6-9cfb-4d84-8e4b-36e1946920ea|APIPA automatic Private IP addressing|。
向 Joplin 增加 note {'id': 'badd20b69cfb4d848e4b36e1946920ea', 'title': 'APIPA automatic Private IP addressing', 'parent_id': '5e3f8768cd8946e4883da693a8c4971b', 'markup_language': 1, 'body_html': '<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE en-note SYSTEM "http://xml.evernote.com/pub/enml2.dtd"><en-note style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div><strong><a href="https://ctopmbi4.wordpress.com/2015/05/21/apipaautomatic-private-ip-addressing">APIPA(automatic Private IP addressing</a></strong></div><div><br/></div><div><strong>APIPA</strong>(automatic Private IP addressing)</div><div><br/></div><div><strong>APIPA</strong> – Automatic Private IP&nbsp;Addressing, служба для&nbsp;обеспечения работы локальной сети в&nbsp;случае, когда нет&nbsp;сервера DHCP и&nbsp;компьютеры настроены на&nbsp;автоматическое получение IP-адресов. При&nbsp;этом компьютерам сети автоматически назначаются свободные адреса из&nbsp;диапазона <strong>169.254.XXX.XXX</strong>, маска 255.255.0.0.</div><div><br/></div><div>Служба APIPA каждые 5 минут проверяет наличие DHCP-сервера и&nbsp;если таковой обнаружится, управление получением IP-адреса будет передано ему. DHCP-сервер заменит адрес, полученный от&nbsp;APIPA на&nbsp;динамически назначаемый адрес из&nbsp;своего диапазона.</div><div><br/></div><div><strong>Отключение</strong></div><div><br/></div><div>Запустите редактор реестра (Regedit.exe)</div><div>Перейдите к&nbsp;<em><strong>HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters\\Interfaces</strong></em></div><div>Выберите нужный интерфейс</div><div>В&nbsp;меню Edit выберите New&nbsp;– DWORD value</div><div>Введите имя&nbsp;IPAutoconfigurationEnabled и&nbsp;нажмите Enter</div><div>Дважды кликните по&nbsp;этому новому значению и&nbsp;установите его&nbsp;равным 0. Нажмите OK</div><div>Закройте редактор</div><div>Если адаптеров несколько, и&nbsp;запретить APIPA нужно для&nbsp;всех, создайте и&nbsp;установите в&nbsp;0 параметр <em><strong>HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters\\IPAutoconfigurationEnabled</strong></em></div><div><br/></div><div><strong><a href="http://www.inoreader.com/?utm_source=email_sharing&amp;amp;utm_campaign=u1005912121&amp;amp;utm_medium=email">Inoreader</a></strong> is a light and fast RSS Reader. Follow us on <a href="http://www.twitter.com/Inoreader">Twitter</a> and <a href="http://www.facebook.com/Inoreader">Facebook</a>.</div></en-note>', 'convert_to': 'markdown', 'source_command': {'name': 'simplifiedPageHtml'}}
在数据库 note_tag 中找到 note badd20b69cfb4d848e4b36e1946920ea 的 0 条 tag 记录。
正在处理 document 682fa2ab-caa1-4658-93b1-80dc3954c864|ipv6|。
向 Joplin 增加 resource /home/deti/w2j/documents/682fa2ab-caa1-4658-93b1-80dc3954c864/index_files/733dff896efdacfa87606c6c845b260f.jpg {'title': 'index_files/733dff896efdacfa87606c6c845b260f.jpg', 'filename': 'index_files/733dff896efdacfa87606c6c845b260f.jpg'}
Internal Server Error: Image is invalid or does not exist: /tmp/RTQupJTBLJP9g_WSYkDFTNMq.jpg:

Error: Image is invalid or does not exist: /tmp/RTQupJTBLJP9g_WSYkDFTNMq.jpg
at handleResizeImage_ (/tmp/.mount_JoplinDxYPvF/resources/app.asar/node_modules/@joplin/lib/shim-init-node.js:140:31)
at Object.shim.createResourceFromPath (/tmp/.mount_JoplinDxYPvF/resources/app.asar/node_modules/@joplin/lib/shim-init-node.js:242:21)

as it seems to me the glitch is related to this document /home/deti/.wiznote/supotnitskiy@gmail.com/data/notes/{682fa2ab-caa1-4658-93b1-80dc3954c864}

The faulty file can be downloaded from the link https://disk.yandex.ru/d/71MfsHUQZke5Pg

I would be very grateful if you figure out this error.

zrong commented 3 years ago

Hi @supotnitskiy

The following error message is from Joplin API:

ValueError: Internal Server Error: Image is invalid or does not exist: /tmp/RTQupJTBLJP9g_WSYkDFTNMq.jpg

So I decide to ignore it ^_^

When I did the conversion, I also had a similar error to yours. I can give your 2 tips:

  1. When you run the w2j, keep your Joplin in a normal state: don't enter preference, don't click any link, don't enter edit state...
  2. Maybe an image is a WEBP image and not a JPEG image, or you can delete the note and add the note into Joplin manually.

Good Luck!

supotnitskiy commented 3 years ago

Alas, it doesn't work. I feel trapped

To delete those notes, I had to buy a subscriber on wiznote

I deleted these problematic notes but the conversion does not take place

Ends with this

正在处理 document ec613100-0634-11ea-8a0b-b99aec9ac5c9|Белый хлеб/батон в хлебопечке Moulinex|。
note ec613100063411ea8a0bb99aec9ac5c9 |Белый хлеб/батон в хлебопечке Moulinex| 已经存在!
正在处理 document 8186d176-0c09-4cbd-a36a-6210b9981af1|Эпоха галантерейщиков|。
note 8186d1760c094cbda36a6210b9981af1 |Эпоха галантерейщиков| 已经存在!
正在处理 document 9aaef636-672b-4cb7-9abc-ea04fe8b9b1a|даты рождения знакомых и родных|。
note 9aaef636672b4cb79abcea04fe8b9b1a |даты рождения знакомых и родных| 已经存在!

if i delete the last lines it doesn't help

I am attaching a full log file https://disk.yandex.ru/d/qrAXyfzSkl7rhg