New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
users' profile photos are not showing on the dockerized installation #4955
Comments
I am currently looking into this issue.
The folder |
Hi, @cmgorton, I'd be happy to participate on this issue as part of the dev.to bug smash. Is it still available? Thanks for the reply, |
Thanks for the help here @DanCharousek . I will assign this issue to you. And yes you can use that link! I believe that is the updated link to the docs. |
So I've started working on the issue and got stuck at the very beginning of installing the project via the containers. This is the snippet of the console log.
@cmgorton Thank you, |
@joshpuetz @citizen428 Could either of you help debug this or point to someone on the team more familiar with Docker? Thanks. |
Hi @jdoss, do you think you could point me where to look for an issue with the dockerized setup? I followed the instruction guide and kept getting error 400 after the containers spin up. I also tried to tear everything down and start over. I did not do any changes in the Thanks in advance, |
Hi Dan, Just wanted to chime in since I've been using the docker images to do unit testing and have seen similar issues (the ProfileImageUploader does not create the image file for the user and in testing the user creation fails in the factory setting the I tried to setup a docker based environment from scratch following the same process - clone repo - copy
I was able to work around this by adding rails to the localhost line in /etc/hosts (I believe this works on MacOS as well as on Linux, I'm not sure what the equivalent would be for windows).
I saw the "start your forem journey" first user setup page when I first connected, however, users were already seeded in the database during container startup, so it's safe to fill in anything there if you saw the same thing and use the default admin account. Logging in to http://rails:3000/ as admin@forem.local using the default password worked - I would get a 200 response and no redirect on posts to localhost:3000 but get redirected to the home page after login when I changed the url hostname to rails - this might have shown as a 400 error for you (not sure). I went to the admin user's profile, saw a seeded image, and set successfully a new image - I confirmed I can see the changed file saved - and displayed on the top bar when I visit other pages. I'm unable to write a post because some of the js packs appear to give a 404 (I get to rails:3000/new but the controls I'm not sure if the original reported issue is still an active problem (the issue was opened in 2019 and we've made some recent changes to the container setup to support self-hosting Forems). However, I'm interested in the problem you are seeing with the 400 error - can you let me know whether that's something you're seeing from the docker-compose console logs or a request you're making with a browser that's failing? |
Hi Daniel, thank you for your help. Unfortunately I do not get past the point where you reach the http://localhost:3000 as it returns the mentioned error 400. My previous comment displays the output of my terminal when running Do you have any idea how I can approach the debugging from here? I do not have experience with rails, but I have experties in other languages, so I might be able to debug with little bit of help. I am also very confident in dealing with the docker. Thank you for your time. Dan |
This makes some sense - I think we saw this in an error handler when we were testing a self-hosted (container) install last week.
if you comment that out you might see the actual error message (I believe this was tied to #13673 and should be fixed in the latest image version) For the "rails" explanation - the Sidekiq showing the 400 error is because it's waiting for rails to become available (it relies on a lot of the same steps as the webserver process so waiting for rails to come online is easier than checking the other requirements like redis and bundler). It's the same problem in either case. |
With latest changes from the main and latest image version the issue is gone. The app is now up and running. As you mentioned in the previous comment, it seems that the original issue has been resolved as I see users' profile pictures. Thank you for your help and explenation. I also tried to login in as |
Hi Dan, It looks like the "HTTP Origin header did not match" error in your logs screenshot is probably related to the problem you're seeing. I think the underlying issue there is that the app is being selective about which I think I was able to bypass this with the following changes to docker-compose.yml
In the rails container, set the env var APP_DOMAIN to localhost:3000 - this will match what you as a local user will be using ( I think this fixes the origin header did not match issue you're running into). Also, in the two containers which wait for the http service to startup (sidekiq and the db seed process) - change the request from http to tcp - this now will proceed when the service starts, and won't require an HTTP 200 response (you initially were seeing a 400 bad request when the sidekiq container tried to load the home page, and I was seeing a 403 when I used a name https://docs.forem.com/getting-started/db/#default-admin-user the seeded password (if that user exists) should be I'll see if I can't get that change above into a PR today, if you can confirm whether that addresses your problem I'd be grateful for the feedback. I did see some hiccups with javascript bundles giving 404's - and I ended up clearing the root owned files from I appreciate your patience here! I think the docker setup for local development isn't used enough by the core team and ends up with a few rough edges that we're not seeing immediately. |
There was an issue seen with the HTTP Origin header not matching (the error unhelpfully reported localhost:3000 did not match localhost:3000). Change the APP_DOMAIN internally to localhost:3000 (which is what the user will in fact use, not rails), and since that breaks the http requests from the db seed and sidekiq containers, allow them to only check for a tcp connection instead of expecting a 200 response (sending requests to the disallowed host `rails` triggered a 403). Related to discussion in #4955
Hi Daniel, it seems the changes you suggested helped to resolve the issue. I was able to successfully login as an admin. Although for some reason I do not see posts when logged in (not sure if this is correct behaviour - see screenshot bellow). Anyway, it seems a little bit OT with regards to this issue. Would you suggest to continue the potentional discussion (if it does not end here :)) somewhere else? If so, where is the else? As I mentioned earlier, I am not a rails person or ruby for that matter, but I'd be happy to offer my help in any other areas I possibly might be helpful at (my main devstack consists of PHP-Laravel/JS/TS-Vue.js/Docker) Thank you in advance, |
Hi Dan, I wonder if https://forem.dev is the right venue for this kind of ongoing thread no longer tied to a specific issue? Actually - the first issue looks like it's described in https://forem.dev/manuel/forem-blank-page-after-login-using-docker-221d - so that's not wholly out of line as a discussion board to cover this. I don't think we have a great way to pull an issue's comment thread over. I also don't know for sure why there wouldn't be any posts visible (they're all from the seed) and whether that's the wrong behavior (it looks like it) - and unless you see a bright red JS error message in the browser console, the absence of posts is almost surely in the rails backend (under the stories controller I think). |
There was an issue seen with the HTTP Origin header not matching (the error unhelpfully reported localhost:3000 did not match localhost:3000). Change the APP_DOMAIN internally to localhost:3000 (which is what the user will in fact use, not rails), and since that breaks the http requests from the db seed and sidekiq containers, allow them to only check for a tcp connection instead of expecting a 200 response (sending requests to the disallowed host `rails` triggered a 403). Related to discussion in #4955
Since we now have new setup options for local setup, highlighted in this post , this issue is now stale. |
Describe the bug
After following the installation with docker guide and accessing the locally hosted application, users' profile photos weren't showing up.
To Reproduce
1- Follow the installation with docker guide.
2- Access 127.0.0.1:3000
Expected behavior
Screenshots
1-
2-
3-
Desktop (please complete the following information):
Smartphone (please complete the following information):
Additional context
The text was updated successfully, but these errors were encountered: