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

Grocy docker started but shows ERR_TOO_MANY_REDIRECTS #72

Closed
1 task done
jonathansheehy opened this issue Aug 8, 2023 · 18 comments
Closed
1 task done

Grocy docker started but shows ERR_TOO_MANY_REDIRECTS #72

jonathansheehy opened this issue Aug 8, 2023 · 18 comments
Labels
wontfix This will not be worked on

Comments

@jonathansheehy
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

When we try to navigate to the webpage, either http or https, it shows ERR_TOO_MANY_REDIRECTS

Expected Behavior

Login Page should come up

Steps To Reproduce

  1. Open URL with Chrome or Edge
  2. No login page
  3. Mobile app not working too

Environment

- OS:Windows 11 and Android App
- How docker service was installed: Unraid dockers, all other are working correctly
- Log file not showing any type or error

CPU architecture

x86-64

Docker creation

Unraid Docker

Container logs

[migrations] started
[migrations] 01-nginx-site-confs-default: skipped
[migrations] 02-default-location: skipped
[migrations] done
───────────────────────────────────────

      ██╗     ███████╗██╗ ██████╗ 
      ██║     ██╔════╝██║██╔═══██╗
      ██║     ███████╗██║██║   ██║
      ██║     ╚════██║██║██║   ██║
      ███████╗███████║██║╚██████╔╝
      ╚══════╝╚══════╝╚═╝ ╚═════╝ 

   Brought to you by linuxserver.io
───────────────────────────────────────

To support LSIO projects visit:
https://www.linuxserver.io/donate/

───────────────────────────────────────
GID/UID
───────────────────────────────────────

User UID:    99
User GID:    100
───────────────────────────────────────

using keys found in /config/keys
**** The following active confs have different version dates than the samples that are shipped. ****
**** This may be due to user customization or an update to the samples. ****
**** You should compare the following files to the samples in the same folder and update them. ****
**** Use the link at the top of the file to view the changelog. ****
┌────────────┬────────────┬────────────────────────────────────────────────────────────────────────┐
│  old date  │  new date  │ path                                                                   │
├────────────┼────────────┼────────────────────────────────────────────────────────────────────────┤
│            │ 2023-04-13 │ /config/nginx/nginx.conf                                               │
│ 2022-08-20 │ 2023-06-24 │ /config/nginx/ssl.conf                                                 │
│            │ 2023-04-13 │ /config/nginx/site-confs/default.conf                                  │
└────────────┴────────────┴────────────────────────────────────────────────────────────────────────┘
[custom-init] No custom files found, skipping...
[ls.io-init] done.
@github-actions
Copy link

github-actions bot commented Aug 8, 2023

Thanks for opening your first issue here! Be sure to follow the relevant issue templates, or risk having this issue marked as invalid.

@jakern
Copy link

jakern commented Aug 8, 2023

I also have this issue. I'm running this container behind a reverse proxy and thought that could be the issue at first. Now I'm sure it's because this app has recently added nginx configs to the volume.

@aptalca
Copy link
Member

aptalca commented Aug 8, 2023

First step would be to update the configs as the log suggests

@jonathansheehy
Copy link
Author

jonathansheehy commented Aug 8, 2023 via email

@superbreadi
Copy link

superbreadi commented Aug 8, 2023

Hi i have the same problem with latest:

grocy  | [custom-init] No custom files found, skipping...
grocy  | [ls.io-init] done.
grocy  | [migrations] started
grocy  | [migrations] 01-nginx-site-confs-default: skipped
grocy  | [migrations] 02-default-location: skipped
grocy  | [migrations] done
grocy  | usermod: no changes
grocy  | ───────────────────────────────────────
grocy  |
grocy  |
grocy  |       ██╗     ███████╗██╗ ██████╗
grocy  |       ██║     ██╔════╝██║██╔═══██╗
grocy  |       ██║     ███████╗██║██║   ██║
grocy  |       ██║     ╚════██║██║██║   ██║
grocy  |       ███████╗███████║██║╚██████╔╝
grocy  |       ╚══════╝╚══════╝╚═╝ ╚═════╝
grocy  |
grocy  |
grocy  |    Brought to you by linuxserver.io
grocy  | ───────────────────────────────────────
grocy  |
grocy  |
grocy  | To support LSIO projects visit:
grocy  | https://www.linuxserver.io/donate/
grocy  |
grocy  |
grocy  | ───────────────────────────────────────
grocy  | GID/UID
grocy  | ───────────────────────────────────────
grocy  |
grocy  |
grocy  | User UID:    1000
grocy  | User GID:    1000
grocy  | ───────────────────────────────────────
grocy  |
grocy  |
grocy  | using keys found in /config/keys
grocy  | [custom-init] No custom files found, skipping...
grocy  | [ls.io-init] done.

