After going "Back" and refreshing all seems fine. The modification was commited 
and as a side effect the portuguese translation is now in sync with the content 
of the git repository:

https://weblate.securedrop.club/translate/securedrop/securedrop/pt_BR/?checksum=67cc53e1eb479f48

However the search index no longer finds "doc_num" in the source string 
alghouth it finds "documentos" in the target string.

I tried to update the index but an error happened, most likely because (as the 
message suggests) it is in use.

$ sudo docker-compose run weblate rebuild_index --all --clean
WARNING: Found orphan containers (weblate_https-portal_1) for this project. If 
you removed or renamed this service in your compose file, you can run this 
command with the --remove-orphans flag to clean it up.
Starting weblate_cache_1 ...
Starting weblate_cache_1 ... done
Postgres is up
Processing 0.0%
Traceback (most recent call last):
  File "/usr/local/bin/weblate", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python2.7/dist-packages/weblate/runner.py", line 33, in 
main
    execute_from_command_line(argv)
  File 
"/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", 
line 364, in execute_from_command_line
    utility.execute()
  File 
"/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", 
line 356, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", 
line 283, in run_from_argv
    self.execute(*args, **cmd_options)
  File 
"/usr/local/lib/python2.7/dist-packages/weblate/trans/management/commands/__init__.py",
 line 42, in execute
    super(WeblateCommand, self).execute(*args, **options)
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", 
line 330, in execute
    output = self.handle(*args, **options)
  File 
"/usr/local/lib/python2.7/dist-packages/weblate/trans/management/commands/rebuild_index.py",
 line 78, in handle
    target_writers[lang] = get_target_index(lang).writer()
  File "/usr/local/lib/python2.7/dist-packages/whoosh/index.py", line 464, in 
