Page MenuHomePhabricator

Internal Server Error from new articleinfo interface in XTools
Closed, ResolvedPublic3 Estimated Story Points

Description

If you try to look up any page, such as http://xtools.wmflabs.org/articleinfo/en.wikipedia.org/Thomas%20Jefferson, it gives an error:

500: Internal Server Error
An error has occurred within XTools.

The server said: An exception occured in driver: SQLSTATE[HY000] [2003] Can't connect to MySQL server on '127.0.0.1' (111)

Event Timeline

kaldari triaged this task as High priority.Jul 5 2017, 4:18 PM
kaldari moved this task from New & TBD Tickets to Needs Discussion on the Community-Tech board.
kaldari set the point value for this task to 3.
MusikAnimal claimed this task.
MusikAnimal moved this task from Ready to Q1 2018-19 on the Community-Tech-Sprint board.

Just needed to supply credentials for the tools-db database, which is where the checkwiki data is stored, which is used to identify "bugs" with an article.

@MusikAnimal: Can you make sure that is documented in the configuration instructions? Is this something that composer install should prompt for?

composer install doesn't prompt for labs-only parameters. Although, is this really a labs-only thing? 3rd party users could also be running a 'tools database' and be using checkuser couldn't they?

And I've added the three parameters to the docs:

database_toolsdb_host: ~
database_toolsdb_port: 3306
database_toolsdb_name: ~

composer install doesn't prompt for labs-only parameters. Although, is this really a labs-only thing? 3rd party users could also be running a 'tools database' and be using checkuser couldn't they?

If the checkwiki functionality is meant to be optional, we should actually make it optional. In other words, the page should still load if those config values aren't supplied.

And I've added the three parameters to the docs:
database_toolsdb_host: ~
database_toolsdb_port: 3306
database_toolsdb_name: ~

I don't see the info in the docs. Can you provide a link? I was thinking maybe we should explain how to use [[ https://github.com/x-tools/xtools-rebirth/blob/master/app/config/defaults.yml | app/config/defaults.yml ]] at https://xtools.readthedocs.io/en/latest/configuration.html.

(The readthedocs can sometimes lag I think. It's working now at https://xtools.readthedocs.io/en/latest/configuration.html )

The app/config/defaults.yml file isn't meant to be edited for individual installations; the keys there are meant to be copied into parameters.yml if they're to be modified.

Oh, except, if that's done and composer is run again, they get overwritten. :-(

I think we should change back to having all installation-specific values defined in parameters.yml (which is the normal Symfony thing to do), and handle default values in code. Then people installing XTools get prompted for all required values, and can just leave them empty if they don't apply.

The other matter, of still working even when there's no toolsdb connection, is very valid. I'll have a look at it, if @MusikAnimal doesn't get there before me. There are a few places to check.

http://xtools.wmflabs.org/articleinfo/en.wikipedia.org/Thomas%20Jefferson still gives the same database error for me, so reopening.

The app/config/defaults.yml file isn't meant to be edited for individual installations; the keys there are meant to be copied into parameters.yml if they're to be modified. Oh, except, if that's done and composer is run again, they get overwritten.

Yeah, that's what I would like us to add to the configuration documentation (if we're going to keep that system). Right now if you and MusikAnimal get killed by a mysterious assassin on the train to Montreal, I doubt the rest of us will easily be able to figure out how to keep XTools properly configured.

defaults.yml was my idea. In fact, most of the configuration setup is mine - I'll document it better.

Might be a good idea to explore which parameters actually need to be set for a non-wmf install of xtools. Those should be the ones in parameters.yml. I don't believe that composer install actually touches parameters.yml if there are no changes to parameters.default.yml, so down the road this should be a non-issue on wmf labs. Unless we change paramemters.

I'll do some more investigation on this issue.

composer install doesn't prompt for labs-only parameters. Although, is this really a labs-only thing? 3rd party users could also be running a 'tools database' and be using checkuser couldn't they?

If the checkwiki functionality is meant to be optional, we should actually make it optional. In other words, the page should still load if those config values aren't supplied.

On ArticleInfo, it only tries to use this database connection if it is a Labs installation. xtools.wmflabs.org obviously is a Labs installation, but the correct credentials were not supplied, so the error should be shown. I'm not sure if there is any confusion, but to be clear, this is for the Checkwiki project, which is unique to WMF wikis.

I don't believe that composer install actually touches parameters.yml if there are no changes to parameters.default.yml, so down the road this should be a non-issue on wmf labs. Unless we change paramemters.

No, it does unfortunately. Anything that's not in parameters.yml.dist is removed from parameters.yml.

I think there's also an issue when PageAssessments isn't installed (but I might be wrong about that; will investigate the error I'm just getting about the page_assessments table).

defaults.yml was my idea. In fact, most of the configuration setup is mine - I'll document it better.

Thanks Matthew!

It looks like this is no longer an issue since the relevant config variables have been moved to parameters.yml.dist. Does anything else need to be done? If not, please move to 'Needs Review' column.

It's true, this is probably solved. However, we're still getting this error in the logs because we haven't set up the XTools DB yet (although, that's sort of a different error I guess, just with the same result...)

@Samwilson: Is the XTools DB set up now? Still getting any of these errors?

Samwilson moved this task from In Development to Q1 2018-19 on the Community-Tech-Sprint board.

Yep, all is set up correctly now. The remaining other errors will be fixed separately. (@MusikAnimal you're happy with this?)

Yup! Hopefully ArticleInfo's legacy of internal server errors are coming to a close :)