Log in Issues

61 views
Skip to first unread message

Alex Murphy

unread,
Aug 7, 2023, 4:09:31 AM8/7/23
to go-cd
Hi guys,
I encountered a problem on login surface, the reason is I made a mistake in the server config, I set the wrong LDAP and clicked save, and now I cannot log in when I input any accounts and passwords.
And I tried to reinstall the GoCD Server and it was not work.
Can anyone give me some suggestions?

Chad Wilson

unread,
Aug 7, 2023, 4:27:15 AM8/7/23
to go...@googlegroups.com
The server configuration that controls this is plain XML, and has source controlled history using git itself so you can use standard git tools (git log, git show etc) to find the config revision as it was before your change and revert the security/login settings back to what they were before.

Location of both the "current" config and the config history depends on how you are running/installing the GoCD server (Linux package install? Windows? containers?) The history should be a config.git subfolder of the 'db' folder. The latest config should be a cruise-config.xml inside the "GoCD Server configuration" folder.
-Chad

--
You received this message because you are subscribed to the Google Groups "go-cd" group.
To unsubscribe from this group and stop receiving emails from it, send an email to go-cd+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/go-cd/7cdbc223-66dd-4055-9c52-86071fedf1b7n%40googlegroups.com.

Alex Murphy

unread,
Aug 7, 2023, 10:18:03 PM8/7/23
to go-cd

Hi Chad,

Yeah, I forgot to tell you the GoCD server is a Windows version, and I located the file, but I tried to delete the content or this file, then I restarted the GoCD Server Service, and the file will recover from before.
How can I change the login type to default that login without any account or password?

Thanks

Chad Wilson

unread,
Aug 7, 2023, 10:40:17 PM8/7/23
to go...@googlegroups.com
I can't recall exactly how it works, but perhaps if the config file is completely removed like you say you did below, GoCD does some magic to restore the latest known version from the history git repo (that I referred to below) rather than starting from scratch.

The most reliable way is to look at the config history in db/config.git (as I mentioned below) to see what your config was before you added the LDAP config and use the git history to restore the content.

However if you just want to completely remove the security/login requirement and any "local" users you have marked as admins etc you should be able to edit the cruise-config.xml directly and remove the entire <security> ...</security> block, leaving other pieces unchanged. Configuration without a security block at all won't require any login.

-Chad

Chad Wilson

unread,
Aug 7, 2023, 11:11:21 PM8/7/23
to go...@googlegroups.com
Forgot to add that if the server seems to be restoring the "old" content, make sure that the service is not running at the time you manually edit the config on disk. The server may cache, flush and overwrite config for various reasons so best to avoid this by ensuring it isn't running or "competing" with your manual edits.

Alex Murphy

unread,
Aug 8, 2023, 5:35:36 AM8/8/23
to go-cd
I tried the way you told me, but nothing changed. I followed the above steps:
1. stop the GoCD server service
2. delete the config file
3. start the server service
And then the config file was shown again and the content is same as the file was deleted.

Chad Wilson

unread,
Aug 8, 2023, 5:47:46 AM8/8/23
to go...@googlegroups.com
I didn't say to delete the config file (I explained why that might not work) - I said to edit the config file and remove the <security>...</security> block from the XML content.

-Chad

Reply all
Reply to author
Forward
0 new messages