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

Scribe doesn't add new posts and cannot edit existing ones #190

Closed
qomhmd opened this issue Oct 10, 2022 · 7 comments
Closed

Scribe doesn't add new posts and cannot edit existing ones #190

qomhmd opened this issue Oct 10, 2022 · 7 comments

Comments

@qomhmd
Copy link

qomhmd commented Oct 10, 2022

Edited: I reduced the number of includes by base64 encoding and embedding most of the pictures into data.json. But the other problems persist.


I should mention that I have added posts to data/content.json manually.

Nothing is shown after I click on the "add a new post" button but in browser console:

[ZeroBlog] Unknown command

When I edit an existing post:

Connection with UiServer Websocket was lost. Reconnecting...

Meanwhile, my browser console says:

{error: 'Too many files in content.json'}

Also, after some lines about loading image file:

Uncaught TypeError: this.requestSite(...).then is not a function
at CorsRequester.requestSiteAndContentJson (all.js?lang=en:2883:47)
at CorsRequester.requestSiteAndContentJson (all.js?lang=en:2748:59)
at CorsResolver.runStatusCheck (all.js?lang=en:3002:28)
at CorsResolver.handleImageProgress (all.js?lang=en:3055:16)
at CorsResolver.onImagesLoaded_Progress (all.js?lang=en:3112:27)
at CorsResolver.onImagesLoaded_Progress (all.js?lang=en:2928:59)
at ImagesLoaded. (all.js?lang=en:3138:24)
at proto.emitEvent (all.js?lang=en:326:14)
at ImagesLoaded.progress (all.js?lang=en:571:8)
at all.js?lang=en:557:13

@canewsin
Copy link
Collaborator

having too many includes is only way you can get this error.

ZeroNet/src/Ui/UiWebsocket.py

Lines 1062 to 1065 in d570354

inner_paths = [content_inner_path] + list(content.get("includes", {}).keys()) + list(content.get("files", {}).keys())
if len(inner_paths) > 100:
return {"error": "Too many files in content.json"}

@qomhmd
Copy link
Author

qomhmd commented Oct 11, 2022

Dear @canewsin

having too many includes is only way you can get this error.

I removed almost all files from the directory and the data.json, by base64 encoding and embedding; however, other problems and errors persist.

@slrslr
Copy link

slrslr commented Oct 12, 2022

@qomhmd IMBW but one can loose track of which errors do you mean, that is why it is handy to keep these mentioned in original posts(OP)/first post of this issue for example or link to a log file that you uploaded (i am usually using expired paste at https://bin.disroot.org/) where i exclude unrelated lines so developer spend less time. Also your post is missing ZNX version number and operating system, python version. BTW. after changes in site file/s are signed, i may restart ZN.

@qomhmd
Copy link
Author

qomhmd commented Oct 15, 2022

@slrslr Thank you for your recommendation. I don't know yet whether the log file encompasses any errors, or I am supposed to check the browser console also. Nothing resolved after restarting ZN. Now is it better to edit the OP or start a new issue?

@canewsin
Copy link
Collaborator

@qomhmd try checking next_post_id in data.json, sometimes this causes issue to not add new post.

@qomhmd
Copy link
Author

qomhmd commented Oct 16, 2022

@qomhmd try checking next_post_id in data.json, sometimes this causes issue to not add new post.

The id was correct beforehand; my last post_id is 449 and the next_post_id is 500.

May the problem be related to the discrepency of post_ids and date_published between posts? For instance there are:

  • a post with id = 449 and time = 1660491060, and
  • another post with id = 448 and time =1662049200 (as it was the modified date in the previous blogging system).
    As you see the id1 > id2 but the time1 < time2.

This log is selected from the original log file while ZeroNet was working in the offline mode, for a period following:

  1. pressing "New post" button whereas nothing happens (except a browser console log of [ZeroBlog] Unknown command).
  2. Then editing a post and trying to sign & publish, but ZN is disconnected and reconnected.

@qomhmd
Copy link
Author

qomhmd commented Nov 3, 2022

It seems that the culprit is adding images to the posts using markdown which would prevent us from adding new posts; if one deletes the related content, the functionality returns!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants