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

Host changes to localhost after first login #671

Closed
vega113 opened this issue Feb 23, 2014 · 50 comments
Closed

Host changes to localhost after first login #671

vega113 opened this issue Feb 23, 2014 · 50 comments

Comments

@vega113
Copy link

vega113 commented Feb 23, 2014

How to reproduce:

  1. Install rundeck on CentOS using "Yum RPM Install " instructions at http://rundeck.org/downloads.html
  2. Start the service with service rundeckd start
  3. Navigate to http://yourhost.com:4440
  4. Login with admin/admin
    Expected result: The login is successful and the dashboard is displayed.
    Actual result: the host is changed to http://localhost:4440/menu/home (instead of http://yourhost.com:4440/menu/home) and there's obviously "page cannot be displayed" browser error.

Please note that running rundeck by downloading the rundeck-launcher-2.0.1.jar and running with "java -jar rundeck-launcher-2.0.1.jar" works fine.

@gschueler
Copy link
Member

we need to improve the rpm install script, perhaps setting up hostname detection.

the "localhost" value i set in the /etc/rundeck/rundeck-config.properties file, and is used as in the generation of external URLs. This has to manually changed to the appropriate hostname. There's not a good default to use in the rpm's config file we deliver.

Perhaps Rundeck can internally change the external URL to use the hostname

@gschueler
Copy link
Member

also we could use a first-run install config screen!

@vega113
Copy link
Author

vega113 commented Feb 24, 2014

I see, thanks

@vega113
Copy link
Author

vega113 commented Feb 25, 2014

Still, why running it from the rundeck-launcher-2.0.1.jar works fine?

@gschueler
Copy link
Member

the launcher jar generates the config file with the hostname more dynamically

@ranjanashish
Copy link

I am facing same issue with my rundeck installation on Debian.

Rundeck version: 2.0.1
Debian: Testing

@ramikhashan
Copy link

I just comment the #grails.serverURL=http://localhost:4440
in /etc/rundeck/rundeck-config.properties and it works great now ..

good luck!

@jmickle
Copy link

jmickle commented Aug 18, 2014

this is still an active issue on 2.2.1 any ETA on this?

@kcd83
Copy link

kcd83 commented Aug 25, 2014

Can rundeck honour the "Host:" header and use that as the base or only use relative urls and redirects?

Some form of default like grails.serverURL is still useful for external things like notification emails

@kcd83
Copy link

kcd83 commented Sep 16, 2014

FYI the CLI relies on access to this too.

I set the grails.serverURL to a public ip and had to allow access to that ip from the host (on AWS a security group with port 4440 access to the public ip from the public ip)

@jonatanblue
Copy link

Same issue on Ubuntu 14.04, installing 2.4.2-1 from deb
Same workaround as above: set grails.serverURL in /etc/rundeck/rundeck-config.properties to the external IP of the server

@ashish235
Copy link

Still having the same issue with 2.5.0 on CentOS 7. Any ETA on this issue please? I can't move ahead with using Rundeck with my existing ansible infrastructure until this is fixed.

@mathieuchateau
Copy link
Contributor

Hello,

it's not version 2.5.0 fault, neither centos one.

You need to customize your setup
/etc/rundeck-config.properties
update grails.serverURL=https://name_or_dns_alias

/etc/framework.properties
update framework.rundeck.url=https://name_or_dns_alias

Append :xxx if not on default port (:4440 by default)

Cordialement,
Mathieu CHATEAU
http://www.lotp.fr

2015-04-30 15:31 GMT+02:00 ashish235 notifications@github.com:

Still having the same issue with 2.5.0 on CentOS 7. Any ETA on this issue
please? I can't move ahead with using Rundeck with my existing ansible
infrastructure until this is fixed.


Reply to this email directly or view it on GitHub
#671 (comment).

@ashish235
Copy link

Thanks @mathieuchateau saved me a lot of troubles, I did some sanity and it seems to be working.

@vega113
Copy link
Author

vega113 commented Apr 30, 2015

As already mentioned, just deleting grails.serverURL also works - at least for me.

@huksley
Copy link

huksley commented Aug 11, 2015

As of 2.5.2 this is an open issue.
I have changed rundeck-config.properties, setting grails.serverURL=http://internet.site/rundeck
I have changed framework.properties, setting framework.server.url = http://internet.site
It is not working:

huksley@internet.site:~$ wget http://internet.site/rundeck/
--2015-08-12 01:18:22--  http://internet.site/rundeck/
Resolving internet.site (internet.site)... 192.168.1.1
Connecting to internet.site (internet.site)|192.168.1.1|:80... connected.
HTTP request sent, awaiting response... 302 Found
Location: http://localhost:4440/rundeck/user/login;jsessionid=hue5yaxsg0ez1b624u7kzpz6d [following]

N.B. I am running under reverse proxy, with prefix /rundeck added via -Dserver.web.context=/rundeck parameter on Ubuntu 14.04.

@mathieuchateau
Copy link
Contributor

Hello,

why /rundeck/ in url and serverurl?
You should apopend :4440 as you are not on port 80 in rundeck config

Cordialement,
Mathieu CHATEAU
http://www.lotp.fr

2015-08-12 0:23 GMT+02:00 Ruslan Gainutdinov notifications@github.com:

As of 2.5.2 this is an open issue.
Ive changed rundeck-config.properties, setting grails.serverURL=
http://internet.site/rundeck
Ive changed framework.properties, setting framework.server.url =
http://internet.site
It is not working:

huksley@internet.site:~$ wget http://internet.site/rundeck/
--2015-08-12 http://internet.site/rundeck/--2015-08-12 01:18:22-- http://internet.site/rundeck/
Resolving internet.site (internet.site)... 192.168.1.1
Connecting to internet.site (internet.site)|192.168.1.1|:80... connected.
HTTP request sent, awaiting response... 302 Found
Location: http://localhost:4440/rundeck/user/login;jsessionid=hue5yaxsg0ez1b624u7kzpz6d [following]


Reply to this email directly or view it on GitHub
#671 (comment).

@huksley
Copy link

huksley commented Aug 13, 2015

Hi Mathieu!
I am hosting it behind apache (httpd acting as reverse proxy).
It is part of larger project and i a, running it under prefix /rundeck/ not in the root url.

@abrahamrhoffman
Copy link

netstat shows listening on 0.0.0.0:4440 but remote hosts cannot connect. iptables is clear... anyone have any ideas?

@madhusudhanane
Copy link

Couldn't connect to port 4440 , this port is open in security group , but still couldn't telnet to it

[root@PDXA-DEV-FAB01 rundeck]# netstat -ane |grep 4440
tcp 0 0 :::4440 :::* LISTEN 568 69267499

2016-02-02 20:17:38.337:INFO:/:Initializing Spring FrameworkServlet 'grails'
2016-02-02 20:17:38.364:INFO:oejs.AbstractConnector:Started SelectChannelConnector@0.0.0.0:4440

@abrahamrhoffman
Copy link

Same issue - anyone had any luck fixing this?

@isuftin
Copy link

isuftin commented Feb 17, 2016

I am having a similar issue in that I can connect via localhost to port 4440 and can curl 'http://127.0.0.1:4440' but no content is returned. When telnetting, I am seeing I am hitting Jetty.

# telnet localhost 4440
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
helo
HTTP/1.1 400 Bad Request
Content-Length: 0
Connection: close
Server: Jetty(7.6.0.v20120127)

Connection closed by foreign host.
# curl localhost:4440
#
(no content received)

@ghost
Copy link

ghost commented Apr 12, 2016

Thanks for info dude. @gschueler Appreciate it :)

@gautamsomani-zz
Copy link

Issue still persists for Debian 7 OS, Rundeck version 2.6.7-1-GA.
Solved the issue by commenting out #grails.serverURL=http://localhost:4440
in /etc/rundeck/rundeck-config.properties as RamiKishan suggested, and it worked.

@ronindesign
Copy link

ronindesign commented Aug 14, 2016

+1

I'm on CentOS 7, using yum. I first tried updating /etc/rundeck/framework.properties:

framework.server.name = my.exampleserver.com
framework.server.hostname = my.exampleserver.com
framework.server.port = 4440
framework.server.url = http://my.exampleserver.com:4440

Then I tried updating the only other reference to localhost I could find in rundeck-config.properties:

grails.serverURL=http://my.exampleserver.com:4440

Neither worked. Commenting the above out like others have recommended was the only fix.

@angystardust
Copy link

In order to let rundeck work behind an Apache reverse-proxy, you should set the server.web.context system property in the/etc/rundeck/profile configuration file (please, notice the last 2 lines):

export RDECK_JVM="-Djava.security.auth.login.config=/etc/rundeck/jaas-ad.conf \
        -Dloginmodule.name=multiauth \
        -Drdeck.config=/etc/rundeck \
        -Drdeck.base=/var/lib/rundeck \
        -Drundeck.server.configDir=/etc/rundeck \
        -Dserver.datastore.path=/var/lib/rundeck/data \
        -Drundeck.server.serverDir=/var/lib/rundeck \
        -Drdeck.projects=/var/rundeck/projects \
        -Drdeck.runlogs=/var/lib/rundeck/logs \
        -Drundeck.config.location=/etc/rundeck/rundeck-config.properties \
        -Djava.io.tmpdir=$RUNDECK_TEMPDIR \
        -Dserver.web.context=/rundeck"

@mramanathan
Copy link

For those installing from .jar file, this thread (post by Wyx on May 27,2015) will be useful:

http://stackoverflow.com/questions/37389717/how-to-install-rundeck-in-ubuntu

@steven-tan
Copy link

This is still an issue as of v2.7.3

For now going to comment it out as noted above and move on. If it's going to remain busted, may be worth at least mentioning it in the docs.

@roneybd85
Copy link

I have tried ubuntu 16.04 with Rundeck 1.8.3 . I tried everything stated here but with no luck

@vega113
Copy link
Author

vega113 commented Jul 11, 2017

Did you try to delete grails.serverURL?

@roneybd85
Copy link

I tried it commented it out @vega113

@andrewm659
Copy link

I am facing the same issue on CetnOS 7 (latest). I can comment out the grails.serverURL but ti braeks RunDeck.

`INFO BootStrap: Rundeck is ACTIVE: executions can be run.
INFO BootStrap: Rundeck startup finished in 709ms
2017-07-17 19:05:34.772:INFO:/:main: Initializing Spring FrameworkServlet 'grails'
2017-07-17 19:05:34.855:INFO:oejsh.ContextHandler:main: Started o.e.j.w.WebAppContext@41a374be{/,file:/var/lib/rundeck/exp/webapp/,AVAILABLE}{/var/lib/rundeck/exp/webapp}
2017-07-17 19:05:34.901:INFO:oejs.ServerConnector:main: Started ServerConnector@10ab976b{HTTP/1.1}{0.0.0.0:4440}
2017-07-17 19:05:48.056:INFO:/:qtp1480010240-18: Initializing Spring FrameworkServlet 'grails-errorhandler'

Session terminated, killing shell...2017-07-17 19:06:11.556:INFO:oejs.ServerConnector:Thread-1: Stopped ServerConnector@10ab976b{HTTP/1.1}{0.0.0.0:4440}
2017-07-17 19:06:11.557:INFO:/:Thread-1: Destroying Spring FrameworkServlet 'grails-errorhandler'
2017-07-17 19:06:12.344:INFO:/:Thread-1: Closing Spring root WebApplicationContext
2017-07-17 19:06:12.355:INFO:oejsh.ContextHandler:Thread-1: Stopped o.e.j.w.WebAppContext@41a374be{/,file:/var/lib/rundeck/exp/webapp/,UNAVAILABLE}{/var/lib/rundeck/exp/webapp}
...killed.
WARNING: HTTPS is not enabled, specify -Drundeck.ssl.config=/var/lib/rundeck/server/config/ssl.properties to enable.
2017-07-17 19:06:16.389:INFO:oejs.Server:main: jetty-9.0.7.v20131107
2017-07-17 19:06:19.066:INFO:oejw.StandardDescriptorProcessor:main: NO JSP Support for /, did not find org.apache.jasper.servlet.JspServlet
`

@sinksc
Copy link

sinksc commented Sep 7, 2017

Would love to see hostname detection with the yum rpm install so we don't have to manually update grails.serverURL. Manually updating it works fine, but cleaning that up would make for a seamless install. Just adding myself as a "+1" on this.

@rajeshgit221
Copy link

Hi All,
Installed rundeck and changed from local host to ipaddress in below two places but still i get the "this site can't be reached" error, not sure whats going on, can someone help me with this issue ?

  1. rundeck-config.properties
  2. framework.properties
    Error when i tried to login using http://ipaddress:4440/
    This site can’t be reached
    "ipaddress took too long to respond."
    ERR_CONNECTION_TIMED_OUT

Thanks in Advance...

@getSurreal
Copy link

Geez! 4 years without resolving this simple issue?

@EricoCartmanez
Copy link

Would be nice if it was at least mentioned in the manual. Where to change the "localhost".

@sjrd218
Copy link
Contributor

sjrd218 commented Apr 11, 2018

In your rundeck-config.properties file try setting the server.host property to be the hostname of your system. See if that achieves the desired result.

@ajgeek
Copy link

ajgeek commented Aug 20, 2018

any one please help or guide me with this tool . i am using rundeck for first time . i am able to login into the api but after login its says page not found . not redirecting to the defualt dashboard view. i have installed rundeck using launcher in the unix env
rundeck_error
Please refer to the snapshot.

@kishan-1234
Copy link

kishan-1234 commented Jan 24, 2019

I am running rundeck using docker. Using the docker image from hub 3.0.13. Its having same redirection issue and inside /etc/ no rundeck folder is present. Can anyone please help me with this?

@meirim-pt
Copy link

I am running rundeck using docker. Using the docker image from hub 3.0.13. Its having same redirection issue and inside /etc/ no rundeck folder is present. Can anyone please help me with this?

docker exec -it tst_rundeck_1 /bin/bash
cd /etc/remco/templates
sed 's/127.0.0.1/myhost.domain/' rundeck-config.properties > rundeck-config.properties1
cp rundeck-config.properties1 rundeck-config.properties
sed 's/127.0.0.1/myhost.domain/' framework.properties >framework.properties1
cp framework.properties1 framework.properties

docker restart tst_rundeck_1

Firefox:http://myhost.domain:4440

admin/admin
pressed login twice(?)

@ProTip
Copy link
Contributor

ProTip commented Mar 9, 2019

Hi @kishan-1234 ,

The environment variable RUNDECK_GRAILS_URL as documented on the Docker image page is used to set the URL for the application. This defaults to http://127.0.0.1:4440, however you can change it to localhost or whichever URL the user is expected to access Rundeck at. This example in the Docker Zoo changes it to localhost port 80 for running behind an nginx proxy.

This configuration setting maps to the grails.serverURL= setting in rundeck-config.properties which should be set for non-Docker installations. Anyone having redirect issues on login should verify first that this setting is set to the valid URL and that it matches the desired location.

I'm going to go ahead and close this for now as the discussion has wandered a bit and the issue has become a catch-all for configuration questions :) Please direct any usage and configuration questions to the Rundeck Discussion Group.

@ProTip ProTip closed this as completed Mar 9, 2019
@arnabdutta2194
Copy link

I am facing the following error: Connection refused (Connection refused) when I am running a rundeck job to 5 Windows Nodes. Please help if possible anyone.

@fdansey-ostmodern
Copy link

I got around the same problem (of rundeck running behind nginx) by using the application setting:
RUNDECK_GRAILS_URL = /.
such that the UI forms API calls using the same host that the user is accessing the page with.

@RavianXReaver
Copy link

I just comment the #grails.serverURL=http://localhost:4440
in /etc/rundeck/rundeck-config.properties and it works great now ..

good luck!

I Can't believe this issue still exists! Almost gave up using Rundeck.
Anyways thanks for the workaround!!

@ghost
Copy link

ghost commented Oct 13, 2020

@fdansey-ostmodern It worked for me when you put your external hostname
RUNDECK_GRAILS_URL=http://xxxx.xxxxx.xxx

steviecoaster added a commit to steviecoaster/rundeck-vagrant that referenced this issue May 14, 2021
See rundeck/rundeck#671. Upon first login, the page is
redirected to localhost, which fails. Set grails.serverURL to use the ip address of the vm.
This resolves the issue.
@raghavendar-ts
Copy link

This comment is off the topic. What the "A" represent in the hostname PDXA-DEV-FAB01 (specifically in PDXA). PDX is the airport code which I am familiar with. What does "A" signify?

@kevinadhiguna
Copy link

I ran to this issue when using docker-compose.yml here.

To solve the problem, I added RUNDECK_GRAILS_URL: ${RUNDECK_GRAILS_URL:-localhost:4440} in environment section of docker-compose.yml. This worked but I wanted to add environment variable to handle the URL, so it looked like this :
RUNDECK_GRAILS_URL: ${RUNDECK_GRAILS_URL:-localhost:4440}

The whole docker-compose.yml is :

version: '3'

services:
    rundeck:
        image: rundeck/rundeck:SNAPSHOT
        # links:
        #   - mysql
        depends_on:
          - mysql
        environment:
            RUNDECK_DATABASE_DRIVER: org.mariadb.jdbc.Driver
            RUNDECK_DATABASE_USERNAME: ${RUNDECK_DATABASE_USERNAME:-rundeck}
            RUNDECK_DATABASE_PASSWORD: ${RUNDECK_DATABASE_PASSWORD:-rundeck}
            RUNDECK_DATABASE_URL: ${RUNDECK_DATABASE_URL:-jdbc:mysql://mysql/rundeck?autoReconnect=true&useSSL=false}
            # Add 'RUNDECK_GRAILS_URL' to avoid host changing to localhost (see more : https://github.com/rundeck/rundeck/issues/671)
            # 'RUNDECK_GRAILS_URL' can be remote IP address, such as 43.133.23.165 or hostname, like https://mywebsite.com
            RUNDECK_GRAILS_URL: ${RUNDECK_GRAILS_URL:-localhost:4440}
        # volumes:
        #   - ${RUNDECK_LICENSE_FILE:-/dev/null}:/home/rundeck/etc/rundeckpro-license.key
        ports:
          - 4440:4440
    mysql:
        image: mysql:5.7
        # expose:
        #   - 3306
        ports:
          - 3306:3306
        environment:
          MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD:-root}
          MYSQL_DATABASE: ${MYSQL_DATABASE:-rundeck}
          MYSQL_USER: ${MYSQL_USER:-rundeck}
          MYSQL_PASSWORD: ${MYSQL_PASSWORD:-rundeck}
        volumes:
          - dbdata:/var/lib/mysql

volumes:
    dbdata:

Also, this is the .env file that includes environment variables and thier values :

RUNDECK_DATABASE_USERNAME=rundeck
RUNDECK_DATABASE_PASSWORD=rundeck
RUNDECK_DATABASE_URL=jdbc:mysql://mysql/rundeck?autoReconnect=true&useSSL=false
RUNDECK_GRAILS_URL=https://mywebsite.com
MYSQL_ROOT_PASSWORD=root
MYSQL_DATABASE=rundeck
MYSQL_USER=rundeck
MYSQL_PASSWORD=rundeck

Feel free to change the value of RUNDECK_GRAILS_URL in .env.

You can have a look here to check them all, including how to run the docker-compose and its setup :

kevinadhiguna added a commit to kevinadhiguna/docker-zoo that referenced this issue Dec 25, 2021
Added RUNDECK_GRAILS_URL to fix rundeck/rundeck#671 and rundeck#4 on development powered by docker-compose.
kevinadhiguna added a commit to kevinadhiguna/docker-zoo that referenced this issue Dec 25, 2021
Added RUNDECK_GRAILS_URL to fix rundeck/rundeck#671 and rundeck#4 on development powered by docker-compose.
@shotarry
Copy link

I am running rundeck using docker. Using the docker image from hub 3.0.13. Its having same redirection issue and inside /etc/ no rundeck folder is present. Can anyone please help me with this?

docker exec -it tst_rundeck_1 /bin/bash cd /etc/remco/templates sed 's/127.0.0.1/myhost.domain/' rundeck-config.properties > rundeck-config.properties1 cp rundeck-config.properties1 rundeck-config.properties sed 's/127.0.0.1/myhost.domain/' framework.properties >framework.properties1 cp framework.properties1 framework.properties

docker restart tst_rundeck_1

Firefox:http://myhost.domain:4440

admin/admin pressed login twice(?)

I have just logged in in github to say thank you, you are a hero.

@shotarry
Copy link

it's off topic but projects is empty while I have created two, does anyone know where to find it? Environment docker

@alessandroAmedei
Copy link

alessandroAmedei commented Oct 19, 2023

I installed rundeck using docker and this worked for me:
`docker run --name some-rundeck -p 4440:4440 -e RUNDECK_GRAILS_URL=http://X.Y.Z.W:4440 -d -v data:/home/rundeck/server/data rundeck/rundeck:4.17.1

You need to set RUNDECK_GRAILS_URL as envirorment variable.
`

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