Skip to content
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

Workout page in gym needs pagination #208

Open
s-edwards opened this issue Oct 6, 2021 · 20 comments
Open

Workout page in gym needs pagination #208

s-edwards opened this issue Oct 6, 2021 · 20 comments

Comments

@s-edwards
Copy link
Member

When viewing the list of workouts in the gym, pagination should be used, just like when viewing the list of exercises in the gym. Currently, the workout index page is unpaginated.

We should just port the pagination approach from the exercise index page over to the workout index page as well.

@i-m-karanagarwal
Copy link

@s-edwards I would like to work on this issue.

@s-edwards
Copy link
Member Author

Excellent. We would appreciate the contribution. Right now, you can find pagination support already on the exercises page in the gym, and all that is required is to duplicate that feature on the workouts page. If you aren't sure which views are the two relevant ones to look at, let us know. Thanks!

@i-m-karanagarwal
Copy link

@s-edwards I am getting this error while setting up the docker container. How do I solve this?
image

@s-edwards
Copy link
Member Author

Hmmm ... haven't seen that error yet, no doubt because of the way docker caches the image stack as it builds a new image.

To fix, edit the Gemfile and search for the "github:" clause (it appears on three gems). replace with "git:" and include a full URL instead of just the github user name/repo. For example, try replacing this:

gem 'andand', github: 'raganwald/andand'

With something like this instead:

gem 'andand', git: 'https://github.com/raganwald/andand.git'

Do the same for the other two gems that use "github:", and then you can include the fix as part of your pull request (or even use a second pull request to fix this error!).

For more info, google "gemfile unauthenticated git protocol on port 9418 is no longer supported" and you'll find more info and examples.

@i-m-karanagarwal
Copy link

@s-edwards I got another error while trying to run the docker image. How do I solve this?
image

@s-edwards
Copy link
Member Author

Try executing "docker compose build" to see if that clears it. The error message is being produced because of the earlier bundle install failure message you received, I think--it looks like the docker image just needs to be rebuilt with the Gemfile fix you made. Let us know if that doesn't fix it.

@i-m-karanagarwal
Copy link

This time "docker compose build" executed without a single error but when I tried to execute "docker compose up" then the same error prompted. How do I solve that?
image

@ayaankazerouni
Copy link
Member

I think that this is due to the old Gemfile.lock still hanging around, even though the Gemfile has been updated. This can probably be avoided by changing our Dockerfile, but in the meantime, can you try doing:

docker compose run web bundle install // this will update the Gemfile.lock based on the changes you made to Gemfile
docker compose up

@i-m-karanagarwal
Copy link

I tried these commands and it solved the error. But now it shows another error. How do I solve this?
image

@s-edwards
Copy link
Member Author

I think I see the root of the problem in the Dockerfile, so I'm going to see if I can fix it quickly.

@s-edwards
Copy link
Member Author

OK, I was looking at the Dockerfile in a different branch. When I do a fresh pull of the staging branch (after merging your pull request), docker compose up builds and runs fine for me.

Try using git status to see what files are changed locally. You may try checking out staging directly and see if that fixes the issue for you. I think the problem is that somewhere in trying to fix the other errors, your local Gemfile.lock in your repo is out of sync and is causing problems, but pulling a clean copy of Gemfile / Gemfile.lock from staging should work.

@i-m-karanagarwal
Copy link

@s-edwards Sorry for the delay, But I tried every possible way and it is still not working. It shows the same error as #208 (comment) this. How do I solve this?

@s-edwards
Copy link
Member Author

Does "git status" show any changes to Gemfile.lock (or Gemfile) compared to what is in the staging branch? If so, use "git checkout -- Gemfile.lock" to overwrite the local copy with what is in staging, then try "docker compose build web" to rebuild the docker image with the Gemfile.lock from staging. That is working on my end and launches correctly. If that does not work, please reply with the output from "git status" so we can see what might be different in your local environment.

@i-m-karanagarwal
Copy link

Tried the above steps and this came as output
image
How do I solve this????

@i-m-karanagarwal
Copy link

image
This is the git status.

@s-edwards
Copy link
Member Author

OK, so from the git status output, it is clear you have changes in your Gemfile.lock that are not in the repo. I believe this is the source of the problem. The steps you've tried so far have not resolved the problem because your current working (changed) copy of the file has already be staged using "git add", and git usually protects those pending changes ... but they're keeping your docker image broken.

Try "git restore --staged --worktree Gemfile.lock" to unstage your "git add" of the file, and also refresh the local working copy from the repository contents. This should fix your Gemfile.lock by unstaging the pending changes, throwing away the bad contents, and restoring it from from the repository HEAD. Then try the "docker compose build web" and "docker compose up" again.

The suggestions above were all aimed at fixing this file, but I didn't realize you had "git add"ed the file. Sorry!

@i-m-karanagarwal
Copy link

Tried the above steps that error was removed.
image
but when I tried to open the code-workout-db_dev-1 in browser
image
this error occurred.
How do I solve this?

@s-edwards
Copy link
Member Author

OK, the screen you're showing doesn't appear to be due to the earlier docker issues. The docker container output shows an error from the database container reading a connection. The connection is presumably from the web application. Notice the green line, which indicates the web application actually exited, which would be unexpected at this point. That's also why the second image shows your browser unable to connect--because the app quit.

Please look in your log/development.log file to see if there are any messages or indications of what may have happened to cause the web app to quit. If you don't find anything there, check the other files in the log/ folder. For simplicity, you can easily delete everything within the log/ folder and re-run "docker compose up", and then you'll know the only messages you are looking at are from the most recent failed run.

I'm not seeing this error myself using the docker image on my end from the staging branch--everything is working properly here. Also, your Dockerfile and Gemfile appear to be working as intended. So this issue looks like something else.

Just to be safe, you might also want to check whether you have any firewall constraints preventing the web application from opening/using the intended ports for either the web app or the database, since that could potentially prevent things from communicating correctly and lead to an early (unexpected) exit.

@i-m-karanagarwal
Copy link

There is no file being created in log folder
image
the only log I am getting are these.
What should I do?

@scotteifel
Copy link

Hello. I'm new to OS and I'd like to learn a little more about this issue. This may seem like a silly question, but what are the files that will have the focus for this? I'd like to look them over, and see what language they are written in also. Thank you for any feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants