I wrote some new stuff and decided to publish them. When I did, I got this error:
web_delete: 0: (@pioyi/claus-processcreated-by-the-german-chemist-carl-friedrich-claus-it-makes-it-possible-to-convert-hydrogen-sulfide-from-natural-gas-to-elemental-sulfur-the-overall-reaction-can-be-descibed-as-follows-2-h-2s-plus-so-2-3s-plus-2h-20.bigb)
HTTP error status: 422
Error messages from server:
error: @pioyi/claus-processcreated-by-the-german-chemist-carl-friedrich-claus-it-makes-it-possible-to-convert-hydrogen-sulfide-from-natural-gas-to-elemental-sulfur-the-overall-reaction-can-be-descibed-as-follows-2-h-2s-plus-so-2-3s-plus-2h-20.bigb:1:205: unterminated literal argument
It refers to an old text that was contained in the bigb file. I remember that I interacted with this part of the file (or with a different one. I don't really remember) while I was writing the new one.
Kind of unxplainable, but my first guess was that I hadn't closed the latex segment somewhere. It turned out that everything has been closed as needed.
The guilty part in question:
==== Claus process

Created by the german chemist Carl Friedrich Claus, it makes it possible to convert hydrogen sulfide (from natural gas) to elemental sulfur. The overall reaction can be descibed as follows: 

$$2H_2S + SO_2 \rightarrow 3S + 2H_20$$
Am I missing something? I hope not!

Comments (15)

#1 by pioyi (@pioyi, 6) on 2024-09-20
Relevant information: If I delete the whole h4 or comment it out, the same error occurs. So it has to do with the already loaded text. That's very weird. The error doesn't seem to occur if I change other old parts of the text.
OK, I understood the problem now by inspecting the server DB. The root problem is that you uploaded something like (by accident or due to another ourbigbook bug):
= asdf $$

$$ qwer
which the server incorrectly accepted, such syntax should not be allowed.
When, the web_delete things is what happens when you delete an ID locally, but the server still contains it, so it deletes it from the server, which means: 1) mark as unlisted 2) make the body empty (remove all sub-ids like images) thus leaving you with:
= asdf $$
which is an unclosed string literal thus the error message.
I've now tried to clean that up from the DB, and I'll make sure that the offending syntax is forbidden both locally and on server (I've been adding several such checks in recent patches and I'll add this in as well, I was not aware of it).
Can you try ourbigbook --web again and see if it got fixed?
Some logs for my own reference:
                                                                                                                       path                                                                                                                       
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 @pioyi/claus-processcreated-by-the-german-chemist-carl-friedrich-claus-it-makes-it-possible-to-convert-hydrogen-sulfide-from-natural-gas-to-elemental-sulfur-the-overall-reaction-can-be-descibed-as-follows-2-h-2s-plus-so-2-3s-plus-2h-20.bigb
(1 row)

ourbigbook::DATABASE=> select "titleSource" from "File" where "path" LIKE '@pioyi/claus-processcreated-by-the-german-chemist-carl-friedrich-claus-it-makes-it-possible-to-convert-hydrogen-sulfide-from-natural-gas-to-elemental%';
                                                                                                 titleSource                                                                                                  
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 Claus processCreated by the german chemist Carl Friedrich Claus, it makes it possible to convert hydrogen sulfide (from natural gas) to elemental sulfur.The overall reaction can be descibed as follows: $$
(1 row)

ourbigbook::DATABASE=> select "bodySource" from "File" where "path" LIKE '@pioyi/claus-processcreated-by-the-german-chemist-carl-friedrich-claus-it-makes-it-possible-to-convert-hydrogen-sulfide-from-natural-gas-to-elemental%';
                                                                     bodySource                                                                      
-----------------------------------------------------------------------------------------------------------------------------------------------------
 2 H_2S + SO_2 -> 3S + 2H_20.                                                                                                                       +
 $$                                                                                                                                                 +
                                                                                                                                                    +
 The Claus' process served as a better replacement of the Frasch process, which obtained elemental sulfur from naturally found deposits underground.+
 
(1 row)

