- Posts: 3
Question
Problem trying to install new instance - got it working, kinda...
- Gyapuko
-
Topic Author
- Offline
- New Member
-
When I tried to search for that error text, I found forum posts saying that the error was not setting the config.ini.php correctly (especially not setting the base_url properly), but I'm pretty sure mine is correct:
What am I doing wrong?
Please Log in or Create an account to join the conversation.
- Gyapuko
-
Topic Author
- Offline
- New Member
-
- Posts: 3

Please Log in or Create an account to join the conversation.
- bertkoor
-
- Offline
- Platinum Member
-
- Greetings from Utrecht, Holland
That php file resides in the app folder.
If you change that line to
then you may be able to figure out what parameter exactly is missing.
This is called from BadBotBlocker.php which at line 210 checks eg the user agent string and ip address headers.
Do you perhaps use a super secure browser which does not send any user agent string? webtrees cannot handle that.
stamboom.BertKoor.nl runs on webtrees v2.1.20
Please Log in or Create an account to join the conversation.
- Gyapuko
-
Topic Author
- Offline
- New Member
-
- Posts: 3
Just Firefox!
Yes, it looks like you're right. If I use Edge, it works.
This is, um, not good at all. It's clearly a bug - no other webpage fails this catastrophically in Firefox. Oh well, at least now I know what's going on.
Please Log in or Create an account to join the conversation.
- fisharebest
-
- Offline
- Administrator
-
The stack dump says line 209
Assuming you are using 2.1.17, here is line 209
github.com/fisharebest/webtrees/blob/2.1...dBotBlocker.php#L209
This is where it fetches the remote IP address - which should have been set earlier.
(FWIW, empty user-agent strings should be fine. I just tested it).
You can probably "suppress" this error by adding a second parameter to the function with a default value (e.g. '1.2.3.4');
But the real question is why the remote IP isn't detected.
We use a third-party library to do this - there is lots of complexity regarding proxies/headers.
The code is in the vendor folder, but you can see it here:
github.com/middlewares/client-ip/blob/v2...src/ClientIp.php#L71
Maybe you can investigate here?
Greg Roach - greg@subaqua.co.uk - @fisharebest@phpc.social - fisharebest.webtrees.net
Please Log in or Create an account to join the conversation.
- Møller
-
- Offline
- New Member
-
- Posts: 5
Please Log in or Create an account to join the conversation.
- Franz Frese
-
- Offline
- Elite Member
-
throw new HttpBadRequestException(I18N::translate('The parameter “%s” is missing.', $parameter));
by
throw new HttpBadRequestException('The parameter ' . $parameter . ' is missing.', );
meaning you get a untranslated error message.
Please Log in or Create an account to join the conversation.
- Møller
-
- Offline
- New Member
-
- Posts: 5
Uncaught Error: Call to a member function connection() on null in /var/www/html/webtrees/vendor/illuminate/database/Capsule/Manager.php:87 Stack trace: #0 /var/www/html/webtrees/app/Site.php(152): Illuminate\Database\Capsule\Manager::table() #1 /var/www/html/webtrees/app/Http/Middleware/HandleExceptions.php(155): Fisharebest\webtrees\Site::getPreference() #2 /var/www/html/webtrees/app/Http/Middleware/HandleExceptions.php(98): Fisharebest\webtrees\Http\Middleware\HandleExceptions->httpExceptionResponse() #3 /var/www/html/webtrees/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\webtrees\Http\Middleware\HandleExceptions->process() #4 /var/www/html/webtrees/app/Http/Middleware/BaseUrl.php(73): Middleland\Dispatcher->handle() #5 /var/www/html/webtrees/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\webtrees\Http\Middleware\BaseUrl->process() #6 /var/www/html/webtrees/app/Http/Middleware/ReadConfigIni.php(68): Middleland\Dispatcher->handle() #7 /var/www/html/webtrees/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\webtrees\Http\Middleware\ReadConfigIni->process() #8 /var/www/html/webtrees/app/Http/Middleware/SecurityHeaders.php(48): Middleland\Dispatcher->handle() #9 /var/www/html/webtrees/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\webtrees\Http\Middleware\SecurityHeaders->process() #10 /var/www/html/webtrees/app/Http/Middleware/EmitResponse.php(57): Middleland\Dispatcher->handle() #11 /var/www/html/webtrees/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\webtrees\Http\Middleware\EmitResponse->process() #12 /var/www/html/webtrees/vendor/oscarotero/middleland/src/Dispatcher.php(118): Middleland\Dispatcher->handle() #13 /var/www/html/webtrees/app/webtrees.php(275): Middleland\Dispatcher->dispatch() #14 /var/www/html/webtrees/app/webtrees.php(262): Fisharebest\webtrees\webtrees::dispatch() #15 /var/www/html/webtrees/index.php(51): Fisharebest\webtrees\webtrees->httpRequest() #16 {main} thrown
/var/www/html/webtrees/vendor/illuminate/database/Capsule/Manager.php: 87
Please Log in or Create an account to join the conversation.
- Franz Frese
-
- Offline
- Elite Member
-
Please Log in or Create an account to join the conversation.
- Møller
-
- Offline
- New Member
-
- Posts: 5
Please Log in or Create an account to join the conversation.
- bertkoor
-
- Offline
- Platinum Member
-
- Greetings from Utrecht, Holland
I think the error message means there is no connection with a database. First thing is to check the db properties in your config.ini.php ...
But there could be a "caused by" further down which you might wanna check as well.
stamboom.BertKoor.nl runs on webtrees v2.1.20
Please Log in or Create an account to join the conversation.
- Møller
-
- Offline
- New Member
-
- Posts: 5
Error: Typed static property Fisharebest\webtrees\I18N::$translator must not be accessed before initialization in /var/www/html/webtrees/app/I18N.php:347
Stack trace:
#0 /var/www/html/webtrees/app/Validator.php(382): Fisharebest\webtrees\I18N::translate()
#1 /var/www/html/webtrees/app/Http/Middleware/BadBotBlocker.php(230): Fisharebest\webtrees\Validator->string()
(...)
When I modified the code to skip the translator-step, it gave the error-stack you mentioned.
I have tried a lot of experimenting with the php-code and the problem seems to be that BadBotBlocker cannot work out where I'm coming from when I use Firefox.
After I went online and modified the base_url to match the internet-view of my server both Firefox and Edge are happy.
But when I use the local URL on my home network (mypi.local/webtrees) I still get the error using Firefox and no errors using Edge (but in Edge it now redirects to my external URL - the "base_url" from config.ini.php).
Please Log in or Create an account to join the conversation.
- fisharebest
-
- Offline
- Administrator
-
The bad-bot-blocker is looking for your IP address, which should have been set earlier - in /app/Http/Middleware/ClientIp.php
But it isn't set. The relevant code is probably this - in the call to parent::getLocalIp()
Maybe your configuration isn't setting REMOTE_ADDR correctly?
Greg Roach - greg@subaqua.co.uk - @fisharebest@phpc.social - fisharebest.webtrees.net
Please Log in or Create an account to join the conversation.
- Møller
-
- Offline
- New Member
-
- Posts: 5
Please Log in or Create an account to join the conversation.
- fisharebest
-
- Offline
- Administrator
-
Then I guess you need to look at your webserver config.
The "REMOTE_ADDR" header is added by your webserver configuration. With nginx, it is added by a line like this in the webserver config:
fastcgi_param REMOTE_ADDR $remote_addr;
I haven't used apache for a while, but guess it has something similar.
Maybe create a php_info() page, and you can see exactly what information is being passed to PHP.
Greg Roach - greg@subaqua.co.uk - @fisharebest@phpc.social - fisharebest.webtrees.net
Please Log in or Create an account to join the conversation.