Closed fferraro87 closed 4 years ago
Just reload the page again and it should work. The initialization process was simply not finished by the time you loaded the page.
That happens to me every time at the 'cold' load (after one day of nonvisiting page). Even though reload does the magic, it would not feel good for ordinary users. Is there any way to fix this permanently?
I have the same problem on my wikijs installation.
That happens to me every time at the 'cold' load (after one day of nonvisiting page). Even though reload does the magic, it would not feel good for ordinary users. Is there any way to fix this permanently?
CMIIW, but it's not the reload that does the magic. It's simply not finished loading stuff. You need to wait longer if you do cold load.
That happens to me every time at the 'cold' load (after one day of nonvisiting page). Even though reload does the magic, it would not feel good for ordinary users. Is there any way to fix this permanently?
You must be using a free Heroku instance? The solution is to upgrade to a plan where dynos don't sleep after X amount of time. Wiki.js isn't meant to be used in an environment that is not always on.
You must be using a free Heroku instance? The solution is to upgrade to a plan where dynos don't sleep after X amount of time. Wiki.js isn't meant to be used in an environment that is not always on.
No, that's traditional (LAMP) virtual server-based hosting with NodeJS handled through CPanel. Is there any way to estimate sufficiency of hosting infrastructure in such case?
That happens to me every time at the 'cold' load (after one day of nonvisiting page). Even though reload does the magic, it would not feel good for ordinary users. Is there any way to fix this permanently?
You must be using a free Heroku instance? The solution is to upgrade to a plan where dynos don't sleep after X amount of time. Wiki.js isn't meant to be used in an environment that is not always on.
I have installed it on Plesk Obsidian 18.0.27 with the official Nodejs addon.
Edit: OP has the same issue and has also installed wikijs on Plesk. @fferraro87: Did you resolve the issue? If yes, how?
That happens to me every time at the 'cold' load (after one day of nonvisiting page). Even though reload does the magic, it would not feel good for ordinary users. Is there any way to fix this permanently?
CMIIW, but it's not the reload that does the magic. It's simply not finished loading stuff. You need to wait longer if you do cold load.
I can confirm that only reloading gets rid of the error message. If you open the site, the error occurs and does not disappear until you reload the page (I've waited for an hour just to be sure).
Error Unknown authentication strategy "jwt"
is the only thing that stops wikijs from running great on Google Cloud Run, which is essentially free at most people's usage. I don't mind waiting 5 to 20 seconds for a cold start. $10/month to keep an idle server hot 24/7 is an exorbitant amount of money to pay. Dynamo looked like $25/month, I don't know much about heroku's pricing. The front-end javascript should just detect this specific error message and wait it out automatically. Crashing, red popups, and pressing refresh over and over again is a pretty bad user experience. Maybe it's possible to delay listening on the port until the server is ready?
I had exactly the same error Error Unknown authentication strategy "jwt"
for exactly the same reason: I host Wiki.js on a managed environment (o2switch). The node application is managed by Phusion Passenger that shutdown application if no request is made during X amount of time.
When Wiki.js is shutdown and a new request comes, the Unknown authentication strategy "jwt"
appears. If a new request is made just after, the error disappears and Wiki.js website is functional.
The boot of Wiki.js is done like this (kernel.js):
The HTTP server is started at step 2, at the end of master.js. The passport strategies are initialized at step 3, inside the postBootMaster function.
In a managed environment, if Wiki.js is shutdown, the first request wakes up the application. The request starts to be handled when step 2 is done because the HTTP server is running. But, as the passport strategies have not yet been initialized (step 3), this first request fails during jwt validation.
I wrote a bypass to avoid this behavior that is not acceptable on my environment. The new boot process of the application is as follow:
With theses changes, when the HTTP server starts at step 4, the passport strategies have been already loaded at step 3 and the jwt error does not occur anymore.
This solution works for me. I'm sure this doesn't fit in with the loading optimization philosophy as conceived by the application's creators, but it solves the error linked to the jwt strategy.
server/master.js: the start of HTTP and HTTPS servers are commented
server/core/kernel.js: adding of await operator and adding of the HTTP and HTTPS server start after postBootMaster() call
Hope this helps
Question I'm trying to install wiki.js on Plesk Obsidian with node.js support so i've download wiki.js.tar.gz and uncompressed on public folder then i've used node.js extension and i've set this configuration :
On /httpdocs there is content of wikijs.tar.gz downloaded here https://github.com/Requarks/wiki/releases/download/2.3.81/wiki-js.tar.gz
So i open http://wiki.underlow.com and wiki js setup start and i set email, password and URI. After Installation complete, i open home page and i've that error :
Host Info (please complete the following information): OS: Centos 7 Wiki.js version: 2.3.81 Database engine: 10.3.22-MariaDB