emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [BUG] org-element--cache Cached element is incorrect (ox-hugo) [9.6.10 (release_9.6.10 @ /home/gk/.emacs.d/lib/org/lisp/)]
@ 2023-10-23 19:44 George Kettleborough
  2023-10-24  9:32 ` Ihor Radchenko
  0 siblings, 1 reply; 5+ messages in thread
From: George Kettleborough @ 2023-10-23 19:44 UTC (permalink / raw)
  To: emacs-orgmode



Remember to cover the basics, that is, what you expected to happen and
what in fact did happen. You don't know how to make a good report? See

https://orgmode.org/manual/Feedback.html#Feedback

Your bug report will be posted to the Org mailing list.
------------------------------------------------------------------------

I've been having a problem where some of my exports get truncated
randomly at the end. I haven't been able to figure out the exact
problem, but by bisecting org-mode I found the problem appears in
072ddbc9 which sets `org-element--cache-self-verify' to t. By setting
this back to nil manually the truncation goes away, but the warning then
appears.

Interestingly I can only reproduce this when running emacs in batch
mode, not in regular mode.

I know ox-hugo and caching has come up before, but I don't think this
was the same problem as before.


Warning (org-element-cache): org-element--cache: (nil) Cached element is 
incorrect in *Ox-hugo Pre-processed programming.org *. (Cache tic up to 
date: "yes") Resetting.
If this warning appears regularly, please report the warning text to Org 
mode mailing list (M-x org-submit-bug-report).
The element is: "(headline (:raw-value \"Working on Multiple Web 
Projects with Docker Compose and Traefik\" :begin 85 :end 10406 
:pre-blank 0 :contents-begin 201 :contents-end 10405 :robust-begin 344 
:robust-end 10403 :level 1 :priority nil :tags (\"networking\" \"web\" 
\"development\" \"traefik\" \"docker\") :todo-keyword \"DONE\" 
:todo-type done :post-blank 1 :footnote-section-p nil :archivedp nil 
:commentedp nil :post-affiliated 85 :closed (timestamp (:type inactive 
:raw-value \"[2023-10-02 Mon 09:00]\" :year-start 2023 :month-start 10 
:day-start 2 :hour-start 9 :minute-start 0 :year-end 2023 :month-end 10 
:day-end 2 :hour-end 9 :minute-end 0 :begin 209 :end 231 :post-blank 0)) 
:EXPORT_FILE_NAME \"multiple-web-projects-traefik\" :EXPORT_HUGO_LASTMOD 
\"<2023-10-19 Thu 21:24>\" :title \"Working on Multiple Web Projects 
with Docker Compose and Traefik\" :mode nil :granularity element :cached 
t ...))"
The real element is: "(headline (:raw-value \"Working on Multiple Web 
Projects with Docker Compose and Traefik\" :begin 85 :end 10620 
:pre-blank 0 :contents-begin 201 :contents-end 10619 :robust-begin 344 
:robust-end 10617 :level 1 :priority nil :tags (\"networking\" \"web\" 
\"development\" \"traefik\" \"docker\") :todo-keyword \"DONE\" 
:todo-type done :post-blank 1 :footnote-section-p nil :archivedp nil 
:commentedp nil :post-affiliated 85 :closed (timestamp (:type inactive 
:raw-value \"[2023-10-02 Mon 09:00]\" :year-start 2023 :month-start 10 
:day-start 2 :hour-start 9 :minute-start 0 :year-end 2023 :month-end 10 
:day-end 2 :hour-end 9 :minute-end 0 :begin 209 :end 231 :post-blank 0)) 
:EXPORT_FILE_NAME \"multiple-web-projects-traefik\" :EXPORT_HUGO_LASTMOD 
\"<2023-10-19 Thu 21:24>\" :title \"Working on Multiple Web Projects 
with Docker Compose and Traefik\" :mode nil :granularity element :parent 
(org-data (:begin 1 :contents-begin 1 :contents-end 26390 :end 26390 
:robust-begin 3 :robust-end 26388 :post-blank 0 :post-affiliated 1 :path 
\"/home/gk/blog/content-org/programming.org\" :mode org-data :CATEGORY 
\"programming\"))))"
Cache around :begin:
(keyword (:key "HUGO_CATEGORIES" :value "programming" :begin 53 :end 85 
:post-blank 1 :post-affiliated 53 :mode nil :granularity element :cached 
t :parent (section (:begin 1 :end 85 :contents-begin 1 :contents-end 84 
:robust-begin 1 :robust-end 82 :post-blank 1 :post-affiliated 1 :mode 
first-section :granularity element :cached t :parent (org-data (:begin 1 
:contents-begin 1 :contents-end 26390 :end 26390 :robust-begin 3 
:robust-end 26388 :post-blank 0 :post-affiliated 1 :path 
"/home/gk/blog/content-org/programming.org" :mode org-data :CATEGORY 
"programming" :cached t))))))
(keyword (:key "HUGO_CATEGORIES" :value "programming" :begin 53 :end 85 
:post-blank 1 :post-affiliated 53 :mode nil :granularity element :cached 
t :parent (section (:begin 1 :end 85 :contents-begin 1 :contents-end 84 
:robust-begin 1 :robust-end 82 :post-blank 1 :post-affiliated 1 :mode 
first-section :granularity element :cached t :parent (org-data (:begin 1 
:contents-begin 1 :contents-end 26390 :end 26390 :robust-begin 3 
:robust-end 26388 :post-blank 0 :post-affiliated 1 :path 
"/home/gk/blog/content-org/programming.org" :mode org-data :CATEGORY 
"programming" :cached t))))))
nil

Emacs : GNU Emacs 29.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 
3.24.38, cairo version 1.17.8)
of 2023-10-02
Package: Org mode version 9.6.10 (release_9.6.10 @ 
/home/gk/.emacs.d/lib/org/lisp/)



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [BUG] org-element--cache Cached element is incorrect (ox-hugo) [9.6.10 (release_9.6.10 @ /home/gk/.emacs.d/lib/org/lisp/)]
  2023-10-23 19:44 [BUG] org-element--cache Cached element is incorrect (ox-hugo) [9.6.10 (release_9.6.10 @ /home/gk/.emacs.d/lib/org/lisp/)] George Kettleborough
@ 2023-10-24  9:32 ` Ihor Radchenko
       [not found]   ` <CAEZXJ2ijXSu1B8Cjg1Y6F74ypB8VDB-Sm_-TUSfwsY1hY1bzHg@mail.gmail.com>
  0 siblings, 1 reply; 5+ messages in thread
From: Ihor Radchenko @ 2023-10-24  9:32 UTC (permalink / raw)
  To: George Kettleborough; +Cc: emacs-orgmode

George Kettleborough <kettleg@gmail.com> writes:

> I've been having a problem where some of my exports get truncated
> randomly at the end. I haven't been able to figure out the exact
> problem, but by bisecting org-mode I found the problem appears in
> 072ddbc9 which sets `org-element--cache-self-verify' to t. By setting
> this back to nil manually the truncation goes away, but the warning then
> appears.
>
> Interestingly I can only reproduce this when running emacs in batch
> mode, not in regular mode.
>
> I know ox-hugo and caching has come up before, but I don't think this
> was the same problem as before.

Thanks for reporting!
Do you happen to have a reproducer?
See https://orgmode.org/manual/Feedback.html#Feedback

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [BUG] org-element--cache Cached element is incorrect (ox-hugo) [9.6.10 (release_9.6.10 @ /home/gk/.emacs.d/lib/org/lisp/)]
       [not found]   ` <CAEZXJ2ijXSu1B8Cjg1Y6F74ypB8VDB-Sm_-TUSfwsY1hY1bzHg@mail.gmail.com>
@ 2023-10-25  8:07     ` Ihor Radchenko
  2023-10-25 15:31       ` Kaushal Modi
  0 siblings, 1 reply; 5+ messages in thread
From: Ihor Radchenko @ 2023-10-25  8:07 UTC (permalink / raw)
  To: George Kettleborough; +Cc: emacs-orgmode

[ Adding Org ML back to CC ]

George Kettleborough <kettleg@gmail.com> writes:

> I really struggled to come up with a minimal example for this as the
> behaviour seemed truly bizarre!
>
> The best I have is my blog: <redacted>
>
> To build it (ie. export org files as md files), I run `cd content-org &&
> emacs --batch -Q --load ../publish.el --funcall gpk-publish-all`

I was able to reproduce.
Fixed, on bugfix, and, as a separate commit, on main (main diverges from
bugfix in this part of the code).

https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=a9e2a97ee
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=9c255cacf

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [BUG] org-element--cache Cached element is incorrect (ox-hugo) [9.6.10 (release_9.6.10 @ /home/gk/.emacs.d/lib/org/lisp/)]
  2023-10-25  8:07     ` Ihor Radchenko
@ 2023-10-25 15:31       ` Kaushal Modi
  2023-10-25 15:42         ` Ihor Radchenko
  0 siblings, 1 reply; 5+ messages in thread
From: Kaushal Modi @ 2023-10-25 15:31 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: George Kettleborough, emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 1061 bytes --]

On Wed, Oct 25, 2023 at 5:10 AM Ihor Radchenko <yantar92@posteo.net> wrote:

> [ Adding Org ML back to CC ]
>
> George Kettleborough <kettleg@gmail.com> writes:
>
> > I really struggled to come up with a minimal example for this as the
> > behaviour seemed truly bizarre!
> >
> > The best I have is my blog: <redacted>
> >
> > To build it (ie. export org files as md files), I run `cd content-org &&
> > emacs --batch -Q --load ../publish.el --funcall gpk-publish-all`
>
> I was able to reproduce.
> Fixed, on bugfix, and, as a separate commit, on main (main diverges from
> bugfix in this part of the code).
>
> https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=a9e2a97ee
> https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=9c255cacf
>
>
Thank you for that quick fix Ihor!!

And thank you George for bringing this issue to this ML.

From the commit log:

> This fixes ox-hugo bug when Org buffer copy cache is corrupted.

Ihor, is there a bug that needs to be addressed on the ox-hugo side as well?

[-- Attachment #2: Type: text/html, Size: 1783 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [BUG] org-element--cache Cached element is incorrect (ox-hugo) [9.6.10 (release_9.6.10 @ /home/gk/.emacs.d/lib/org/lisp/)]
  2023-10-25 15:31       ` Kaushal Modi
@ 2023-10-25 15:42         ` Ihor Radchenko
  0 siblings, 0 replies; 5+ messages in thread
From: Ihor Radchenko @ 2023-10-25 15:42 UTC (permalink / raw)
  To: Kaushal Modi; +Cc: George Kettleborough, emacs-orgmode

Kaushal Modi <kaushal.modi@gmail.com> writes:

> From the commit log:
>
>> This fixes ox-hugo bug when Org buffer copy cache is corrupted.
>
> Ihor, is there a bug that needs to be addressed on the ox-hugo side as well?

Not really. The bug what that `org-export-ignored-local-variables' did
not list some important variables to not copy.

If you want though, you may consider using the new
`org-export-with-buffer-copy' macro in
`org-hugo--get-pre-processed-buffer'. AFAIU, it should avoid the need to
copy-paste code from Org and is already available on stable Org release.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-10-25 15:42 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-23 19:44 [BUG] org-element--cache Cached element is incorrect (ox-hugo) [9.6.10 (release_9.6.10 @ /home/gk/.emacs.d/lib/org/lisp/)] George Kettleborough
2023-10-24  9:32 ` Ihor Radchenko
     [not found]   ` <CAEZXJ2ijXSu1B8Cjg1Y6F74ypB8VDB-Sm_-TUSfwsY1hY1bzHg@mail.gmail.com>
2023-10-25  8:07     ` Ihor Radchenko
2023-10-25 15:31       ` Kaushal Modi
2023-10-25 15:42         ` Ihor Radchenko

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).