Como renovar ssl sem usar: ./launcher rebuild app
|
|
3
|
728
|
13 de Janeiro de 2022
|
Problema PG::UniqueViolation durante o upgrade para 3.1.0.beta4
|
|
6
|
550
|
19 de Maio de 2023
|
Can't start docker after update (openSUSE 13.2)
|
|
6
|
3087
|
4 de Fevereiro de 2016
|
Como instalar vários plugins ao mesmo tempo?
|
|
4
|
1151
|
7 de Outubro de 2022
|
Versão mínima do docker necessária
|
|
1
|
574
|
25 de Novembro de 2020
|
There was a problem sending the test email
|
|
7
|
2869
|
1 de Agosto de 2018
|
Questions about Discourse Forum and Digital Ocean? Hosting?
|
|
1
|
1020
|
27 de Maio de 2020
|
Is there anyone who are using EasyEngine 4 + Discourse subfolder option?
|
|
6
|
968
|
2 de Fevereiro de 2019
|
Não consigo fazer o Discourse funcionar em portas diferentes
|
|
2
|
1476
|
9 de Março de 2021
|
Setup Wizard “doesn’t exist”
|
|
3
|
1271
|
2 de Janeiro de 2017
|
Reconstrução falhou, procure ajuda
|
|
3
|
226
|
30 de Abril de 2024
|
Rake migrate_to_s3 errors
|
|
3
|
714
|
4 de Fevereiro de 2020
|
Erro ao "./discourse rebuild app" devido a erro de tema
|
|
6
|
1694
|
1 de Dezembro de 2021
|
How to configure static IP for discourse container
|
|
5
|
1026
|
19 de Março de 2019
|
Falha na atualização de Rebuild com DB Migrate (Problema no Postgres?)
|
|
8
|
834
|
30 de Dezembro de 2022
|
User cannot signup due to duplicate values in category notification states
|
|
3
|
701
|
4 de Setembro de 2019
|
Configuração do servidor de email
|
|
8
|
2622
|
20 de Maio de 2022
|
Quanta CPU e memória preciso para uma comunidade com menos de 100 pessoas?
|
|
1
|
555
|
30 de Outubro de 2020
|
Falha ao restaurar a partir do backup
|
|
5
|
569
|
5 de Julho de 2023
|
IP does not redirect to domain, domain shows white page
|
|
7
|
1558
|
31 de Janeiro de 2020
|
Memory, CPUs or disk?
|
|
2
|
452
|
26 de Setembro de 2019
|
Email not working with SparkPost
|
|
5
|
3194
|
17 de Março de 2019
|
VPS Provider that is not blocked in Russia?
|
|
6
|
1662
|
10 de Abril de 2019
|
SMTP issue with Postfix
|
|
2
|
1425
|
21 de Dezembro de 2018
|
Installation on Ubuntu 14.04 LTS + Apache 2 + Plesk 12
|
|
3
|
3900
|
3 de Julho de 2015
|
Install going well but now blank white page
|
|
4
|
1104
|
16 de Julho de 2020
|
Termos de Serviço do Discourse?
|
|
1
|
551
|
29 de Outubro de 2020
|
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.
|
|
8
|
2595
|
28 de Janeiro de 2024
|
Emails pararam de funcionar, falhando após atualização
|
|
1
|
549
|
19 de Maio de 2022
|
Problemas de Instalação... (Primeira Experiência de Instalação do Discourse)
|
|
4
|
1096
|
23 de Janeiro de 2023
|
Como Instalar o Discourse em um VPS da OVH
|
|
5
|
101
|
1 de Setembro de 2025
|
Upgrade do discourse não funciona
|
|
8
|
816
|
2 de Janeiro de 2023
|
Discourse not showing up at specified hostname
|
|
6
|
2923
|
27 de Abril de 2015
|
504 Gateway Time-out errors with 2 million post migrated vBulletin forum
|
|
4
|
1090
|
7 de Dezembro de 2021
|
É possível atualizar o Discourse automaticamente?
|
|
7
|
859
|
23 de Novembro de 2022
|
Notificações de e-mail não estão sendo enviadas
|
|
2
|
788
|
23 de Outubro de 2020
|
Lets Encrypt certs missing in two container install?
|
|
3
|
682
|
12 de Janeiro de 2020
|
Existem problemas se você instalar o Discourse no Domínio Principal / Diretório vs. Subdomínio / Subdiretório?
|
|
1
|
542
|
10 de Outubro de 2021
|
Discourse quebrado após atualização
|
|
4
|
1080
|
11 de Junho de 2021
|
RSpec failure about redis
|
|
4
|
1079
|
29 de Dezembro de 2016
|
Atualizei o discourse e agora meu espaçamento está incorreto
|
|
8
|
804
|
28 de Abril de 2022
|
Reescrever nome de usuário com logins SAML/OpenIDC
|
|
2
|
783
|
15 de Março de 2022
|
Can't restore saved backup
|
|
3
|
1203
|
7 de Março de 2017
|
Ajuda com configuração de e-mail
|
|
3
|
1197
|
22 de Novembro de 2020
|
Atualização de 2.8.0.beta1 -\u003e beta4 falha na migração do banco de dados?
|
|
5
|
548
|
4 de Agosto de 2021
|
SMTP setting problem with Office365
|
|
6
|
2851
|
11 de Março de 2022
|
Instalar discourse junto com sites Apache
|
|
5
|
1730
|
28 de Dezembro de 2020
|
Faz sentido usar o Discourse em qualquer servidor ou é com o serviço de hospedagem que o Discourse oferece?
|
|
2
|
773
|
12 de Novembro de 2021
|
Error after moving from HTTP to HTTPS
|
|
2
|
1373
|
28 de Agosto de 2017
|
Upgrading to Paid Discourse Hosting
|
|
3
|
1189
|
21 de Novembro de 2017
|