flecmart / keep2todoist

Transfer items from google keep lists to todoist
GNU General Public License v3.0
53 stars 13 forks source link

Keep notes not deleting. #50

Closed TBTHEDBA closed 10 months ago

TBTHEDBA commented 10 months ago

My notes on the Keep side are not deleting after being moved over to Todoist.

This means they are building up on my Todoist side with duplicates.

TBTHEDBA commented 10 months ago

It is removing them intermittingly. I will continue to monitor to see if I can find a pattern.

flecmart commented 10 months ago

Hmm, I never observed something like that. Some questions that might help debugging:

TBTHEDBA commented 10 months ago
flecmart commented 10 months ago

Thanks for the details. So the manifest unknown was really weird and I could confirm that on my end. I don't know what happened, but all the docker images seemed to be corrupted somehow.

I rebuilt the latest image and that fixed this - so maybe you can try running the docker image again.

Looking at your error output there seems to be an error with the todoist side:

requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https://api.todoist.com/rest/v2/tasks

Is that only happening for yuo shopping list? How is the todoist project named exactly? Maybe this is some edge case that yields to this bad request. The app is restarting then again and goes in a loop - I guess I should add some exception handling here to improve this and make the error output clearer.

Can you give some more details so that I can try to reproduce this behavior? Does it only happen for shopping list?

TBTHEDBA commented 10 months ago

Thank you again for looking into this so quickly. I really appreciate it.

Shopping list is the only list I have in Keep and the only Project/List I have in Todoist.

My main use of this is bypassing Googles change of only using Keep for its shopping list. I am going to eventually put the todoist data into my homeassistant.

TBTHEDBA commented 10 months ago

I created a new test account on todoist.

The items are now being deleted from my keep but the app is still restarting at the same point and throwing the same error.

I will test this periodically through the day. If it continues to work then I can use this as my account that feeds into home assistant.

2023-11-29 11:49:59 2023-11-29 17:49:59 app-INFO: -> 2023-11-29 11:50:00 Traceback (most recent call last): 2023-11-29 11:50:00 File "/app/app.py", line 222, in 2023-11-29 11:50:00 update() 2023-11-29 11:50:00 File "/app/app.py", line 198, in update 2023-11-29 11:50:00 transfer_untitled_notes(parse_key(untitled_notes_options, 'add_label'), parse_key(untitled_notes_options, 'due_str_en')) 2023-11-29 11:50:00 File "/app/app.py", line 179, in transfer_untitled_notes 2023-11-29 11:50:00 todoist_api.add_task(content=untitled_note.text, due_string=due, due_lang='en', labels=todoist_labels) 2023-11-29 11:50:00 File "/venv/lib/python3.11/site-packages/todoist_api_python/api.py", line 59, in add_task 2023-11-29 11:50:00 task = post(self._session, endpoint, self._token, data=data) 2023-11-29 11:50:00 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2023-11-29 11:50:00 File "/venv/lib/python3.11/site-packages/todoist_api_python/http_requests.py", line 47, in post 2023-11-29 11:50:00 response.raise_for_status() 2023-11-29 11:50:00 File "/venv/lib/python3.11/site-packages/requests/models.py", line 1021, in raise_for_status 2023-11-29 11:50:00 raise HTTPError(http_error_msg, response=self) 2023-11-29 11:50:00 requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https://api.todoist.com/rest/v2/tasks

flecmart commented 10 months ago

Is this also using the docker image now? If not can you try that, too please?

Also can you share your config.yaml? Without API token and Google password of course.

I'll stop working on it for today but I will look into it the other day... I want to make this more robust for myself so thanks for the debug Infos.

TBTHEDBA @.***> schrieb am Mi., 29. Nov. 2023, 18:51:

I created a new test account on todoist.

The items are now being deleted from my keep but the app is still restarting at the same point and throwing the same error.