writer
    return SegmentWriter(self, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/whoosh/writing.py", line 515, in 
__init__
    raise LockError
whoosh.index.LockError

I tried again (twice) and got

$ sudo docker-compose run weblate rebuild_index --all --clean
WARNING: Found orphan containers (weblate_https-portal_1) for this project. If 
you removed or renamed this service in your compose file, you can run this 
command with the --remove-orphans flag to clean it up.
Starting weblate_cache_1 ...
Starting weblate_cache_1 ... done
Postgres is up
Processing 0.0%
Processing 25.6%
Processing 51.2%
Processing 76.8%
Operation completed
Traceback (most recent call last):
  File "/usr/local/bin/weblate", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python2.7/dist-packages/weblate/runner.py", line 33, in 
main
    execute_from_command_line(argv)
  File 
"/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", 
line 364, in execute_from_command_line
    utility.execute()
  File 
"/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", 
line 356, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", 
line 283, in run_from_argv
    self.execute(*args, **cmd_options)
  File 
"/usr/local/lib/python2.7/dist-packages/weblate/trans/management/commands/__init__.py",
 line 42, in execute
    super(WeblateCommand, self).execute(*args, **options)
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", 
line 330, in execute
    output = self.handle(*args, **options)
  File 
"/usr/local/lib/python2.7/dist-packages/weblate/trans/management/commands/rebuild_index.py",
 line 87, in handle
    source_writer.commit()
  File "/usr/local/lib/python2.7/dist-packages/whoosh/writing.py", line 927, in 
commit
    finalsegments.append(self._finalize_segment())
  File "/usr/local/lib/python2.7/dist-packages/whoosh/writing.py", line 866, in 
_finalize_segment
    self._flush_segment()
  File "/usr/local/lib/python2.7/dist-packages/whoosh/writing.py", line 830, in 
_flush_segment
    self.perdocwriter.close()
  File "/usr/local/lib/python2.7/dist-packages/whoosh/codec/whoosh3.py", line 
267, in close
    self._cols.save_as_files(self._storage, self._column_filename)
  File "/usr/local/lib/python2.7/dist-packages/whoosh/filedb/compound.py", line 
297, in save_as_files
    for name, blocks in self._readback():
  File "/usr/local/lib/python2.7/dist-packages/whoosh/filedb/compound.py", line 
279, in _readback
    self._tempstorage.delete_file(self._tempname)
  File "/usr/local/lib/python2.7/dist-packages/whoosh/filedb/filestore.py", 
line 544, in delete_file
    os.remove(self._fpath(name))
OSError: [Errno 2] No such file or directory: 
'/app/data/whoosh/source.tmp/rjjodql1rju73bamxxgzztge8t9t.ctmp'


On 12/02/2017 11:22 AM, Loic Dachary wrote:
> After I updated a translation (fr_FR) I clicked on 
> https://weblate.securedrop.club/commit/securedrop/securedrop/fr/ and got 
> another stack trace:
> 
> OSError at /commit/securedrop/securedrop/fr/
> 
> [Errno 2] No such file or directory: '/app/data/whoosh/source.tmp'
> 
> Request Method:       POST
> Request URL:  https://weblate.securedrop.club/commit/securedrop/securedrop/fr/
> Django Version:       1.11.6
> Exception Type:       OSError
> Exception Value:      
> 
> [Errno 2] No such file or directory: '/app/data/whoosh/source.tmp'
> 
> Exception Location:   
> /usr/local/lib/python2.7/dist-packages/whoosh/filedb/filestore.py in list, 
> line 525
> Python Executable:    /usr/bin/uwsgi-core
> Python Version:       2.7.13
> Python Path:  
> 
> ['/usr/local/lib/python2.7/dist-packages/',
>  '.',
>  '',
>  '/usr/lib/python2.7',
>  '/usr/lib/python2.7/plat-x86_64-linux-gnu',
>  '/usr/lib/python2.7/lib-tk',
>  '/usr/lib/python2.7/lib-old',
>  '/usr/lib/python2.7/lib-dynload',
>  '/usr/local/lib/python2.7/dist-packages',
>  '/usr/lib/python2.7/dist-packages']
> 
> Server time:  Sat, 2 Dec 2017 10:20:35 +0000
> 
> Environment:
> 
> 
> Request Method: POST
> Request URL: https://weblate.securedrop.club/commit/securedrop/securedrop/fr/
> 
> Django Version: 1.11.6
> Python Version: 2.7.13
> Installed Applications:
> (u'django.contrib.auth',
>  u'django.contrib.contenttypes',
>  u'django.contrib.sessions',
>  u'django.contrib.sites',
>  u'django.contrib.messages',
>  u'django.contrib.staticfiles',
>  u'django.contrib.admin.apps.SimpleAdminConfig',
>  u'django.contrib.admindocs',
>  u'django.contrib.sitemaps',
>  u'social_django',
>  u'crispy_forms',
>  u'compressor',
>  u'rest_framework',
>  u'rest_framework.authtoken',
>  u'weblate.trans',
>  u'weblate.lang',
>  u'weblate.permissions',
>  u'weblate.screenshots',
>  u'weblate.accounts',
>  u'weblate.utils',
>  u'weblate.wladmin',
>  u'weblate',
>  u'weblate.gitexport')
> Installed Middleware:
> (u'django.contrib.sessions.middleware.SessionMiddleware',
>  u'django.middleware.common.CommonMiddleware',
>  u'django.middleware.locale.LocaleMiddleware',
>  u'django.middleware.csrf.CsrfViewMiddleware',
>  u'weblate.accounts.middleware.AuthenticationMiddleware',
>  u'django.contrib.messages.middleware.MessageMiddleware',
>  u'django.middleware.clickjacking.XFrameOptionsMiddleware',
>  u'social_django.middleware.SocialAuthExceptionMiddleware',
>  u'weblate.accounts.middleware.RequireLoginMiddleware',
>  u'weblate.middleware.SecurityMiddleware')
> 
> 
> 
> Traceback:
> 
> File 
> "/usr/local/lib/python2.7/dist-packages/django/core/handlers/exception.py" in 
> inner
>   41.             response = get_response(request)
> 
> File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py" in 
> _legacy_get_response
>   249.             response = self._get_response(request)
> 
> File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py" in 
> _get_response
>   187.                 response = self.process_exception_by_middleware(e, 
> request)
> 
> File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py" in 
> _get_response
>   185.                 response = wrapped_callback(request, *callback_args, 
> **callback_kwargs)
> 
> File 
> "/usr/local/lib/python2.7/dist-packages/django/contrib/auth/decorators.py" in 
> _wrapped_view
>   23.                 return view_func(request, *args, **kwargs)
> 
> File "/usr/local/lib/python2.7/dist-packages/django/views/decorators/http.py" 
> in inner
>   40.             return func(request, *args, **kwargs)
> 
> File "/usr/local/lib/python2.7/dist-packages/weblate/trans/views/git.py" in 
> commit_translation
>   135.     return perform_commit(request, obj)
> 
> File "/usr/local/lib/python2.7/dist-packages/weblate/trans/views/git.py" in 
> perform_commit
>   67.         request,
> 
> File "/usr/local/lib/python2.7/dist-packages/weblate/trans/views/git.py" in 
> execute_locked
>   44.         result = call(*args, **kwargs)
> 
> File 
> "/usr/local/lib/python2.7/dist-packages/weblate/trans/models/translation.py" 
> in commit_pending
>   641.             request, last, self.last_change, True, True, skip_push
> 
> File 
> "/usr/local/lib/python2.7/dist-packages/weblate/trans/models/translation.py" 
> in git_commit
>   770.                 self.subproject.push_if_needed(request)
> 
> File 
> "/usr/local/lib/python2.7/dist-packages/weblate/trans/models/subproject.py" 
> in push_if_needed
>   765.             request, force_commit=False, do_update=do_update
> 
> File 
> "/usr/local/lib/python2.7/dist-packages/weblate/trans/models/subproject.py" 
> in wrapper
>   111.         return func(self, *args, **kwargs)
> 
> File 
> "/usr/local/lib/python2.7/dist-packages/weblate/trans/models/subproject.py" 
> in do_push
>   789.             self.do_update(request)
> 
> File 
> "/usr/local/lib/python2.7/dist-packages/weblate/trans/models/subproject.py" 
> in wrapper
>   111.         return func(self, *args, **kwargs)
> 
> File 
> "/usr/local/lib/python2.7/dist-packages/weblate/trans/models/subproject.py" 
> in do_update
>   739.             self.create_translations(request=request)
> 
> File 
> "/usr/local/lib/python2.7/dist-packages/weblate/trans/models/subproject.py" 
> in create_translations
>   1051.                     self, lang, code, path, force, request=request
> 
> File 
> "/usr/local/lib/python2.7/dist-packages/weblate/trans/models/translation.py" 
> in check_sync
>   72.         translation.check_sync(force, request=request)
> 
> File 
> "/usr/local/lib/python2.7/dist-packages/weblate/trans/models/translation.py" 
> in check_sync
>   452.                 self, unit, pos
> 
> File "/usr/local/lib/python2.7/dist-packages/weblate/trans/models/unit.py" in 
> update_from_unit
>   110.         dbunit.update_from_unit(unit, pos, created)
> 
> File "/usr/local/lib/python2.7/dist-packages/weblate/trans/models/unit.py" in 
> update_from_unit
>   547.             same_state=same_state
> 
> File "/usr/local/lib/python2.7/dist-packages/weblate/trans/models/unit.py" in 
> save
>   819.             update_index_unit(self)
> 
> File "/usr/local/lib/python2.7/dist-packages/weblate/trans/search.py" in 
> update_index_unit
>   205.         update_source_unit_index(writer, unit)
> 
> File "/usr/local/lib/python2.7/dist-packages/whoosh/writing.py" in __exit__
>   210.             self.commit()
> 
> File "/usr/local/lib/python2.7/dist-packages/whoosh/writing.py" in commit
>   1037.             self.writer.commit(*args, **kwargs)
> 
> File "/usr/local/lib/python2.7/dist-packages/whoosh/writing.py" in commit
>   935.         self._finish()
> 
> File "/usr/local/lib/python2.7/dist-packages/whoosh/writing.py" in _finish
>   884.         self._tempstorage.destroy()
> 
> File "/usr/local/lib/python2.7/dist-packages/whoosh/filedb/filestore.py" in 
> destroy
>   458.         self.clean()
> 
> File "/usr/local/lib/python2.7/dist-packages/whoosh/filedb/filestore.py" in 
> clean
>   515.         files = self.list()
> 
> File "/usr/local/lib/python2.7/dist-packages/whoosh/filedb/filestore.py" in 
> list
>   525.             files = os.listdir(self.folder)
> 
> Exception Type: OSError at /commit/securedrop/securedrop/fr/
> Exception Value: [Errno 2] No such file or directory: 
> '/app/data/whoosh/source.tmp'
> 
> 
> On 12/02/2017 11:11 AM, Loic Dachary wrote:
>> https://weblate.securedrop.club/download/securedrop/securedrop/pt_BR/ shows
>>
>> #: journalist_templates/_source_row.html:19
>> #, fuzzy
>> #| msgid "docs {doc_num}"
>> msgid "{doc_num} docs"
>> msgstr "documentos {doc_num}"
>>
>> which is not what the weblate interface show (it still shows "docs {doc_num}"
>>
>> It looks like the database is now out of sync with the content of some po
>>
>> On 12/02/2017 10:54 AM, Loic Dachary wrote:
>>> After taking a closer look I see a page ( 
>>> https://weblate.securedrop.club/translate/securedrop/securedrop/pt_BR/?checksum=5031e6011d964568
>>>  ) which is out of sync with the git repository.
>>>
>>> The problem may have been a race between me clicking Pull and a webhook 
>>> doing the same. If those are not protected by a lock maybe the two update 
>>> raced against each other and one could not remove the file that another 
>>> already removed ? Wild guess on my part.
>>>
>>> On 12/02/2017 10:22 AM, Loic Dachary wrote:
>>>> Hi,
>>>>
>>>> Today I clicked "Pull" in the commit panel and got the following stack 
>>>> trace. I did the same a week ago and it all went fine. I then clicked 
>>>> "Back" and refreshed and all seems fine. Not sure what happened but here 
>>>> it is, in case this ring a bell.
>>>>
>>>> Cheers
>>>>
>>>> OSError at /update/securedrop/securedrop/
>>>>
>>>> [Errno 2] No such file or directory: 
>>>> '/app/data/whoosh/source.tmp/sym43el2gyeazkq9axmw31u352k0.ctmp'
>>>>
>>>> Request Method:    POST
>>>> Request URL:       
>>>> https://weblate.securedrop.club/update/securedrop/securedrop/
>>>> Django Version:    1.11.6
>>>> Exception Type:    OSError
>>>> Exception Value:   
>>>>
>>>> [Errno 2] No such file or directory: 
>>>> '/app/data/whoosh/source.tmp/sym43el2gyeazkq9axmw31u352k0.ctmp'
>>>>
>>>> Exception Location:        
>>>> /usr/local/lib/python2.7/dist-packages/whoosh/filedb/filestore.py in 
>>>> delete_file, line 544
>>>> Python Executable:         /usr/bin/uwsgi-core
>>>> Python Version:    2.7.13
>>>> Python Path:       
>>>>
>>>> ['/usr/local/lib/python2.7/dist-packages/',
>>>>  '.',
>>>>  '',
>>>>  '/usr/lib/python2.7',
>>>>  '/usr/lib/python2.7/plat-x86_64-linux-gnu',
>>>>  '/usr/lib/python2.7/lib-tk',
>>>>  '/usr/lib/python2.7/lib-old',
>>>>  '/usr/lib/python2.7/lib-dynload',
>>>>  '/usr/local/lib/python2.7/dist-packages',
>>>>  '/usr/lib/python2.7/dist-packages']
>>>>
>>>> Server time:       Sat, 2 Dec 2017 09:18:16 +0000
>>>>
>>>> Environment:
>>>>
>>>>
>>>> Request Method: POST
>>>> Request URL: https://weblate.securedrop.club/update/securedrop/securedrop/
>>>>
>>>> Django Version: 1.11.6
>>>> Python Version: 2.7.13
>>>> Installed Applications:
>>>> (u'django.contrib.auth',
>>>>  u'django.contrib.contenttypes',
>>>>  u'django.contrib.sessions',
>>>>  u'django.contrib.sites',
>>>>  u'django.contrib.messages',
>>>>  u'django.contrib.staticfiles',
>>>>  u'django.contrib.admin.apps.SimpleAdminConfig',
>>>>  u'django.contrib.admindocs',
>>>>  u'django.contrib.sitemaps',
>>>>  u'social_django',
>>>>  u'crispy_forms',
>>>>  u'compressor',
>>>>  u'rest_framework',
>>>>  u'rest_framework.authtoken',
>>>>  u'weblate.trans',
>>>>  u'weblate.lang',
>>>>  u'weblate.permissions',
>>>>  u'weblate.screenshots',
>>>>  u'weblate.accounts',
>>>>  u'weblate.utils',
>>>>  u'weblate.wladmin',
>>>>  u'weblate',
>>>>  u'weblate.gitexport')
>>>> Installed Middleware:
>>>> (u'django.contrib.sessions.middleware.SessionMiddleware',
>>>>  u'django.middleware.common.CommonMiddleware',
>>>>  u'django.middleware.locale.LocaleMiddleware',
>>>>  u'django.middleware.csrf.CsrfViewMiddleware',
>>>>  u'weblate.accounts.middleware.AuthenticationMiddleware',
>>>>  u'django.contrib.messages.middleware.MessageMiddleware',
>>>>  u'django.middleware.clickjacking.XFrameOptionsMiddleware',
>>>>  u'social_django.middleware.SocialAuthExceptionMiddleware',
>>>>  u'weblate.accounts.middleware.RequireLoginMiddleware',
>>>>  u'weblate.middleware.SecurityMiddleware')
>>>>
>>>>
>>>>
>>>> Traceback:
>>>>
>>>> File 
>>>> "/usr/local/lib/python2.7/dist-packages/django/core/handlers/exception.py" 
>>>> in inner
>>>>   41.             response = get_response(request)
>>>>
>>>> File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py" 
>>>> in _legacy_get_response
>>>>   249.             response = self._get_response(request)
>>>>
>>>> File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py" 
>>>> in _get_response
>>>>   187.                 response = self.process_exception_by_middleware(e, 
>>>> request)
>>>>
>>>> File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py" 
>>>> in _get_response
>>>>   185.                 response = wrapped_callback(request, 
>>>> *callback_args, **callback_kwargs)
>>>>
>>>> File 
>>>> "/usr/local/lib/python2.7/dist-packages/django/contrib/auth/decorators.py" 
>>>> in _wrapped_view
>>>>   23.                 return view_func(request, *args, **kwargs)
>>>>
>>>> File 
>>>> "/usr/local/lib/python2.7/dist-packages/django/views/decorators/http.py" 
>>>> in inner
>>>>   40.             return func(request, *args, **kwargs)
>>>>
>>>> File "/usr/local/lib/python2.7/dist-packages/weblate/trans/views/git.py" 
>>>> in update_subproject
>>>>   157.     return perform_update(request, obj)
>>>>
>>>> File "/usr/local/lib/python2.7/dist-packages/weblate/trans/views/git.py" 
>>>> in perform_update
>>>>   79.         method=request.GET.get('method'),
>>>>
>>>> File "/usr/local/lib/python2.7/dist-packages/weblate/trans/views/git.py" 
>>>> in execute_locked
>>>>   44.         result = call(*args, **kwargs)
>>>>
>>>> File 
>>>> "/usr/local/lib/python2.7/dist-packages/weblate/trans/models/subproject.py"
>>>>  in wrapper
>>>>   111.         return func(self, *args, **kwargs)
>>>>
>>>> File 
>>>> "/usr/local/lib/python2.7/dist-packages/weblate/trans/models/subproject.py"
>>>>  in do_update
>>>>   739.             self.create_translations(request=request)
>>>>
>>>> File 
>>>> "/usr/local/lib/python2.7/dist-packages/weblate/trans/models/subproject.py"
>>>>  in create_translations
>>>>   1051.                     self, lang, code, path, force, request=request
>>>>
>>>> File 
>>>> "/usr/local/lib/python2.7/dist-packages/weblate/trans/models/translation.py"
>>>>  in check_sync
>>>>   72.         translation.check_sync(force, request=request)
>>>>
>>>> File 
>>>> "/usr/local/lib/python2.7/dist-packages/weblate/trans/models/translation.py"
>>>>  in check_sync
>>>>   452.                 self, unit, pos
>>>>
>>>> File "/usr/local/lib/python2.7/dist-packages/weblate/trans/models/unit.py" 
>>>> in update_from_unit
>>>>   110.         dbunit.update_from_unit(unit, pos, created)
>>>>
>>>> File "/usr/local/lib/python2.7/dist-packages/weblate/trans/models/unit.py" 
>>>> in update_from_unit
>>>>   547.             same_state=same_state
>>>>
>>>> File "/usr/local/lib/python2.7/dist-packages/weblate/trans/models/unit.py" 
>>>> in save
>>>>   819.             update_index_unit(self)
>>>>
>>>> File "/usr/local/lib/python2.7/dist-packages/weblate/trans/search.py" in 
>>>> update_index_unit
>>>>   205.         update_source_unit_index(writer, unit)
>>>>
>>>> File "/usr/local/lib/python2.7/dist-packages/whoosh/writing.py" in __exit__
>>>>   210.             self.commit()
>>>>
>>>> File "/usr/local/lib/python2.7/dist-packages/whoosh/writing.py" in commit
>>>>   1037.             self.writer.commit(*args, **kwargs)
>>>>
>>>> File "/usr/local/lib/python2.7/dist-packages/whoosh/writing.py" in commit
>>>>   927.             finalsegments.append(self._finalize_segment())
>>>>
>>>> File "/usr/local/lib/python2.7/dist-packages/whoosh/writing.py" in 
>>>> _finalize_segment
>>>>   866.         self._flush_segment()
>>>>
>>>> File "/usr/local/lib/python2.7/dist-packages/whoosh/writing.py" in 
>>>> _flush_segment
>>>>   830.         self.perdocwriter.close()
>>>>
>>>> File "/usr/local/lib/python2.7/dist-packages/whoosh/codec/whoosh3.py" in 
>>>> close
>>>>   267.         self._cols.save_as_files(self._storage, 
>>>> self._column_filename)
>>>>
>>>> File "/usr/local/lib/python2.7/dist-packages/whoosh/filedb/compound.py" in 
>>>> save_as_files
>>>>   297.         for name, blocks in self._readback():
>>>>
>>>> File "/usr/local/lib/python2.7/dist-packages/whoosh/filedb/compound.py" in 
>>>> _readback
>>>>   279.         self._tempstorage.delete_file(self._tempname)
>>>>
>>>> File "/usr/local/lib/python2.7/dist-packages/whoosh/filedb/filestore.py" 
>>>> in delete_file
>>>>   544.         os.remove(self._fpath(name))
>>>>
>>>> Exception Type: OSError at /update/securedrop/securedrop/
>>>> Exception Value: [Errno 2] No such file or directory: 
>>>> '/app/data/whoosh/source.tmp/sym43el2gyeazkq9axmw31u352k0.ctmp'
>>>>
>>>>
>>>
>>
> 

-- 
Loïc Dachary, Artisan Logiciel Libre

_______________________________________________
Weblate mailing list
Weblate@lists.cihar.com
https://lists.cihar.com/cgi-bin/mailman/listinfo/weblate

Reply via email to