Help with setting up Discourse ID

Yes, sorry, the error message here needs improving. When you see this error message, something failed in the automatic registration, We should fix core to show you what that error was.

If you try again to enable ID and you go to /logs on your instance, do you see any errors reported there?

2 Likes

No nothing. Just tried. Last log is from Sunday.

Can you open the Rails console of your instance and try this command:

DiscourseId::Register.call

It likely will fail, but it should give you a more useful error message.

1 Like

Which command in particular?

I tried: rake DiscourseId::Register.call

root@prometheus-discourse-concarne:/var/www/discourse# rake DiscourseId::Register.call
rake aborted!
Don't know how to build task 'DiscourseId::Register.call' (See the list of available tasks with `rake --tasks`)
Did you mean?  discourse_calendar:install:migrations
/usr/local/bin/bundle:25:in `load'
/usr/local/bin/bundle:25:in `<main>'
(See full trace by running task with --trace)

And I tried rails r "DiscourseId::Register.call", which gives nothing back on the console.

/EDIT: Sorry, I did not mention, it did not activate or create anything. I still have the same error message when trying to enable Discourse ID.

You need to do this:

./launcher enter app
rails c
DiscourseId::Register.call

Oh. It looks like that’s what rails r does. Sorry. I didn’t know that one. But judging from the output I just got, it’s improbable that at the rails console, at least, you can get no output.

Yeah. And I tried rails r and it produces no output, so you do need to run rails console as instructed.

1 Like

You need to go via the console, as Pfaffman noted. DiscourseId::Register.call is not a rake task.

1 Like

Thanks @pfaffman and @pmusaraj it worked now. And I got an idea what’s going on here (with all instances because same configuration)…

"Registration failed: 400\nError: {\"errors\":[\"You supplied invalid parameters to the request: Domain validation failed: Failed to fetch https://forum.concarne.org/.well-known/discourse-id-challenge with error code: 404\"],\"error_type\":\"invalid_parameters\"}"

As said, I have Discourse behind an Apache webserver. For the Letsencrypt certificate challenge I have an exception for queries to the .well-known directory.

Brb, I’m trying to change that.

1 Like

Yes, that was it!

Until now I had ProxyPass /.well-known ! which I changed to ProxyPass /.well-known/acme-challenge !

Maybe this should be added to the howto (which I’m unable to find at the moment…) for setting up self-hosted Discourse instances?

RequestHeader set X-Forwarded-Proto "https"
ProxyPreserveHost On
ProxyRequests Off
ProxyPass /.well-known/acme-challenge !
ProxyPass / http://localhost:8080/
ProxyPassReverse / http://localhost:8080/

Thank you guys for being so patient with me. :slight_smile:

2 Likes