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

APIResponseError: Can't update a page that is archieved. You must unarchive the page before updating #377

Closed
marinalemosc opened this issue Nov 5, 2023 · 7 comments · Fixed by #448
Labels
enhancement New feature or request

Comments

@marinalemosc
Copy link

the issue
Hello, first thank you for this integration, this is very helpfull and has been in my academic path for a good time.
For a few weeks my page from zotero is not automatic syncing with my notion page, when I tried to manually syncing it showed the error:
APIResponseError: Can't update a page that is archieved. You must unarchive the page before updating
But the problem is: I don't know what is archived, my page in notion it up and my zotero remains the same.

Screenshots
image

@marinalemosc
Copy link
Author

I deleted my zotero, notion integration, notion database, and did it from the zero all over again. It worked but I still don't know which one of the steps make the difference nor what I did to make the error happen.
If anyone discover anything pls tell!

@dvanoni
Copy link
Owner

dvanoni commented Nov 6, 2023

Hi @marinalemosc, thanks for reporting this!

The fact that it was able to sync the first 20 items leads me to believe that maybe just one of the pages in Notion was archived at some point. Another possible cause of this error could be if you ever changed databases in the past—more details on that are in #241.

Unfortunately, Notero doesn't currently handle this scenario very gracefully nor provide a useful way to troubleshoot the issue. Some ideas I have for improving this:

  • Show the name of the item that's causing the error so that you can try to resolve the issue.
  • Instead of completely stopping the sync process when an item fails, try to continue syncing other items.

I'm glad you were able to work around the issue, but I'm sorry it was so involved!

@jonversusjon
Copy link

I just started having the same problem last week. It occurs any time I change the tags on an existing paper in zotero. The papers in question are not actually archived. I have never implemented an archive feature and as far as I can tell there is no archive property associated with any of my pages in notion.

@dvanoni
Copy link
Owner

dvanoni commented Nov 13, 2023

Hi @jonversusjon, thanks for reporting. Would you mind answering a couple questions to help me debug what might be causing the issue?

  • Is this error occurring for all of your papers, or is it only some of them?
  • Did you recently change the database you're syncing to?

And just to clarify about Notion's "archive" language since that term is only used in the API and not in the Notion app itself:

  • "Archiving" a page means deleting it in the Notion app
  • "Unarchiving" a page means restoring it from the Trash in the Notion app

So, if you deleted any of the pages in your Notion database at some point, it could cause this behavior.

@jonversusjon
Copy link

Ok I have some clues! It only occurs when I try to edit papers that were added prior to when i started noticing the issue. I just added a new paper to Zotero and Notero successfully added it to notion. I edited tags on that newly-added paper and Notero successfully updated the tags in notion.

Thank you for the clarification about "archiving" in notion. I checked my trash and lo! It is full of my entire paper database (or close to it).

What I noticed is the all the pages in the notion trash have name property values that value the format (short author, year). The following image is from my notion trash.

2023-11-12T20_14_05

All the pages for my Zotero collection in my notero db have name property values that include the title of the paper. The following image is from my active notero db.

2023-11-12T20_21_29_titles

Perhaps when I switched the format of the values for the name property it wiped out my notion notero db pages and reuploaded everything with the new format, but possibly the zotero side of the connector is still using the old page references.

@dvanoni
Copy link
Owner

dvanoni commented Nov 13, 2023

Thanks for the info, @jonversusjon! Those items in the trash are likely the culprit of the error message.

It is strange that they ended up in the trash somehow. When you changed the format for the name property, do you remember if you happened to clear out your database (or create a new database) at that time? Notero doesn't have any code that moves items to the trash, so the only other thing I can think of is some strange mishap on Notion's side.

There are two ways you should be able to resolve the issue:

  • In Notion, click the trash can icon on those pages in your trash to permanently delete them.
  • In Zotero, delete the "Notion" link attachment on items that are currently failing to sync.

Once you do either of these and attempt to sync items again, Notero should create new pages for you in your database.

Let me know if this helps!

@daandrews
Copy link

There are two ways you should be able to resolve the issue:

* In Notion, click the trash can icon on those pages in your trash to permanently delete them.

* In Zotero, delete the "Notion" link attachment on items that are currently failing to sync.

Once you do either of these and attempt to sync items again, Notero should create new pages for you in your database.

Let me know if this helps!

Ran into this today - can confirm that clearing the trash bin in Notion + deleting the notion link directly in Zotero solved my issue! I had about 30 papers that had been archived and when I deleted the attachment for those specific papers, the sync resumed successfully.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants