I’m trying to test a plugin using the docker setup. Randomly the app stops loading and I’m just presented with a blank page until I delete the data folder and rebuild everything. Any tips on how to debug the issue?
I switched from my local Mac to a Ubuntu VM hoping this would make it easier to get this running but unfortunately so far it’s not.
Already fighting some weird permission problems in the early stages. d/bundle install reports it needs sudo rights to install some, d/rails s also comes back with permission problems
Traceback (most recent call last):
8: from /src/bin/unicorn:70:in `<main>'
7: from /src/bin/unicorn:38:in `ensure_cache_clean!'
6: from /usr/local/lib/ruby/2.7.0/fileutils.rb:211:in `mkdir_p'
5: from /usr/local/lib/ruby/2.7.0/fileutils.rb:211:in `each'
4: from /usr/local/lib/ruby/2.7.0/fileutils.rb:226:in `block in mkdir_p'
3: from /usr/local/lib/ruby/2.7.0/fileutils.rb:226:in `reverse_each'
2: from /usr/local/lib/ruby/2.7.0/fileutils.rb:228:in `block (2 levels) in mkdir_p'
1: from /usr/local/lib/ruby/2.7.0/fileutils.rb:250:in `fu_mkdir'
/usr/local/lib/ruby/2.7.0/fileutils.rb:250:in `mkdir': Permission denied @ dir_s_mkdir - /src/tmp (Errno::EACCES)
Any idea what’s going wrong? This machine previously ran a production discourse without issues. I just stopped and removed those containers and cloned the dev git repo into a different directory. Running it all through tmux to handle the differen shell instances.
the only solution is to switch to arm64-capable multi-arch images. These will also be a lot faster and generally more reliable. I recommend investigating which base images you’re using and to switch to multi-arch ones where possible. You can see which architectures are supported by each image on Docker Hub: […]
Is the Discourse team open to supporting a multi-arch image? It looks like the Discourse base image is based on debian:buster-slim, which is multi-arch, so it seems like it shouldn’t be outrageously difficult to make the Discourse base image be multi-arch, but that might put y’all in the position of having to support ARM (in production!). Somebody (the Discourse team?) would need to run the Discourse tests on both x86_64 and ARM, fix issues when they fail, etc.
Would a PR even be welcome here?
(IMO, it seems like ARM is the architecture of the future, even on cloud-hosted environments.)
I started doing some manual hacks like the following which were working but there kept being more and more permission issues, so I decided to stop trying to put out fires.
I’m going to use the host user with a uid of 1000 and I bet that it’s just going to work now, but this really exposes a shortcoming with how Discourse development is done it seems.
…and yep that did the trick.
In the case of that “tmp” that could be in a named or anonymous Docker volume. With the plugins, it could be useful to have that mounted volume but the host file system permissions would need to be altered to support writes.
I don’t think it’s safe to assume that every developer will be using a uid of 1000.
Hi guys, do you know how to run the development using old version discourse ? I know that in live discourse we can set version in app.yml. But I don’t know how to do it in development using docker. I want to run development on last stable version v2.7.10. Thanks for your help
however I got issue when login as admin user (the one that I created when run “d/boot_dev --init”)
“Unkown error” pop up showed on screen, with below error on /logs
ActiveRecord::StatementInvalid (PG::UndefinedFunction: ERROR: function max(boolean) does not exist
LINE 1: ..._rank, MAX(user_badges.created_at) AS created_at, MAX(user_b...
^
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
)
lib/freedom_patches/ams_include_without_root.rb:49:in `include!'
app/controllers/application_controller.rb:495:in `serialize_data'
app/controllers/application_controller.rb:504:in `render_serialized'
app/controllers/session_controller.rb:611:in `login'
app/controllers/session_controller.rb:337:in `create'
app/controllers/application_controller.rb:395:in `block in with_resolved_locale'
app/controllers/application_controller.rb:395:in `with_resolved_locale'
lib/middleware/omniauth_bypass_middleware.rb:71:in `call'
lib/content_security_policy/middleware.rb:12:in `call'
config/initializers/100-quiet_logger.rb:23:in `call'
config/initializers/100-silence_logger.rb:31:in `call'
lib/middleware/missing_avatars.rb:23:in `call'
lib/middleware/turbo_dev.rb:34:in `call'
Do you have some experience with that error ? or maybe my step on running development on previous version was wrong ?
Went fully clean slate again. All goes well, get a pristine development environment that I can log into.
Then I am getting a couple of plugins in to match my production environment and pull the most recent backup.
Upload it, try to restore it to the development environment and I get the Peer authentication error again. Have filed a bug, but so far there is no response. Can anyone try to reproduce? I’ve seen similar issues further op the comments to this post, so I figure I am not alone on this one?
[2021-11-29 19:43:39] 'koen' has started the restore!
[2021-11-29 19:43:39] Marking restore as running...
[2021-11-29 19:43:39] Making sure /src/tmp/restores/default/2021-11-29-194339 exists...
[2021-11-29 19:43:39] Copying archive to tmp directory...
[2021-11-29 19:43:39] Extracting dump file...
[2021-11-29 19:43:40] Validating metadata...
[2021-11-29 19:43:40] Current version: 20211124161346
[2021-11-29 19:43:40] Restored version: 20211123033311
[2021-11-29 19:43:40] Enabling readonly mode...
[2021-11-29 19:43:40] Pausing sidekiq...
[2021-11-29 19:43:40] Waiting up to 60 seconds for Sidekiq to finish running jobs...
[2021-11-29 19:43:46] Creating missing functions in the discourse_functions schema...
[2021-11-29 19:43:46] Restoring dump file... (this may take a while)
[2021-11-29 19:43:47] psql: error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: FATAL: Peer authentication failed for user "postgres"
[2021-11-29 19:43:47] EXCEPTION: psql failed: psql: error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: FATAL: Peer authentication failed for user "postgres"
[2021-11-29 19:43:47] /src/lib/backup_restore/database_restorer.rb:92:in `restore_dump'
/src/lib/backup_restore/database_restorer.rb:26:in `restore'
/src/lib/backup_restore/restorer.rb:51:in `run'
/src/script/spawn_backup_restore.rb:23:in `restore'
/src/script/spawn_backup_restore.rb:36:in `block in <main>'
/src/script/spawn_backup_restore.rb:4:in `fork'
/src/script/spawn_backup_restore.rb:4:in `<main>'
[2021-11-29 19:43:47] Trying to rollback...
[2021-11-29 19:43:47] There was no need to rollback
[2021-11-29 19:43:47] Cleaning stuff up...
[2021-11-29 19:43:47] Dropping functions from the discourse_functions schema...
[2021-11-29 19:43:47] Removing tmp '/src/tmp/restores/default/2021-11-29-194339' directory...
[2021-11-29 19:43:47] Unpausing sidekiq...
[2021-11-29 19:43:47] Marking restore as finished...
[2021-11-29 19:43:47] Notifying 'koen' of the end of the restore...
[2021-11-29 19:43:51] Finished!
I am having an issue that seems to stem from the schism between ports 3000 and 4200. I am not entirely sure how they related to each other, but my understanding is that 3000 is the server and 4200 a proxy to it from ember CLI. Port 4200 works well, except that sometimes, and specifically when responding with a 302, response headers have URIs that use port 3000 instead of 4200. I was specifically trying to get OAuth2 working with a custom provider as described here, and the presence of port 3000 in some of the responses breaks the OAuth2 workflow. There is no port 3000 in any of my OAuth2 configuration, it must be coming internally from the server.
Has anybody encountered this kind of issue before? Do you know how to set up an environment that mimics the production release more closely?
For what it’s worth, I also tried setting up the production release locally, but that requires a full-blown domain and email registration and doesn’t seem very friendly of local environments.
Update, tried again to take the clean-slate route and this time using another machine. Now I get stuck because I do not have the UID 1000 which has been mentioned further up this thread, post 100 by @dcook. I would agree that assuming the UID=1000 is wrong and would constitute bug. Did you report it as such?
@rishabh what is your view on both these items? I loved switching over to the docker based method, quick and clean. But now on two different machines it feels a bit like a dead-end street and I am wondering what else I can contribute to get it resolved. Also wondering a bit on the lifecycle of bugs. Do they get received, reviewed, rejected or accepted, parked, resolved etc.?
I’ll for now go and try to set up the native dev environment see if I can get that working.
hello. this is my first time installing discourse using docker in mac.
first, i am sorry about my english …
I have already run
d/boot_dev --init
then I got error that port:3000 is already used. so I change port 30030:3000 (file : bin/docker/boot_dev)
after that, I start this code
d/boot_dev --init
# In one terminal:
d/rails s
# And in a separate terminal
d/ember-cli
my question is
when I running d/rails s code. I can open discourse starting page on ‘localhost:30030’ . If I just want to open discourse and using 30030port (port forwarding), then Can I finish the install process?? I don’t know what is d/rails s, d/ember-cli. …
and d/rail s process is sooo long. I am worried about what is wrong… is it right? or d/rails s and d/ember-cli is backgroud process while hosing discourse?