Skip to main content


@Friendica Support

Is there a way to do some kind of general recheck of the settings inside the DB or something like that?

This server was hosted at a BETA testing.
In the local.config.php there was apparently a wrong setting:
'hostname' => 'subdomain.oldhosting.com:3306',<-- WRONG SETTING AT OLD PROVIDER!!!
'hostname' => 'localhost',<-- Correct setting!

Different things on that installation didn't work, like posting to the helpers forum, a 500 error showed up.

There are several bugs I encounter that don't look to me like "normal" in the sense that they should have been noticed and fixed by the community in any case already.

So now I wonder if there is some routine I can execute that checks settings that could have been set wrongly, be it by the error described above or other problems.

@TupambAdmin [stable] Not sure federation can work with "localhost" as the hostname value.

Friendica Support reshared this.

@Hypolite Petovan
He is talking about the database. So if this is on the same machine localhost is okay.

'database' => [
                'hostname' => '127.0.0.1',
@tom s Ah, thanks. If the database credentials are invalid, no page should load. If they are valid but incorrect after a file move, there’s no way we can detect this. 🤔

Friendica Support reshared this.

@Hypolite Petovan What, no way to detect? Sorry, find out if you can reach your database server and the correct database is the minimum for admins of friendica.
@tom s What constitutes your "correct" database between two equally valid database credentials is up to the administrator, we can't make this choice for you.

Friendica Support reshared this.

just changed to 127.0.0.1, let's see if something changes.
it is not really a good idea, to give 127.0.0.1 an other name than localhost in /etc/hosts.
Put/change ServerName in apache2.conf or simply just ignore this Start-Warning, when your virtualhost for friendica is correct.

silverwizard in the other help request wrote:

yeah - if the user is allowed access from only subdomain.oldhosting.com in mysql (check the users table) then you wont have access and your connection will be refused

How do I do that via SSH?

How would I run a command via SSH that checks all settings that could involve that issue?
@Tutorial

@utopiArte @tom s @Hypolite Petovan So if you do:

mysql -u root -p mysql
select * from user

You should get the user table for mysql, and then you should get a host - you should make sure that the host in /config/local.config.php matches that host

But yes - the core issue is that your mysql DB isn't being connected to and is refusing connections.

I managed to make it to the following but "nothing happens":

rootname@VPShosting:~# mysql friendicaDB
MariaDB [friendicaDB]> -u friendicaDBuser -pPASSWORD
    -> select * from user
    -> tutorial
(that didn't work out)
    -> select * from user tutorial
(that didn't work out neither)
    -> select * from tutorial
(nothing)
    ->

🤔
@utopiArte @silverwizard @tom s You didn’t follow the original mysql command that uses the mysql database. Additionally, each SQL query must be terminated by a semi-colon to be executed, otherwise it just adds a new line to the current query.

Friendica Support reshared this.

@utopiArte @tom s @Hypolite Petovan Yeah - that's the user table for the friendica database, not the mysql database.

If you are on Ubuntu, you should be able to run

sudo mysql mysql

And that should connect you to the mysql database as the root user.

Basically - we are looking at the DB itself, and not the friendica DB. As far as errors posted, Friendica is working fine.

@utopiArte @silverwizard @tom s Top: mysql.user. Bottom: friendicaDB.user

Both tables are named the same, but they aren’t part of the same schema.

Friendica Support reshared this.

@utopiArte @tom s @Hypolite Petovan Yeah, because mine is the user table in the mysql DB, vs yours being the user table in the friendica DB

resuming:

The setting

'database' =>[
		'hostname' => 'localhost',
	],

or
'database' =>[
		'hostname' => '127.0.0.1',
	],

don't change the behaviour of the site and work (more or less).

As shown in the spoiler above sudo mysql mysql shows for the mariaDB:
| localhost |

/etc/hosts

127.0.1.1 tupambae.org tupambae
127.0.0.1 localhost

/etc/hostname
tupambae.org

So if I understand this correct all these settings are ok.

Yet the site doesn't work for specific profiles like the forum pages created by this profile or some other issues.

@utopiArte @tom s @Hypolite Petovan Ok - so that's the obvious reason where it might go wrong. And you can confirm that the mysql service is listening? Does:
mysql -u friendicaUser -p -h localhost --protocol=TCP
work?

But generally - it could be a password issue or it could be username issue, or it could be something else, I don't know. But that's definitely the correct user in the DB.

> friendicaUser

is referring to the friendica user in question, for example the profile "Tutorial" of this site, or the username for the friendicaDB:

'database' =>[
		'username' => 'mysqlusername',
	],

?

This entry was edited (1 year ago)
@utopiArte @tom s @Hypolite Petovan I honestly don't understand the question since i'm unsure of your setup

I tried:
mysql -u mysqlusername -p -h localhost --protocol=TCP
"mysqlusername" as defined in the local.config.php

I don't get any result at all, not even an error message. The console simply displays the mysql welcom message and goes to the prompt:
MariaDB [(none)]>

@utopiArte @tom s @Hypolite Petovan ok - so TCP is working. Not having a password prompt seems odd. Something is going on - but no more I can tell you
@utopiArte @tom s @Hypolite Petovan ok - then the next question is - does the password you are using in the config work?

> i'm unsure of your setup

As a learning question, what do you mean by that?
What setups are their, are you used to or do you envision?

@utopiArte @tom s @Hypolite Petovan
so, your SQL server has users and DBs and a location. You asked about which password and which user - and I don't know. When you made your DB it sounds like you made a few users and a few DBs, but I don't know which one is correct. You're saying something about a tutorial user or DB which would be a thing you setup and I don't know how it relates.

Yeah that's about the main misunderstanding in my head.

There is:

  • The VPS user (like root)
  • The mysql user (like mysqlRoot(?) or friendicaDBuser -> 'username' => 'mysqlusername',)
  • The friendica site user ((like "tutorial" -> @Tutorial (that has problems that might be issues or even just friendica specific behaviors of a profile I didn't get as of now)

I guess your head simply slipped into mysql mode and talks from there while mine watches from the friendica user, goes to the VPS user and than wonders if you are talking about mysql specific things.

@utopiArte @tom s @Hypolite Petovan So you are debugging mysql because the error is a mysql one, everything else is completely unrelated

If you have 'username' => 'mysqlusername' in your config files that's your issue, because the mysql user is friendicaDBuser. You gotta fill in the local config with your values.

> So you are debugging mysql because the error is a mysql one, everything else is completely unrelated

ok's

I guess my "point" was that there could be something wrong in the specific mysql data of the user "tutorial".
>> "Yeah, because mine is the user table in the mysql DB, vs yours being the user table in the friendica DB"


> If you have 'username' => 'mysqlusername' in your config files that's your issue, because the mysql user is friendicaDBuser. You gotta fill in the local config with your values.

These (mysqlusername/friendicaDBuser) are only "Terms", place holders.

The settings data base name, data base user and password in the local.config.php are correct as for what I have seen for now. The only particularity is that data base name and data base user name are the same, that is a setting the previous BETA testing hoster had setup and I didn't changed that in the first place to not create problems.

The previous server was some kind of "apps" or SNAP setup (or "whatever"):

@utopiArte @tom s @Hypolite Petovan ok, but make sure they are correct
in this case, *no*, it's not an issue with the user. The initial connection is refused.

It looks like your mysql db user is "friendicaUser"? Is that correct?

Checked the DB name, DB user name and password and everything is correct.

Update on the php error log:

PHP error messages mentioned above:
thrown in/var/www/html/src/Database/Database.phponline191
only appears for two days and was printed several times.

This line (still) was printed only once:
[09-Nov-202308:28:21UTC]PHPDeprecated:Usingphp-function"is_string"asamodifierisdeprecatedandwillberemovedinafuturerelease.UseSmarty::registerPlugintoexplicitlyregisteracustommodifier.in/var/www/html/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_private_modifier.phponline114

Now there is a new one that might have come up because I just made an update/upgrade of the Ubuntu server and it looks like the time stamp UTC could be from that moment:

[25-Nov-2023 13:04:27 UTC] PHP Fatal error:  Allowed memory size of 268435456 bytes exhausted (tried to all>