Skip to content
This repository has been archived by the owner on Jan 14, 2021. It is now read-only.

"Oops! 500" on package 'marble' #77

Closed
bitlord opened this issue Mar 29, 2014 · 10 comments
Closed

"Oops! 500" on package 'marble' #77

bitlord opened this issue Mar 29, 2014 · 10 comments

Comments

@bitlord
Copy link

bitlord commented Mar 29, 2014

Opening "Package info" from pkgdb gives error "500" on 'marble' package, I tested few other packages and it works ok.

link to reproduce this issue:
https://apps.fedoraproject.org/packages/marble

@ralphbean
Copy link
Contributor

Looks like marble never got indexed.

I checked the cronjob log in /var/log/fedoracommunity/cron-sync-package-index.log and it was getting Permission denied: '/var/cache/fedoracommunity/packages/tmp/var/cache/fedoracommunity/packages/tmp/rawhide-source/repomd.xml.old.tmp'

The dir was owned by root but it should have been owned by apache. I issued a chown; let's see if that fixes it. (FWIW, no new packages were being indexed because of this).

@bitlord
Copy link
Author

bitlord commented Mar 31, 2014

ok.
Not sure how often that cronjob runs, but still returns error "500".

ralphbean added a commit that referenced this issue Mar 31, 2014
This is for #77 so I can force the indexer to go back in time and pick
up 'marble' (which it somehow missed).
@ralphbean
Copy link
Contributor

@bitlord, well, the cronjob ran but it didn't pick it up. I'm trying to force it now.

@ralphbean
Copy link
Contributor

Learned new stuff: the issue is a UnicodeDecodeError coming from the template details.mak.

It is dying because marble has a little non-ascii character in its description:
http://pkgs.fedoraproject.org/cgit/marble.git/tree/marble.spec#n88

This is fedora-packages' fault. It should be able to handle this.

@ralphbean
Copy link
Contributor

Doh. I'm unable to reproduce this locally on F20. Will have to debug a fix in the staging environment.

@lmacken
Copy link
Contributor

lmacken commented Sep 23, 2014

A bunch of packages are hitting this now, it seems.

Module details_mak:28 in render_body
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe9' in position 853: ordinal not in range(128)

@lmacken
Copy link
Contributor

lmacken commented Sep 23, 2014

The package description that it's choking on in fedoracommunity/widgets/package/templates/details.mak is:

u'Marble is a Virtual Globe and World Atlas that you can use to learn more\\nabout Earth: You can pan and zoom around and you can look up places and\\nroads. A mouse click on a place label will provide th
e respective Wikipedia\\narticle.\\n\\nOf course it\\'s also possible to measure distances between locations or watch\\nthe current cloud cover. Marble offers different thematic maps: A classroom-\\nstyle topographic map, a satellite view,
 street map, earth at night and\\ntemperature and precipitation maps. All maps include a custom map key, so it\\ncan also be used as an educational tool for use in class-rooms. For\\neducational purposes you can also change date and time a
nd watch how the\\nstarry sky and the twilight zone on the map change.\\n\\nIn opposite to other virtual globes Marble also features multiple\\nprojections: Choose between a Flat Map ("Plate carr\\xe9"), Mercator or the Globe.'

Which is fetched from Xapian in fedoracommunity/widgets/package/overview.py. I'm guessing we're not properly decoding the description in our indexer.

@techtonik
Copy link
Contributor

I am looking at https://github.com/fedora-infra/fedora-packages/blob/develop/fedoracommunity/widgets/package/overview.py and can't find where description data is passed to template.

@ralphbean
Copy link
Contributor

I think it comes from self.description which gets set in here: https://github.com/fedora-infra/fedora-packages/blob/develop/fedoracommunity/widgets/package/overview.py#L28-L46

@techtonik
Copy link
Contributor

So, result comes from https://github.com/fedora-infra/fedora-packages/blob/develop/fedoracommunity/widgets/package/overview.py#L31 which reads some kind of document here - https://github.com/fedora-infra/fedora-packages/blob/develop/fedoracommunity/connectors/xapianconnector.py#L159, but doesn't decode it. To push this further, we need a binary dump of contents returned by .get_data() call and accurate representation of parsed JSON.

It may happen that there is an error in Python documentation of https://docs.python.org/2/library/json.html#json.loads and json.loads never tries to decode utf-8 to unicode leaving everything as-is.

@ralphbean ralphbean mentioned this issue Nov 2, 2014
ralphbean added a commit that referenced this issue Nov 6, 2014
This should fix #77.

For unknown reasons, some combination of mako and tw2 are defaulting to
ascii encodings.  That causes issues as plenty of spec files have
descriptions including non-ascii characters (as they should).
tparks5 pushed a commit to tparks5/tor-stem that referenced this issue May 5, 2017
Our ticket got closed in favor of...

  fedora-infra/fedora-packages#77

Including a TODO note to check in on that someday in the future (looks like it
won't be fixed any time soon).
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants