WeblateOrg / weblate

Web based localization tool with tight version control integration.
https://weblate.org/
GNU General Public License v3.0
4.54k stars 1.01k forks source link

File content merge failed #1080

Closed martinpucik closed 8 years ago

martinpucik commented 8 years ago

Hi,

uploading translated XLIFF for existing language ends with this error:

File content merge failed: get() returned more than one Unit

Currently I don't have access to logs from Weblate.

Is there fix for this?

Thanks

nijel commented 8 years ago

This really sounds as a bug. What Weblate version is that?

martinpucik commented 8 years ago

So far I can tell is Weblate-2.6. I'll try to get to the server soon.

martinpucik commented 8 years ago

Ok, I got setup output:

 * Weblate weblate-2.5-58-gfeef730
 * Python 2.7.5
 * Django 1.9.1
 * six 1.10.0
 * python-social-auth 0.2.13
 * Translate Toolkit 1.11.0
 * Whoosh 2.7.2
 * Git 1.8.3.1
 * Pillow (PIL) 1.1.7
 * dateutil 1.5
 * lxml 3.2.1
 * django-crispy-forms 1.6.0
 * compressor 1.6
 * pyuca N/A
 * Database backends: django.db.backends.mysql
martinpucik commented 8 years ago

And in the logs is only:

ERROR Handled exception MultipleObjectsReturned: get() returned more than one Unit -- it returned 2!

nijel commented 8 years ago

That matches what I've expected. Can you try reimporting the translations? That should at least give better hint what causes the problem:

./manage.py loadpo --force --all

(Or you just problematic project/component instead of --all)

GrotzkyD commented 8 years ago

I get the same error on uploading an iOS string resource - related? Weblate version 2.5.0

What else do you need from me to check this?

nijel commented 8 years ago

@GrotzkyD The above comment applies to you as well. This is most likely caused by wrong import or duplicate strings in the source. Both will be detected by current Weblate versions, but older versions could have missed that and generate duplicate units.

Anyway this will not happen since 8944bc8dd7db50e73f94349dd13e44022c6b0f1a, so I'm closing this issue as it's fixed in git.