/stockoverview only shows an barcode
if i delete cookies (and login), the login page only shows to many redirects:
ERR_TOO_MANY_REDIRECTS

When i fix the container version to 4.0.0 everything works

@drizuid
Copy link
Member

drizuid commented Aug 8, 2023

disregard the below, i recreated the issue. it only presents on an upgrade.

Are any of you using a reverse proxy? if yes, what is it? Unfortunately, someone on discord also has this issue, but much like you all, did not provide a docker run or compose snippet.

following the readme, i have no issues. I can login and logout without fail and click/use any function. This is a brand new install, i've never use grocy before.

docker run --rm -d \
  --name=grocy \
  -e PUID=1006 \
  -e PGID=996 \
  -e TZ=Etc/UTC \
  -p 9283:80 \
  -v /tmp/grocy:/config \
  lscr.io/linuxserver/grocy:latest
image

@superbreadi
Copy link

superbreadi commented Aug 8, 2023

Hi, I tried to use the same docker run script customized to my directories, same error

docker run --rm -d \
  --name=grocy_test \
  -e PUID=1000 \
  -e PGID=1000 \
  -e TZ=Etc/UTC \
  -p 9283:80 \
  -v /srv/grocy/conf:/config \
  lscr.io/linuxserver/grocy:latest
  
http://192.168.178.80:9283/login
ERR_TOO_MANY_REDIRECTS

No additional proxy in between
I also tried to connect to the container and read the logs, but /var/logs/nginx has an empty error file and /var/log/php82 is also empty.

docker run --rm -d \
  --name=grocy_test \
   -e PUID=1000 \
   -e PGID=1000 \
   -e TZ=Etc/UTC \
   -p 9283:80\ 
   -v /srv/grocy/conf:/config \
  lscr.io/linuxserver/grocy:version-v4.0.0

http://192.168.178.80:9283/login shows login screen, all data is available

@drizuid
Copy link
Member

drizuid commented Aug 8, 2023

we can reproduce it if we upgrade, we are trying to determine the cause. Ill post the efforts so far.

dznet-nas tmp # diff grocy/nginx/nginx.conf grocy2/nginx/nginx.conf
dznet-nas tmp # diff grocy/nginx/resolver.conf grocy2/nginx/resolver.conf
dznet-nas tmp # diff grocy/nginx/ssl.conf grocy2/nginx/ssl.conf
dznet-nas tmp # diff grocy/nginx/worker_processes.conf grocy2/nginx/worker_processes.conf
dznet-nas tmp # diff grocy/nginx/site-confs/default.conf grocy2/nginx/site-confs/default.conf
dznet-nas tmp # diff grocy/nginx/nginx.conf grocy2/nginx/nginx.conf
dznet-nas tmp # diff grocy/nginx/resolver.conf grocy2/nginx/resolver.conf
dznet-nas tmp # diff grocy/nginx/ssl.conf grocy2/nginx/ssl.conf
dznet-nas tmp # diff grocy/nginx/worker_processes.conf grocy2/nginx/worker_processes.conf
dznet-nas tmp # diff grocy/nginx/site-confs/default.conf grocy2/nginx/site-confs/default.conf
dznet-nas tmp # diff grocy/php/www2.conf grocy2/php/www2.conf
dznet-nas tmp # diff grocy/php/php-local.ini grocy2/php/php-local.ini
dznet-nas tmp # diff grocy/www/index.html grocy2/www/index.html
dznet-nas tmp # diff config.php grocy/data/config.php
17,18c17,19
< // When not "production", authentication will be disabled and
< // demo data will be populated during database migrations
---
> // When not "production", the application will work in a demo mode which means
> // authentication is disabled and some demo data will be generated during the database schema migration
> // (pass the query parameter "nodemodata", e.g. https://grocy.example.com/?nodemodata to skip that)

note that while we see differences in config.php, they're just comments. The other primary files have no differences.

@jonathansheehy
Copy link
Author

jonathansheehy commented Aug 9, 2023 via email

@gensyn
Copy link

gensyn commented Aug 10, 2023

I think I kind of have the same problem with 4.0.1 after upgrading.
When I try to access Grocy directly and unencrypted on docker-container port 80 with Firefox, I get NS_ERROR_REDIRECT_LOOP. In 4.0.0 everything works as expected.

But even weirder is the behavior in 4.0.1 if I access Grocy through my nginx reverse proxy. As already mentioned, /stockoverview only shows a barcode. I can access other URLs though, but they don't show the correct page. For example, /api shows the calendar and /calendar shows the equipment. Most, but not all subsites seem to be off by one menu entry.

@berrnd
Copy link

berrnd commented Aug 13, 2023

Technically this is most likely about a not emptied data/viewcache directory during/after the upgrade. See also grocy/grocy#2302.

@andreasbrett
Copy link

Technically this is most likely about a not emptied data/viewcache directory during/after the upgrade. See also grocy/grocy#2302.

That is spot on. I shutdown the grocy container, cleared out the data/viewcache folder and restarted it with the 4.0.1 image (tag: latest) and it works.

@BOFH90
Copy link

BOFH90 commented Aug 13, 2023

Technically this is most likely about a not emptied data/viewcache directory during/after the upgrade. See also grocy/grocy#2302.

That is spot on. I shutdown the grocy container, cleared out the data/viewcache folder and restarted it with the 4.0.1 image (tag: latest) and it works.

I also can confirm this fixes it on my install :)

@drizuid
Copy link
Member

drizuid commented Aug 13, 2023

Technically this is most likely about a not emptied data/viewcache directory during/after the upgrade. See also grocy/grocy#2302.

thank you for sharing this! I dont use grocy, so as you can imagine, my troubleshooting efforts were a bit blind and this is immensely helpful

reading through that i found that this is purely from users doing a major version upgrade without consulting the application documentation at all, as this is covered in their upgrade info which is linked to from our readme.
https://github.com/grocy/grocy#how-to-update

@PascalLeroi
Copy link

Thanks for the comments! I have Watchtower handle my updates and it normally goes great. The upgrade to 4.0.0 was without problems. Just deleted the contents of the data/viewcache and restarted the container. Lo and behold it works again! Thanks :) When I get home, I'll check what happened with Watchtower and the script I used in the first place.

@drizuid drizuid added the wontfix This will not be worked on label Aug 15, 2023
@drizuid
Copy link
Member

drizuid commented Aug 15, 2023

We do not recommend or support using watchtower for automated updates. We suggest reviewing changelogs for breaking changes prior to upgrading. Otherwise, things like this happen when people blindly upgrade.

I will close this as it is not a bug and not something we will make changes in regards to.

@drizuid drizuid closed this as not planned Won't fix, can't repro, duplicate, stale Aug 15, 2023
@LinuxServer-CI LinuxServer-CI moved this from Issues to Done in Issue & PR Tracker Aug 15, 2023
@PascalLeroi
Copy link

We do not recommend or support using watchtower for automated updates. We suggest reviewing changelogs for breaking changes prior to upgrading. Otherwise, things like this happen when people blindly upgrade.

I will close this as it is not a bug and not something we will make changes in regards to.

That is fair. Having my own little Nas is still new to me, so I opted for something that seemed like a good idea. But this has learned me to check before updating.

@AD-Wright
Copy link

Technically this is most likely about a not emptied data/viewcache directory during/after the upgrade. See also grocy/grocy#2302.

thank you for sharing this! I dont use grocy, so as you can imagine, my troubleshooting efforts were a bit blind and this is immensely helpful

reading through that i found that this is purely from users doing a major version upgrade without consulting the application documentation at all, as this is covered in their upgrade info which is linked to from our readme. https://github.com/grocy/grocy#how-to-update

Hey @drizuid - These changes actually did not happen on a major version upgrade, they occurred going from 4.0.0 to 4.0.1 (the author made 3 -> 4 because of API tweaks, and then .0.0 -> .0.1 when they restructured caching). This change was not mentioned in the changelog at all.

The author does not respond positively to any suggestions about handling potential issues on their end, and thus I think something like this will probably crop up again in the future. The root of the issue is a difficult one, as Phil Karlton would say: Cache Invalidation.

If this issue does happen again (i.e. I don't have the time now so I'm writing this for my own reference), I would suggest modifying the Docker to empty the cache for Grocy, I think this might be as simple as changing one line in root/etc/s6-overlay/s6-rc.d/init-grocy-config/run (add rm -r /app/www/data/viewcache; before mkdir -p /app/www/data/viewcache || : ) Not familiar enough with Docker to say for sure. A fix could probably be applied to Grocy, but would probably not be accepted by the author.

That all being said, it will probably be something else that breaks next time, meaning these notes are pointless.

If a change is made to this repository that resolves the issue, something similar should also be suggested to https://github.com/grocy/grocy-docker, which might be more accepting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
Archived in project
Development

No branches or pull requests