2023-11-29 11:49:59 2023-11-29 17:49:59 app-INFO: -> 2023-11-29 11:50:00 Traceback (most recent call last): 2023-11-29 11:50:00 File "/app/app.py", line 222, in 2023-11-29 11:50:00 update() 2023-11-29 11:50:00 File "/app/app.py", line 198, in update 2023-11-29 11:50:00 transfer_untitled_notes(parse_key(untitled_notes_options, 'add_label'), parse_key(untitled_notes_options, 'due_str_en')) 2023-11-29 11:50:00 File "/app/app.py", line 179, in transfer_untitled_notes 2023-11-29 11:50:00 todoist_api.add_task(content=untitled_note.text, due_string=due, due_lang='en', labels=todoist_labels) 2023-11-29 11:50:00 File "/venv/lib/python3.11/site-packages/todoist_api_python/api.py", line 59, in add_task 2023-11-29 11:50:00 task = post(self._session, endpoint, self._token, data=data) 2023-11-29 11:50:00 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2023-11-29 11:50:00 File "/venv/lib/python3.11/site-packages/todoist_api_python/http_requests.py", line 47, in post 2023-11-29 11:50:00 response.raise_for_status() 2023-11-29 11:50:00 File "/venv/lib/python3.11/site-packages/requests/models.py", line 1021, in raise_for_status 2023-11-29 11:50:00 raise HTTPError(http_error_msg, response=self) 2023-11-29 11:50:00 requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https://api.todoist.com/rest/v2/tasks

— Reply to this email directly, view it on GitHub https://github.com/flecmart/keep2todoist/issues/50#issuecomment-1832425374, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACNSHSYPKY4EUASQHNTTRNTYG5Y2FAVCNFSM6AAAAAA76LU2WCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMZSGQZDKMZXGQ . You are receiving this because you commented.Message ID: @.***>

TBTHEDBA commented 10 months ago

This is my first time using docker and I wasn't able to get your "Pre-built docker image" instructions to work for me.

Here is my config (renamed to .txt to allow upload) and just for full picture the error I get when trying to install with "Pre-built docker image"

error.txt config.txt

TBTHEDBA commented 10 months ago

I did get the "latest Image" running. Same error. It's at least "working" for sync at the moment though.

Had to learn how to add files to an image on windows.

Really need to get a dedicated system going for docker if I am going to continue using it.

TBTHEDBA commented 10 months ago

It stopped clearing from keep again. Wonder if I'm triggering some api limit because of how often it runs.

flecmart commented 10 months ago

Okay, 2 things I notice here:

The docker thing erroing was my bad. I got the command in the README.md slightly wrong.

Try: docker run -v ./config.yaml:/app/config.yaml --restart always ghcr.io/flecmart/keep2todoist:latest from the directory where your config.yaml is in.

Also from your config you have to strip everything from the example that does not match your lists. Try it with only your shopping list:

update_interval_s: 60
google_username: ----
google_password: -----
todoist_api_token: ----
healthcheck: # optional: configure some kind of healtcheck endpoint providing service monitoring, e.g. https://healthchecks.io/
  url: https://hc-ping.com/someuuid
  period_min: 30
untitled_notes: # optional: move all untitled notes to todoist inbox
  add_label: 'Sync' # required: add label to todoist note
  due_str_en: 'today' # optional: you can set a due date in english here
keep_lists:  # list your keep lists on this level
  - Shopping: # This has to match exatcly the name of your shopping list in keep
      sync_labels: false
      todoist_project: 'Shopping' # This has to match exatcly the name of your shopping list in todoist

Maybe the todoist api was throwing errors because it tried to access lists form my example config, that did not exist on your end?

flecmart commented 10 months ago

Can you try again with the newest docker image (1.6.0) or the latest pushed code? I implemented some error handling.

TBTHEDBA commented 10 months ago

The last update did it!

Thank you so much for the time spent around this.

I tried first with the new config.yaml + old code. Had same results.

Then new config.yaml + new code.

flecmart commented 10 months ago

Glad to help! I don't fully understand why the combination of both resolved your issue but I guess the code is more robust now. I close this for now. Feel free to open another issue if you still have problems.