ourbigbook::DATABASE=> 
And how I tried to fix it:
ourbigbook::DATABASE=> update "File" set "bodySource" = '' where "path" LIKE '@pioyi/claus-processcreated-by-the-german-chemist-carl-friedrich-claus-it-makes-it-possible-to-convert-hydrogen-sulfide-from-natural-gas-to-elemental%';
UPDATE 1
ourbigbook::DATABASE=> update "File" set "titleSource" = 'claus-processcreated-by-the-german-chemist-carl-friedrich-claus-it-makes-it-possible-to-convert-hydrogen-sulfide-from-natural-gas-to-elemental-sulfur-the-overall-reaction-can-be-descibed-as-follows-2-h-2s-plus-so-2-3s-plus-2h-20' where "path" LIKE '@pioyi/claus-processcreated-by-the-german-chemist-carl-friedrich-claus-it-makes-it-possible-to-convert-hydrogen-sulfide-from-natural-gas-to-elemental%';
UPDATE 1
ourbigbook::DATABASE=> 
#3 by pioyi (@pioyi, 6) on 2024-09-20
Now I have got this error:
parentId did not match any known parent: "@pioyi/glass"
Glass is the new article. Weird because I didn't have the same problem with starch
Hmm can you give a bit more of the error logs and perhaps local source? Also double check that every file is reachable from the README.bigb via \\Include (I'm going to add a local check for this soon).
You could also consider pushing your local source to a public github repo to make it easier to inspect. Also a good idea to backup it in git anyways.
#6 by pioyi (@pioyi, 6) on 2024-09-20
I got it to work! There were two problems: First:
== Glass
\{scope\}
Random text here
I solved this by adding a new line after the {scope}
Then:
Random text here
=== Sub title
This gave me an error of: Headers are not allowed in OBB Web Articles. Fixed it by adding a new line again.
I do not work with \Include because I had trouble figuring out how to do that. I will try it in the future again hahahha. Now it's a big monolithic mess
#7 by pioyi (@pioyi, 6) on 2024-09-20
Don't mind the escape characters on the {scope}. This was not supposed to be written like that
OK awesome!
Both of these issues will soon start giving a much clearer and early local error since: github.com/ourbigbook/ourbigbook/commit/c12a72172de22dd356e8b4cb3a9d5fe67c0555f9 which I had recently implemented I just haven't released it yet, I'll ping it when I do for npm update.
Your files have to be really huge before being in a single file starts becoming a problem, so don't worry too much about it.
Previously cirosantilli.com was one humongous README.adoc, but it reached a point where the HTML was too slow to load lol.
That was part of the motivation of ourbigbook. But when you reach that point, ourbigbook makes the transition to multifile will be as seamless as it can be.
BTW you might want to use the {parent= syntax rather than header levels.
= My h1

= My h2
{parent=My h1}

= My h3
{parent=My h2}
This allows you to move chunks around very easily (within the same file, or to other files), without having to change a billion header levels each time.
OK, I've release a fix that will prevent the header newline issues from happening again on server and it also gives a local warning: github.com/ourbigbook/ourbigbook/commit/dc85cf067b926a73f4b17704afcfc29f75b164ea
Also consider:
npm install --save ourbigbook@latest
to get these local conversion updates and a few others I've added recently.
Thanks a lot once again for this report! Local to web upload is hard to get right, and I've had many issues myself, but I try to fix this with high priority, and new users stress it in different ways which is great.
A tip, during web upload, ourbigbook first splits the headers to separate files under out/web, so looking there can help understand what went wrong. But not something I want users to ever have to worry about of course, the goal is that if it converts locally without error, it should upload without error.
#10 by pioyi (@pioyi, 6) on 2025-01-24
I think I broke it again hahahhahaha
What are insane headers? I couldn't find any info in the documentation (only about insane block quote).
This is some relevant source code:
\= In the laboratory ($H_2S$)
\{parent= Production of hydrogen sulfide\}
And this is the error message:
error: out/web/bleach/hydrogen_sulfide/in-the-laboratory-h-2s.bigb:1:24: insane header cannot contain newlines
I should probably read the whole documentation once. (Probably this message won't be formatted well enough. This is another reason why I should read the docs)
Hello!
What are insane headers?
It's just using the cute (and recommended) syntax:
= My header
as opposed of the saner longer one:
\H[1][My header]
I should rename this cute but confusing terminology: docs.ourbigbook.com/#insane-macro-shortcut
Could you double check that the sample code is displaying correctly? Backslash in \= should escape the = and not create a header, so I'm assuming it is a formatting error? Or do you actually have backslash in your source code?
You can just dump basically any code directly inside backticks for your sample, you don't need to escape special characters there unless the code contains backticks itself
Also just to check, which commands are you running exactly? Just ourbigbook --web for upload or something else?
Also, consider updating ourbigbook with:
npm install --save ourbigbook@latest
I've been doing releases regularly, and I can see you are not at latest because now they output directory is called _out. Just in case.
#13 by pioyi (@pioyi, 6) on 2025-01-25
All good!
I installed ourbigbook globally instead of locally and it worked. (I am not very experienced with web development hahahhaha)
Sorry for that...
Also by the way I changed the top header's name from index to
= Pioyi's Index
From what I understood this is the new way of doing things
I think I understood something. Your logs contained:
out/web/bleach/hydrogen_sulfide/in-the-laboratory-h-2s.bigb
so probably this was a leftover from before we moved from out to _out, you should just remove that folder.
Installing ourbigbook locally is generally the best option, because this way you have a specific version for it on your package.json that you know conversion will work at. See e.g. the template repository for an example: github.com/ourbigbook/template But global install with -g should work too.
About the title of the first header of index.bigb, you can call it whatever you want. It will always have a magic empty ID + a synonym for the title e.g. pioyi-s-index. The title will only show up on static renders like github.com/ourbigbook/template, on ourbigbook.com you see "Home" and your username instead: ourbigbook.com/cirosantilli
What are insane headers?
I've also now renamed "insane" to "shorthand" everywhere e.g.: docs.ourbigbook.com/macro-shorthand-syntax Hopefully it will be less confusing for future users.
Sign up or sign in to comment on this issue.