Demo Discussion
Forum Config Examples Contributions Vulnerabilities
  Discussion forum about ELOG, Page 729 of 796  Not logged in ELOG logo
New entries since:Thu Jan 1 01:00:00 1970
ID Date Iconup Author Author Email Category OS ELOG Version Subject
  69543   Tue Jul 19 11:13:09 2022 Reply Stefan Rittstefan.ritt@psi.chQuestionLinux3.1.3Re: Too many redirects when running behind load balancer?

Probably you need a setting

URL = https://elog.test.km3net.de

or so in your elogd.cfg file.

Stefan

Tamas Gal wrote:

We were running ELOG for many many years in our experiments and the instance was operated on a Debian XEN server as a container. I am now trying to migrate it into our Docker Swarm cluster and I am using the https://hub.docker.com/r/de1lz/elog-docker Docker image, which works very well with our logbooks when I run it as a single container. However, when I put the container behind my load balancer (HAProxy) using the simple HTTP mode (which works very well for all the other HTTP-based services) with this simple configuration:

backend be_elog.km3net.de
    mode http
    server-template km3net-elog- 1 km3net-elog_elog:8080 check resolvers docker init-addr libc,none

I get a "too many redirects" error when I try to access one of the logbooks. The starting page works fine, but every other link leads to a pile-up of redirects.

Here is the current instance running, where you can see the behaviour: https://elog.test.km3net.de (all log entries deleted and only two logbooks activated)

My question is: what kind of redirect could go wrong here? I don't know how the internal HTTP server of ELOG works, but maybe someone faced similar issues.

My ELOG configuration is also pretty basic, and as I wrote above, everything works when I run it without the load balancer (single instance at the moment). Here is the top part of the configuration, it contains a few dozens of logbooks but they are configured the very same way. 

;User Settings
;=============
Password file = login.xml
Admin user = km3net_admin
Self register = 0
Allow password change = 0
Allow config = km3net_admin

;Group Settings:
;====
Group ELOGKM3NET = Operations IT, Operations FR

[Operations IT]
Subdir = Operations_IT
Theme = default
Default encoding = 0
Comment = KM3NeT IT Detector Operations
Attributes = Author, Type, Subject
Options Author = A, B, C
Options Type = PPM-DOM, PPM-DU, Comment, Power cut, New run
Extendable Options = Type
Required Attributes = Author, Type, Subject
Page Title = ELOG - $subject
;Sort Attributes = Author, Type
Quick filter = Date, Type, Author
Resubmit default = 2
Reverse sort = 1
Menu commands = List, New, Edit, Reply, Duplicate, Find, Config, Help, Logout
Preset on first reply Subject = Re: $Subject
Preset on reply author =

 

 

  69544   Tue Jul 19 11:17:44 2022 Reply Tamas Galtgal@km3net.deQuestionLinux3.1.3Re: Too many redirects when running behind load balancer?

Thanks for the quick reply! Sorry, I forgot to paste the "global" part of the config, I have that URL already set:

[global]
;Main Settings
;=============
Usr = elog
Grp = elog
port = 8080
SSL = 0
URL = https://elog.test.km3net.de
Title image = <img border=0 src="KM3NeT_logo.png" alt="KM3NeT logo" height="35px">
;SMTP host = smtp.fau.de
Display mode = summary
Thumbnail size = 500>
List Menu text = clock.html
Menu text = clock.html

Stefan Ritt wrote:

Probably you need a setting

URL = https://elog.test.km3net.de

or so in your elogd.cfg file.

Stefan

 

  69545   Tue Jul 19 11:24:36 2022 Reply Tamas Galtgal@km3net.deQuestionLinux3.1.3Re: Too many redirects when running behind load balancer?

I also tried the default configuration (example config) and it that works behind the load balancer. So I guess it's related to the password-page, which causes this redirect loop? Our logbooks are all password protected, so when a logbook URL is clicked, it should first present the login-form, and that's where it chokes.

  69546   Tue Jul 19 11:40:59 2022 Reply Stefan Rittstefan.ritt@psi.chQuestionLinux3.1.3Re: Too many redirects when running behind load balancer?

Yeah, after you enter a password, elog redirects to what it finds in "URL". You can trace that by opening "development tools" in Google Chrome, go to "network" and watch packets going back and forth. I never worked with the load balancer, but maybe you need a different "URL" containing a '/' at the end?

Tamas Gal wrote:

I also tried the default configuration (example config) and it that works behind the load balancer. So I guess it's related to the password-page, which causes this redirect loop? Our logbooks are all password protected, so when a logbook URL is clicked, it should first present the login-form, and that's where it chokes.

 

  69547   Tue Jul 19 12:36:04 2022 Reply Tamas Galtgal@km3net.deQuestionLinux3.1.3Re: Too many redirects when running behind load balancer?

My problem is that I don't even reach the page where I can enter a password. If you go to https://elog.test.km3net.de and click on a logbook, you'll see that it immediately goes into a redirect loop. I already logged the routing but there is nothing else...

Stefan Ritt wrote:

Yeah, after you enter a password, elog redirects to what it finds in "URL". You can trace that by opening "development tools" in Google Chrome, go to "network" and watch packets going back and forth. I never worked with the load balancer, but maybe you need a different "URL" containing a '/' at the end?

Tamas Gal wrote:

I also tried the default configuration (example config) and it that works behind the load balancer. So I guess it's related to the password-page, which causes this redirect loop? Our logbooks are all password protected, so when a logbook URL is clicked, it should first present the login-form, and that's where it chokes.

 

 

  69548   Tue Jul 19 12:38:12 2022 Reply Tamas Galtgal@km3net.deQuestionLinux3.1.3Re: Too many redirects when running behind load balancer?

Attached is the log, where you can see that `Operations+IT` redirects to `Operations+IT/` and that redirects to `Operations+IT` again, which then goes to `elog.test.km3net.de` and `Operations+IT` again etc. etc.

EDIT: I  use the very same load balancer confugration for dozens of other services incl. Apache, Nginx, GitLab, Mattermost, RocketChat etc. and all work fine. As written before, also the "example" logbook works (without password protection).

I also tried `/` at the end of the URL but it has no effect.

I am pretty clueless currently...

Attachment 1: Screenshot_2022-07-19_at_12.37.55.png
Screenshot_2022-07-19_at_12.37.55.png
  69549   Tue Jul 19 12:48:42 2022 Reply Stefan Rittstefan.ritt@psi.chQuestionLinux3.1.3Re: Too many redirects when running behind load balancer?

Yes I see the redirects. You say with the example logbook it works, right? Is it the password protection which triggers the problem or anything else? Does it work if you take out the password protection? The key is to identify which setting in your config file triggers the problem, so you can bracket the problem down between the example logbook and your logbook definition.

  69550   Tue Jul 19 12:57:37 2022 Reply Tamas Galtgal@km3net.deQuestionLinux3.1.3Re: Too many redirects when running behind load balancer?

Yes, I used the empty `passwd` file from example. When I then click on one of the logbooks, I get to the page where I can register a user (see attached screenshot). After clickin on "Save" for the user registration, I again get the redirect error. Once there is a registered user (i.e. a non-empty password file) the redirect issue is persistent. Any idea where the problem might be? I just emptied the password file again, so you can have a one-shot, if you like.

Btw. I have SSL termination in the load balancer, so ELOG does not need to do any SSL related things (the swarm is in a locally isolated network, so all internal communication between the load balancer and the swarm machines are safe). Maybe that's the issue? On the other hand, the main page loads fine and uses SSL termination too, so I don't know, maybe there is logic behind the authentication which collides with the SSL termination.

Stefan Ritt wrote:

Yes I see the redirects. You say with the example logbook it works, right? Is it the password protection which triggers the problem or anything else? Does it work if you take out the password protection? The key is to identify which setting in your config file triggers the problem, so you can bracket the problem down between the example logbook and your logbook definition.

 

Attachment 1: Screenshot_2022-07-19_at_13.02.19.png
Screenshot_2022-07-19_at_13.02.19.png
ELOG V3.1.5-fe60aaf