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

Crash #64

Closed
wujastyk opened this issue Oct 24, 2023 · 16 comments
Closed

Crash #64

wujastyk opened this issue Oct 24, 2023 · 16 comments

Comments

@wujastyk
Copy link

When I try to collate Suśrutasaṃhitā Uttaratantra 31-66 together with the vulgate edition, like this, I'm getting,

Service Unavailable

The server is temporarily unable to service your request due to maintenance downtime or capacity problems. 
Please try again later.

Additionally, a 503 Service Unavailable error was encountered while trying to use an ErrorDocument to 
handle the request.

I get a good collate if I leave out witness A, the transcription of the vulgate printed edition, like this.

Is this a memory limitation at Saktumiva, or is there something wrong with my files? I hope it's not that they're too big. I'm loath to cut files in half yet again.

@chchch
Copy link
Owner

chchch commented Oct 24, 2023

It seems to work now! But it's slow... I guess it's a big file.

@wujastyk
Copy link
Author

I'm still getting "Service Unavailable" every time I add witness A (the vulgate) into the collation.

The files to be collated are about half a meg each:
image

@chchch
Copy link
Owner

chchch commented Oct 24, 2023

Hmm, it does seem to be a memory issue due to the creaky old server... but the good news is that it works if I turn on all the punctuation and orthographic filters: https://saktumiva.org/wiki/wujastyk/susrutasamhita/06-su.ut-31-end/provisional-edition_uttaratantra?upama_ver=h153eehd57

Turning on the filters means fewer differences, which means less to collate, which means it runs faster.

@wujastyk
Copy link
Author

Thanks, Charles. Your link led me to a Cloudflare timeout screen and on a second try to the same 503 message. :-(

This raises a couple of follow-on questions for me.

  1. Is there documenation on the meaning of the code-letters in the upama_ver URL string?
  2. Should I be thinking about installing Saktumiva on a server of my own? I have a virtual Linux machine in the cloud, courtesy of the Canada's Digital Research Infrastructure. Is there documentation about installing and setting up Saktumiva? E.g., Apache or Nginx? Is there a Docker image by any chance?

@chchch
Copy link
Owner

chchch commented Oct 27, 2023

I used the "trick" of collating each witness one at a time, so that those collations get cached. I guess when you changed the provisional edition, the cache got invalidated... here's what it looks like now:

image

The upama_ver string is an automatically-generated unique identifier that identifies a specific apparatus configuration — the base text, the other witnesses, and the filters that are turned on/off. It also corresponds to the name of the cache file that contains that cached version of that collation. So if no file has been changed, that cached version is displayed, which is a lot faster.

For installing saktumiva, it's not too difficult — you just need PHP and a web server, Apache or Nginx should be fine. I haven't made a Docker image yet... that's a good idea though. Peter Pasedach runs his own instance of saktumiva on his own server; the instructions are at the bottom of the readme: https://github.com/chchch/upama

@wujastyk
Copy link
Author

Okay, that's working for me again now. I started from Saktumiva / Startmap / Wiki and so on, so as to get a new cached file. Now I've got that string, h153eehd57 and applied it to my URLs, and I'm getting good results.
I didn't know about the caching. Does that mean that if I edit the files, h153eehd57 won't be true any longer?

@wujastyk
Copy link
Author

wujastyk commented Oct 27, 2023

I'm now having the same problem with the Cikitsāsthāna files: https://saktumiva.org/wiki/wujastyk/susrutasamhita/04-su.ci/provisional-edition_cikitsasthana?upama_ver=hj9jczgnwl

I tried the gradualistic approach you describe; didn't work.

... wait, I tried again and got a good collate with hjagfnmpg8. Phew!

@chchch
Copy link
Owner

chchch commented Oct 30, 2023

I got a collation here: https://saktumiva.org/wiki/wujastyk/susrutasamhita/04-su.ci/provisional-edition_cikitsasthana?upama_ver=hjddkbutpy

I basically had to collate each witness separately, one at a time, and then do one with all four. But ultimately this is an issue with the system struggling with big files... I'm actively working on v2 right now!

For the caching: the cache IDs actually identify a particular configuration — the witnesses collated and the filters applied. So even if you edit the files, the URL will still remain valid, and it will always give you an up-to-date collation. I think the only thing that would invalidate the URL is if you change the filenames.

PS I noticed that in witness A, you've broken up some compounds (śakala-kapāla...) that aren't broken in your edition (sakalakapāla...)

@wujastyk
Copy link
Author

I've got Apache2 and Dokuwiki running and I've copied the Saktumiva files to the /var/www/dokuwiki/lib/tpl and /var/www/dokuwiki/lib/plugins directories as instructed, and a blank sidebar.txt file in /var/www/dokuwiki/data/pages.

The result is here: http://206.12.96.209/doku.php?id=wiki:welcome

What should I do next?

Charles, I know you're not a general support desk for computer help :-) So you can just say no, or point me to documentation. Or perhaps I should be asking Peter, since he's done all this successfully.

@wujastyk
Copy link
Author

V2, hooray.
As for https://saktumiva.org/wiki/wujastyk/susrutasamhita/04-su.ci/provisional-edition_cikitsasthana?upama_ver=hjddkbutpy , it worked, until I added &upama_scroll=NNN, and then I got

 Sorry, that didn’t work.
Please try again or come back later.
500 Error. Internal Server Error. 

@chchch
Copy link
Owner

chchch commented Oct 30, 2023

I couldn't load your site for some reason... it timed out. In general though, the next step is to go to the Admin panel, "Extension manager", and enable to "Upama Plugin". Then, in "Configuration settings", change the template to "saktumiva".
On your own server, you probably want to make a https://www.php.net/manual/en/configuration.file.php file with max_execution_limit set pretty high... on my server it's set to 30 seconds which I can't change.

As for upama_ver=hjddkbutpy, I'm guessing it's probably at the very edge of the 30 second time limit, so it doesn't work reliably.

@wujastyk
Copy link
Author

Okay, the upama directory had root not www-data

ownership. Fixed that. Now dokuwiki is indeed seeing upama, but,
image

The error log is below:

2023-10-30 21:32:10     /var/www/dokuwiki/lib/plugins/upama/upama.php(4)        E_WARNING: require_once(DiffMatchPatch/DiffMatchPatch.php): Failed to open stream: No such file or directory
  #0 /var/www/dokuwiki/lib/plugins/upama/upama.php(4): dokuwiki\ErrorHandler::errorHandler()
  #1 /var/www/dokuwiki/lib/plugins/upama/upama.php(4): require_once()
  #2 /var/www/dokuwiki/lib/plugins/upama/action.php(5): require_once('...')
  #3 /var/www/dokuwiki/inc/load.php(156): require('...')
  #4 [internal function]: load_autoload()
  #5 /var/www/dokuwiki/inc/Extension/PluginController.php(107): class_exists()
  #6 /var/www/dokuwiki/inc/pluginutils.php(54): dokuwiki\Extension\PluginController->load()
  #7 /var/www/dokuwiki/inc/Extension/EventHandler.php(32): plugin_load()
  #8 /var/www/dokuwiki/inc/init.php(224): dokuwiki\Extension\EventHandler->__construct()
  #9 /var/www/dokuwiki/doku.php(36): require_once('...')
  #10 {main}
2023-10-30 21:32:10     /var/www/dokuwiki/lib/plugins/upama/upama.php(4)        Error: Failed opening required 'DiffMatchPatch/DiffMatchPatch.php' (include_path='.:/usr/share/php')
  #0 /var/www/dokuwiki/lib/plugins/upama/action.php(5): require_once()
  #1 /var/www/dokuwiki/inc/load.php(156): require('...')
  #2 [internal function]: load_autoload()
  #3 /var/www/dokuwiki/inc/Extension/PluginController.php(107): class_exists()
  #4 /var/www/dokuwiki/inc/pluginutils.php(54): dokuwiki\Extension\PluginController->load()
  #5 /var/www/dokuwiki/inc/Extension/EventHandler.php(32): plugin_load()
  #6 /var/www/dokuwiki/inc/init.php(224): dokuwiki\Extension\EventHandler->__construct()
  #7 /var/www/dokuwiki/doku.php(36): require_once('...')
  #8 {main}
2023-10-30 21:32:10     /var/www/dokuwiki/lib/plugins/upama/upama.php(51)       Error: Call to undefined function mb_internal_encoding()
  #0 /var/www/dokuwiki/lib/plugins/upama/action.php(157): Upama->__construct()
  #1 /var/www/dokuwiki/inc/Extension/EventHandler.php(80): action_plugin_upama->upama_export()
  #2 /var/www/dokuwiki/inc/Extension/Event.php(74): dokuwiki\Extension\EventHandler->process_event()
  #3 /var/www/dokuwiki/inc/ActionRouter.php(80): dokuwiki\Extension\Event->advise_before()
  #4 /var/www/dokuwiki/inc/ActionRouter.php(48): dokuwiki\ActionRouter->setupAction()
  #5 /var/www/dokuwiki/inc/ActionRouter.php(60): dokuwiki\ActionRouter->__construct()
  #6 /var/www/dokuwiki/inc/actions.php(16): dokuwiki\ActionRouter::getInstance()
  #7 /var/www/dokuwiki/doku.php(126): act_dispatch()
  #8 {main}

error.log

@chchch
Copy link
Owner

chchch commented Oct 30, 2023

Ah ok, you need the mbstring extension. If you're on Ubuntu and using php8.1, it's this: https://packages.ubuntu.com/jammy/php8.1-mbstring

@wujastyk
Copy link
Author

I was having crash problems with Cikitsāsthāna, Charles, and I used your "trick" of collating each witness one at a time. Got me a new URL code string, and a good compile.

Do we need a "clear cache" button?

@chchch
Copy link
Owner

chchch commented Nov 14, 2023

Hmm, usually the upama_ver string doesn't change...

Clearing the cache is actually kind of bad, since if all the cache files are deleted, the system has to collate each file again, which will probably time out.

On your server, try making a php.ini file and setting max_execution_limit to a couple minutes to see if that works.

@wujastyk
Copy link
Author

wujastyk commented Nov 14, 2023 via email

@chchch chchch closed this as completed Sep 18, 2024
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

2 participants