Clarifying setup instructions for Discourse Translator plugin

Method Not Allowed The method is not allowed for the requested URL.

Continuing the discussion from Hi, attempting to setup on arm64 server as docker-compose and also asking on the Discourse side LibreTranslate Plugin -- Free and Open Source Translation API - #6 by sunjam - dev - Discourse Meta

translator libretranslate endpoint

Should it be http://dockerip:5000
Found docker container ip using sudo docker inspect libretranslate

I’d like to clarify the instructions for this since documentation only mentions, “set up the relevant endpoints.” I’m wondering how I do this between two docker containers on the same machine. Thanks!

http://ip:5000/translate
returns

Seeing an error and warning in my logs when attempting to use Translator and Multilingual discourse apps through Libretranslate.

Job exception: connect_write timeout reached
Backtrace

/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/excon-0.104.0/lib/excon/socket.rb:317:in `select_with_timeout'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/excon-0.104.0/lib/excon/socket.rb:163:in `rescue in block in connect'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/excon-0.104.0/lib/excon/socket.rb:144:in `block in connect'
/usr/local/lib/ruby/3.2.0/resolv.rb:111:in `each_address'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/excon-0.104.0/lib/excon/socket.rb:134:in `connect'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/excon-0.104.0/lib/excon/socket.rb:51:in `initialize'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/excon-0.104.0/lib/excon/connection.rb:477:in `new'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/excon-0.104.0/lib/excon/connection.rb:477:in `socket'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/excon-0.104.0/lib/excon/connection.rb:121:in `request_call'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/excon-0.104.0/lib/excon/middlewares/mock.rb:57:in `request_call'
DistributedMutex("detect_translation_15"): held for too long, expected max: 60 secs, took an extra 1 secs
DistributedMutex("detect_translation_15"): held for too long, expected max: 60 secs, took an extra 1 secs

Backtrace

/var/www/discourse/lib/distributed_mutex.rb:103:in `warn'
/var/www/discourse/lib/distributed_mutex.rb:57:in `ensure in block in synchronize'
/var/www/discourse/lib/distributed_mutex.rb:64:in `block in synchronize'
/var/www/discourse/lib/distributed_mutex.rb:49:in `synchronize'
/var/www/discourse/lib/distributed_mutex.rb:49:in `synchronize'
/var/www/discourse/lib/distributed_mutex.rb:34:in `synchronize'
/var/www/discourse/plugins/discourse-translator/plugin.rb:98:in `execute'
/var/www/discourse/app/jobs/base.rb:292:in `block (2 levels) in perform'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rails_multisite-5.0.0/lib/rails_multisite/connection_management.rb:82:in `with_connection'
/var/www/discourse/app/jobs/base.rb:279:in `block in perform'

Cool, seems the globe is not visible on my installation. Looked it up and seems others reported this issue here: Translate button missing with libretranslate - support - Discourse Meta

Mm, not really sure. I use the latest version of discourse and use the instructions at GitHub - LibreTranslate/LibreTranslate: Free and Open Source Machine Translation API. Self-hosted, offline capable and easy to setup.

I then configure libretranslate.com for the endpoint (with an api key).

2 Likes

I’m on latest Discourse 3.2.0.beta3-dev from tests-passed
Issue seems to stem from running arm64 version of libretranslate:v1.3.12
Any more recent version fails – see Translations on M1 crash docker container · Issue #524 · LibreTranslate/LibreTranslate · GitHub

Can confirm using one of the recommended instances you have listed on your site works fine.
I am now seeing the Globe icon when using my own arm64 instance as http:dockerhostip:5000 but it returns a 502 error after thinking.

Also seeing errors and warnings.