|
Erros do rake migrate_to_s3
|
|
3
|
838
|
4 de Fevereiro de 2020
|
|
Alterar o locale no app.yml não instala o Discourse
|
|
3
|
1488
|
14 de Março de 2018
|
|
Existe uma verificação em JavaScript para saber se é admin ou se é grupo?
|
|
2
|
543
|
19 de Abril de 2018
|
|
Iframe para incorporar um documento HTML
|
|
8
|
3138
|
19 de Dezembro de 2018
|
|
Reverter edições em massa (desfazer edições em massa)
|
|
5
|
1216
|
16 de Janeiro de 2019
|
|
Consequências de editar postagem contendo enquete
|
|
3
|
837
|
2 de Agosto de 2022
|
|
Excluir permanentemente "FAQ/Diretrizes" e "Termos de Serviço"
|
|
2
|
966
|
8 de Outubro de 2021
|
|
Pergunta sobre o uso da versão Open-Source do Discourse
|
|
1
|
664
|
12 de Junho de 2020
|
|
Embed playbuzz quiz into post
|
|
6
|
3550
|
16 de Março de 2017
|
|
Política de acesso restrito a objetos do bucket S3 conforme grupos do Discourse
|
|
2
|
966
|
1 de Outubro de 2021
|
|
Nível de confiança bloqueado após promoção manual
|
|
2
|
543
|
16 de Abril de 2019
|
|
Like ratio for each TL
|
|
3
|
834
|
5 de Junho de 2017
|
|
Atualização para o Failure Discourse 2.8
|
|
6
|
1121
|
26 de Fevereiro de 2022
|
|
Como criar um banner com link na imagem?
|
|
1
|
1179
|
15 de Fevereiro de 2022
|
|
Usuário adicionado ao tópico recebeu notificações de respostas a esse tópico
|
|
6
|
631
|
13 de Março de 2020
|
|
Recuperando posts de subcategorias com o plug-in do Slack?
|
|
2
|
541
|
9 de Abril de 2019
|
|
API do Discourse, é possível criar um Post com um nome de usuário diferente?
|
|
2
|
963
|
25 de Março de 2022
|
|
Executando Discourse com pg_bouncer e um banco de dados separado
|
|
2
|
965
|
20 de Setembro de 2020
|
|
Making Amazon Cloundfront SSL with Cloudflare
|
|
5
|
3826
|
28 de Maio de 2016
|
|
Clique do mouse não funciona no meu fórum após atualização recente
|
|
3
|
834
|
30 de Agosto de 2020
|
|
Tentando trazer membros pagantes do WP para o Discourse
|
|
3
|
1482
|
8 de Agosto de 2019
|
|
Error with manual install: Failed opening required '__DIR__/lib/discourse.php'
|
|
5
|
3824
|
14 de Maio de 2015
|
|
Alterar subcategorias em massa não seleciona todos os tópicos?
|
|
4
|
746
|
25 de Fevereiro de 2023
|
|
Problema estranho no Docker que impede o início do aplicativo
|
|
4
|
1324
|
6 de Maio de 2023
|
|
Pergunta sobre avisos durante atualizações
|
|
2
|
540
|
20 de Agosto de 2022
|
|
Adicionar feed Seguir à navegação superior
|
|
5
|
681
|
26 de Novembro de 2022
|
|
Erro 401 do MaxMind -- tenho chave de licença, não consigo baixar
|
|
7
|
596
|
8 de Dezembro de 2025
|
|
Forma inteligente de marcar todos em uma discussão
|
|
1
|
210
|
24 de Julho de 2025
|
|
Travado ao criar nova conta
|
|
4
|
237
|
11 de Abril de 2026
|
|
Plugin de feeds RSS: tópico perenemente "novo", de um item muito antigo em um feed
|
|
4
|
743
|
18 de Outubro de 2022
|
|
Metadados de upload de imagem
|
|
6
|
353
|
1 de Agosto de 2024
|
|
Atualização do Docker mostra erro interno do servidor em rubygems.org
|
|
1
|
1174
|
26 de Fevereiro de 2015
|
|
Compatibilidade do Plugin de Anúncios com o próximo Discourse
|
|
2
|
541
|
11 de Janeiro de 2024
|
|
OAuth 2 e outros sites de discussão?
|
|
5
|
1206
|
10 de Dezembro de 2020
|
|
Is it possible to configure the length that triggers short search term?
|
|
5
|
1205
|
4 de Dezembro de 2016
|
|
Question about configuring email on shared hosting
|
|
6
|
1982
|
20 de Maio de 2015
|
|
Definições do Discourse para visualizados, lidos e visitas na página do usuário
|
|
2
|
959
|
17 de Julho de 2020
|
|
How to use translation from client.fa_IR.yml in javascript code?
|
|
1
|
659
|
3 de Abril de 2017
|
|
Excluindo Tópicos Antigos
|
|
4
|
742
|
11 de Janeiro de 2021
|
|
Qual é o nome desta área e como posso adicionar algo nela?
|
|
4
|
742
|
7 de Abril de 2019
|
|
Problema de acesso às abas de configurações de categorias
|
|
6
|
354
|
12 de Janeiro de 2026
|
|
Preenchendo um campo de dados de usuário personalizado
|
|
3
|
828
|
22 de Maio de 2023
|
|
Moderadores não recebem notificações por e-mail
|
|
5
|
676
|
6 de Agosto de 2020
|
|
Vinculando títulos funciona apenas às vezes?
|
|
2
|
957
|
27 de Junho de 2021
|
|
Topic subject letter's case not editable
|
|
4
|
1316
|
23 de Maio de 2017
|
|
Onde edito as respostas pré-construídas
|
|
1
|
117
|
24 de Outubro de 2025
|
|
Admin rights without granting?
|
|
2
|
537
|
26 de Outubro de 2017
|
|
Permitir que as pessoas façam login usando contas de outros sites
|
|
3
|
1471
|
20 de Novembro de 2019
|
|
Erro "Net::ReadTimeout com # This is a common error in Ruby on Rails applications, specifically when dealing with network requests. Let's break down what it means and how to fix it.
**Understanding the Error:**
* **`Net::ReadTimeout`**: This is a standard Ruby exception that indicates a network socket has timed out while waiting for a read operation to complete. In simpler terms, your application tried to read data from a remote server, but the server didn't respond within the expected timeframe.
* **`#<TCPSocket:(closed)>`**: This part tells you that the connection being used for the read operation was a `TCPSocket` and it was already closed. This means the connection was either closed by the remote server (perhaps due to inactivity, an error on their end, or a network issue) or by your application itself before the read operation could complete.
**Common Causes:**
1. **Slow or Unresponsive Server:** The most frequent cause is that the external service or API your Rails app is trying to communicate with is slow to respond, overloaded, or temporarily unavailable.
2. **Network Issues:** Intermittent network problems between your server and the external service can cause read timeouts. This could be on your end, the external service's end, or somewhere in between (like a firewall or proxy).
3. **Long-Running Requests:** If your application is making a request that takes a very long time to process on the server side, the connection might time out before the response is fully received.
4. **Incorrect Configuration:** Sometimes, the timeout settings in your application or in network infrastructure (like load balancers or firewalls) might be too short for the expected response time of the external service.
5. **Connection Closed Prematurely:** Your application might be closing the connection before the response is fully read, although this is less common for standard HTTP libraries unless there's custom connection management involved.
**How to Fix It:**
Here's a systematic approach to troubleshooting and resolving this error:
1. **Increase Timeout Settings:**
* **HTTP Client Libraries:** If you're using libraries like `Net::HTTP` (which is often used by default or by other gems), you can explicitly set the read timeout. For example:
```ruby
require 'net/http'
require 'uri'
uri = URI.parse('http://example.com/slow_endpoint')
http = Net::HTTP.new(uri.host, uri.port)
http.read_timeout = 300 # Set timeout to 300 seconds (5 minutes)
request = Net::HTTP::Get.new(uri.request_uri)
response = http.request(request)
```
* **Gems like Faraday:** If you're using Faraday, you can configure timeouts like this:
```ruby
Faraday.new(url: 'http://example.com') do |faraday|
faraday.options.timeout = 10 # seconds
faraday.options.open_timeout = 5 # seconds
# ... other configurations
end
```
* **Other Gems:** Check the documentation for the specific HTTP client gem you are using (e.g., `httparty`, `rest-client`) for how to configure timeouts.
2. **Check the External Service:**
* **Status Page:** Look for a status page or status updates from the service you are trying to connect to. They might be experiencing issues.
* **API Documentation:** Review the API documentation for expected response times and any rate limits that might be causing throttling.
* **Contact Support:** If the service is consistently slow or unresponsive, reach out to their support team.
3. **Investigate Network Connectivity:**
* **`ping` and `traceroute`:** From your server, try to `ping` the host of the external service and use `traceroute` (or `mtr`) to identify any network latency or packet loss.
* **Firewalls/Proxies:** Ensure that no firewalls or proxy servers are interfering with or have overly aggressive timeout settings for the connection.
4. **Implement Retries and Circuit Breakers:**
* **Retries:** For transient network issues or slow responses, implement a retry mechanism. Be careful not to retry too aggressively, as this can worsen the problem for the external service.
* **Circuit Breaker Pattern:** For services that are consistently failing, consider implementing a circuit breaker pattern to stop making requests to the failing service for a period, preventing your application from being overwhelmed.
5. **Asynchronous Processing:**
* If the external request is inherently long-running, consider performing it asynchronously using background job systems like Sidekiq, Delayed Job, or Resque. This prevents your web requests from timing out and improves user experience.
6. **Review Your Code:**
* Ensure you aren't accidentally closing the connection prematurely in your code, especially if you have custom network handling.
**Example using `Net::HTTP` in a Rails context:**
If you have a service object or a model method making the call:
```ruby
# app/services/external_api_service.rb
require 'net/http'
require 'uri'
class ExternalApiService
def fetch_data(resource_path)
uri = URI.parse("https://api.example.com/#{resource_path}")
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true # If the API uses HTTPS
http.read_timeout = 120 # Set a reasonable timeout, e.g., 120 seconds
http.open_timeout = 10 # Set a shorter timeout for establishing the connection
request = Net::HTTP::Get.new(uri.request_uri)
# Add any necessary headers, e.g., authentication tokens
# request['Authorization'] = "Bearer YOUR_API_KEY"
begin
response = http.request(request)
if response.is_a?(Net::HTTPSuccess)
JSON.parse(response.body)
else
# Handle non-success responses (e.g., 4xx, 5xx errors)
Rails.logger.error "API Error: #{response.code} - #{response.message}"
nil
end
rescue Net::ReadTimeout => e
Rails.logger.error "API Read Timeout Error: #{e.message}"
nil
rescue Net::OpenTimeout => e
Rails.logger.error "API Open Timeout Error: #{e.message}"
nil
rescue StandardError => e
Rails.logger.error "Unexpected API Error: #{e.message}"
nil
end
end
end
```
**In summary:** The `Net::ReadTimeout` with `TCPSocket:(closed)` error usually points to a problem with the external service's responsiveness or network conditions. The most common solution is to increase the timeout values in your HTTP client configuration, but it's also crucial to investigate the external service and network path for underlying issues.
|
|
7
|
3287
|
28 de Janeiro de 2024
|
|
Can't make Discourse accessible through Apache
|
|
7
|
3288
|
26 de Março de 2015
|