Hace exactamente un mes que Discourse me está dando un error 404 en los archivos de activos (css/js, etc.) después de ejecutar “git pull” y luego “rebuild” aproximadamente el 15 de mayo, ya que me pedía actualizar mediante la línea de comandos en la página de actualización automática.
Y ahora, hoy, después de varios días, he intentado reinstalar de nuevo y sigue igual, a pesar de que han pasado días. El contenido de mi archivo app.yml se muestra a continuación.
##
## Después de realizar cambios en este archivo, DEBES reconstruir para que cualquier cambio
## surta efecto en tu instancia en vivo de Discourse:
##
## /var/discourse/launcher rebuild app
##
## ¡Asegúrate de obedecer la sintaxis YAML! Puedes usar este sitio para ayudarte a verificar:
## http://www.yamllint.com/
## esta es la plantilla del contenedor Docker de Discourse todo en uno y autónomo
# Puedes agregar limitación de velocidad descomentando la plantilla web.ratelimited.
# Por defecto permite 12 solicitudes por segundo por IP y 100 por minuto por IP
# Esto es configurable modificando los parámetros en este archivo
templates:
- "templates/postgres.template.yml"
- "templates/redis.template.yml"
- "templates/web.template.yml"
- "templates/web.ratelimited.template.yml"
expose:
- "25654:80"
# - "80:80"
# - "2222:22"
params:
db_default_text_search_config: "pg_catalog.english"
version: tests-passed
env:
LANG: en_US.UTF-8
# DISCOURSE_DEFAULT_LOCALE: en
UNICORN_WORKERS: 2
DISCOURSE_DEVELOPER_EMAILS: ''
DISCOURSE_HOSTNAME: ''
DISCOURSE_RELATIVE_URL_ROOT: /community
## TODO: El servidor de correo que usará esta instancia de Discourse
DISCOURSE_SMTP_ADDRESS:
DISCOURSE_SMTP_PORT: 587
DISCOURSE_SMTP_USER_NAME:
DISCOURSE_SMTP_PASSWORD:
DISCOURSE_SMTP_ENABLE_START_TLS: true
DISCOURSE_SMTP_OPENSSL_VERIFY_MODE: none
DISCOURSE_SMTP_AUTHENTICATION: login
## La dirección CDN para esta instancia de Discourse (configurada para cargar)
#DISCOURSE_CDN_URL: //discourse-cdn.example.com
## Estos contenedores son sin estado; todos los datos se almacenan en /shared
volumes:
- volume:
host: /var/discourse/shared/standalone
guest: /shared
- volume:
host: /var/discourse/shared/standalone/log/var-log
guest: /var/log
## El plugin docker_manager te permite actualizar Discourse con un solo clic
## http://discourse.example.com/admin/docker
hooks:
after_code:
- exec:
cd: $home/plugins
cmd:
- mkdir -p plugins
- git clone https://github.com/discourse/docker_manager.git
# - git clone https://github.com/discourse/discourse-chat-integration.git
# - git clone https://github.com/gdpelican/babble.git
# - git clone https://github.com/discourse/discourse-solved.git
# - git clone https://github.com/discourse/discourse-adplugin.git
# - git clone https://github.com/communiteq/discourse-sitemap.git
# - git clone https://github.com/discourse/discourse-bbcode-color.git
## Recuerda, esto es sintaxis YAML: solo puedes tener un bloque con un nombre
run:
- exec:
cd: $home
cmd:
- rm -fr public/assets
- sudo -E -u discourse bundle exec rake assets:precompile
- mkdir -p public/community
- cd public/community && ln -s ../uploads && ln -s ../backups
- replace:
global: true
filename: /etc/nginx/conf.d/discourse.conf
from: proxy_pass http://discourse;
to: |
rewrite ^/(.*)$ /community/$1 break;
proxy_pass http://discourse;
- replace:
filename: /etc/nginx/conf.d/discourse.conf
from: etag off;
to: |
etag off;
location /community {
rewrite ^/community/?(.*)$ /$1;
}
- replace:
filename: /etc/nginx/conf.d/discourse.conf
from: $proxy_add_x_forwarded_for
to: $http_fastly_client_ip
global: true
- exec: echo "Fin de los comandos personalizados"
He desactivado todos los plugins en la configuración YAML, pero sigue dando error 404 en los activos. En el contenedor de la aplicación, la carpeta “community” ya está creada.
there are 2 folders in /public/community i.e. “backup” and “uploads”. I tried changing the version from tests-passed to stable again but the issue remains the same i.e. no javascript or CSS files and giving 404 error… I also tried to change the permission for the “uploads” folder in community and symlinked assets folder in community but did not help.
Downgrading isn’t possible, if you’re on tests-passed you can’t rebuild on a lower version (beta/stable).
You would need to stay on the current tests-passed release until Stable or Beta catches up.
Subfolder installs are considered an advanced topic and we really can’t support them here because of all the problems which arise. There are pages and pages of topics detailing the types of problems found when installing against a subfolder. In 2019 there’s really no good reason to use a subfolder install, all of the SEO claims have been debunked, and the added complexity really adds nothing of value.
Even on CDCK hosting, subfolder installs are only available to enterprise customers, with an additional fee.
I would suggest reverting to a subdomain, or opening a topic on marketplace to engage with a consultant.
I destroyed the container and then rebuild it with the stable release, the problem is with the assets i.e. CSS or javascript files which are not being found. This error happened probably in the update of May. Is there a way I install the previous versions?
Destroying the container doesn’t help, your database was migrated, and as I’ve already said above there’s no way to migrate back. If you didn’t take a backup prior to upgrade you’re stuck at tests-passed until beta or stable reaches the same level.
Currently, I am trying a fresh installation first, as you can see in the first post even the registration page is not working fine. I have tried assets:precompile but its same no effect. Is there a way I can try to install an older version of discourse docker?
Unless you want to use this forum for a week or two and then delete it, you really, really, really don’t want to do that.
My guess is that you missed some tiny step somewhere that’s causing the problem, probably in the external Nginx config. You want to figure it out with the latest version.
That’s because that config file didn’t work in the past, so the one I am using now was suggested by @neilhere and it worked in the past. Currently, I also tried the config file uploaded there, but that didn’t work too.
I compared my config (left) and yours (right), take a look at line 12, probably you forgot to change word forum. Next, I have extra block replace, lines 22-29: