Find/chown command in Discourse rebuild step fails when there are dangling symlinks


(Andrew E) #1

The following change has a subtle bug that causes the find command to fail when it finds a dangling symlink:

I, [2018-08-28T20:12:40.296504 #15]  INFO -- : > cd /var/www/discourse && find /var/www/discourse ! -user discourse -exec chown discourse {} \+
chown: cannot dereference '/var/www/discourse/plugins/discourse_cas_sso/public/cas_sso': No such file or directory

The plugin I am trying to add is GitHub - eriko/discourse_cas_sso: An app that proxy connects CAS authentication to discourse via the discourse sso api

The repo has this symlink:

andrew@ipsum:~/src/web/discourse/discourse_cas_sso$ ls public/cas_sso -lh
lrwxrwxrwx 1 andrew andrew 25 Aug 17 16:27 public/cas_sso -> /Users/eriko/.pow/cas_sso

I imagine that this was working before, so some people’s future Discourse upgrades may break depending on which plugins they have installed.


(Andrew E) #2

Here is the issue on GitHub for that specific repo:


(eriko) #3

You are correct and I have removed the file. That said this is not a plugin for discourse. It is a separate application that you need to run separately from discourse. Read this What is the procedure to obtain CAS between my website and my discourse instance?

It at all possible you should use something other than CAS. If your site is using a current version of JASIG CAS then you should have SAML available and should use the official SAML plugin. We will be moving to that in the next year at which point I will stop maintaining this code. Seriously use anything else.


(Andrew E) #4

@eriko Thanks for the clarification and your forthrightness about the current state of your CAS application. Unfortunately we are stuck on rubycas for the time being. We do intend to move away, but that is likely to occur after we get our Discourse install up and running. Hopefully we’ll move to something like simplesamlphp by the time you make your migration to JASIG CAS.


(eriko) #5

Ouch. I wish you the best.


(Andrew E) #6

@eriko Do you plan on creating a Discourse SSO application for SAML once you start using that on your systems?


(Andrew E) #7

Oh, I see that it already exists here: