It’s been one month exactly since discourse has been giving me 404 error on assets files (css/js etc) after I did “git pull” and then “rebuild” on approximately May 15th as its was asking me upgrade via command line on the automatic upgrade page.
And then now today after several days, I have tried to reinstall again and it’s still the same even though it’s been days. My app.yml file content is given below.
##
## After making changes to this file, you MUST rebuild for any changes
## to take effect in your live Discourse instance:
##
## /var/discourse/launcher rebuild app
##
## Make sure to obey YAML syntax! You can use this site to help check:
## http://www.yamllint.com/
## this is the all-in-one, standalone Discourse Docker container template
# You may add rate limiting by uncommenting the web.ratelimited template.
# Out of the box it allows 12 reqs a second per ip, and 100 per minute per ip
# This is configurable by amending the params in this file
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: The mailserver this Discourse instance will use
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
## The CDN address for this Discourse instance (configured to pull)
#DISCOURSE_CDN_URL: //discourse-cdn.example.com
## These containers are stateless, all data is stored in /shared
volumes:
- volume:
host: /var/discourse/shared/standalone
guest: /shared
- volume:
host: /var/discourse/shared/standalone/log/var-log
guest: /var/log
## The docker manager plugin allows you to one-click upgrade Discourse
## 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
## Remember, this is YAML syntax - you can only have one block with a name
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 "End of custom commands"
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.
Сейчас я пытаюсь выполнить чистую установку, как вы можете видеть в первом посте, даже страница регистрации не работает корректно. Я пробовал запускать assets:precompile, но это не дало никакого эффекта. Есть ли способ попробовать установить более старую версию Docker для Discourse?
Если только вы не планируете использовать этот форум неделю-другую, а затем удалить его, вам действительно, действительно, действительно не стоит этого делать.
Полагаю, вы где-то упустили какой-то мелкий шаг, который и вызывает проблему, скорее всего, в конфигурации внешнего Nginx. Лучше разобраться с этим на последней версии.
Это потому, что тот файл конфигурации раньше не работал, поэтому тот, который я использую сейчас, был рекомендован @neilздесь, и он раньше работал. В настоящее время я также попробовал файл конфигурации, загруженный там, но он тоже не сработал.
Я сравнил свою конфигурацию (слева) и твою (справа), посмотри на строку 12, вероятно, ты забыл изменить слово forum. Далее у меня есть дополнительный блок replace, строки 22–29: