# Account creation not working with discourse\_encrypt

**URL:** https://meta.discourse.org/t/account-creation-not-working-with-discourse-encrypt/246520
**Category:** Bug
**Tags:** encrypt
**Created:** [November 23, 2022, 8:54am UTC](https://meta.discourse.org/t/account-creation-not-working-with-discourse-encrypt/246520 "2022-11-23T08:54:45Z")
**Posts on this page:** 14
**Page:** 1

<div class="post-metadata">

### Author: ![Don](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/don/32/228726_2.png) [@Don](https://meta.discourse.org/u/Don)
#### Post date: [November 23, 2022, 8:54am UTC](https://meta.discourse.org/t/account-creation-not-working-with-discourse-encrypt/246520/1 "2022-11-23T08:54:46Z")

</div>

Hello,

Since I [first](https://github.com/discourse/discourse/compare/4db5525d2582a39d5b64885e77307224483dfd97...d7b766006158d3c23b3e353d5aad140e9a676b84), [second](https://github.com/discourse/discourse/compare/d7b766006158d3c23b3e353d5aad140e9a676b84...01392ab90c97db174d6561a47688a3f4a6f5179e) updated yesterday the registration not working.

When I click the Create your account button in create-account modal then I get an alert error top of the modal:

> Something went wrong, perhaps the username or email is already registered. Try the forgot password link.

Which is not true because I tried with new email and username… and the field validations are also accepted.

I also have two required `confirmation` user field if that means something.

* * *

I tried it with [safe mode](https://meta.discourse.org/t/53504?silent=true) and rebuild etc… Nothing worked.  
No error in console or /logs.

* * *

One more thing I changed yesterday is add the following to clean up old assets 🔽  
(I use Digital Ocean Spaces)

> [@Configure an S3 compatible object storage provider for uploads](https://meta.discourse.org/t/configure-an-s3-compatible-object-storage-provider-for-uploads/148916/1):
>
> `- sudo -E -u discourse bundle exec rake s3:expire_missing_assets`

But this is run successfully when I rebuild or update.

* * *

[Here is the site.](https://vaperina.cc) Where you can check it.

Any help or idea would be appreciated! Thank you 🙂

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [November 23, 2022, 9:19am UTC](https://meta.discourse.org/t/account-creation-not-working-with-discourse-encrypt/246520/2 "2022-11-23T09:19:58Z")

</div>

I’ve just tried to register and I also get an error (though running it through translation I get ‘Something went wrong! Registration is currently under maintenance! Please come back later and try again.’\[1\])

It works here on Meta, so that may help narrow it down. I’ll try and see if I can break my test site with some custom fields, etc. 👍

* * *

1. Valami hiba történt! A regisztráció jelenleg karbantartás alatt van! Kérlek, látogass vissza kicsit később és próbáld újra.

---

<div class="post-metadata">

### Author: ![Don](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/don/32/228726_2.png) [@Don](https://meta.discourse.org/u/Don)
#### Post date: [November 23, 2022, 9:23am UTC](https://meta.discourse.org/t/account-creation-not-working-with-discourse-encrypt/246520/3 "2022-11-23T09:23:22Z")

</div>

> [@JammyDodger](#):
>
> Something went wrong! Registration is currently under maintenance! Please come back later and try again.

Thanks for checking 🙂 Yeah I just rewrite the default error message to warn the users the issue is our side. Sorry I forget to mentioned it. 😕

But this message is the: `login.something_already_taken`

---

<div class="post-metadata">

### Author: ![Don](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/don/32/228726_2.png) [@Don](https://meta.discourse.org/u/Don)
#### Post date: [November 23, 2022, 10:13am UTC](https://meta.discourse.org/t/account-creation-not-working-with-discourse-encrypt/246520/4 "2022-11-23T10:13:12Z")

</div>

I tried to register with invite and it dropped me finally an Internal Server Error 🙂

With the following error in `/logs`  
 ![Screenshot 2022-11-23 at 11.05.09](https://global.discourse-cdn.com/meta/optimized/4X/6/c/1/6c14c7e7566ac15ce99d09c597782cfd13823f9a_2_690x45.png)

> **Info**
>
> ```plaintext
> ActiveRecord::NotNullViolation (PG::NotNullViolation: ERROR: null value in column "encrypt_pms_default" of relation "user_options" violates not-null constraint
> DETAIL: Failing row contains (5333, f, t, t, t, f, t, 10080, 300000, 2880, null, 2, f, 1, 1, f, 2, 0, t, null, {}, f, 0, 0, 1, 0, 0, f, null, f, null, f, null, 0, null, t, null, null, null, null, 3, null, 1, f, null, 0, null).
> )
> app/models/user.rb:1734:in `create_user_option'
> app/models/invite_redeemer.rb:142:in `create_user_from_invite'
> app/models/invite_redeemer.rb:208:in `invited_user'
> app/models/invite_redeemer.rb:260:in `add_user_to_groups'
> app/models/invite_redeemer.rb:226:in `process_invitation'
> app/models/invite_redeemer.rb:55:in `block in redeem'
> app/models/invite_redeemer.rb:53:in `redeem'
> app/models/invite.rb:227:in `redeem'
> app/controllers/invites_controller.rb:227:in `perform_accept_invitation'
> app/controllers/application_controller.rb:413:in `block in with_resolved_locale'
> app/controllers/application_controller.rb:413:in `with_resolved_locale'
> lib/middleware/omniauth_bypass_middleware.rb:71:in `call'
> lib/content_security_policy/middleware.rb:12:in `call'
> lib/middleware/anonymous_cache.rb:368:in `call'
> config/initializers/008-rack-cors.rb:25:in `call'
> config/initializers/100-quiet_logger.rb:23:in `call'
> config/initializers/100-silence_logger.rb:31:in `call'
> lib/middleware/enforce_hostname.rb:23:in `call'
> lib/middleware/request_tracker.rb:202:in `call'
> 
> ```

> **Backtrace**
>
> ```plaintext
> rack-mini-profiler (3.0.0) lib/patches/db/pg.rb:69:in `exec_params'
> 
> rack-mini-profiler (3.0.0) lib/patches/db/pg.rb:69:in `exec_params'
> 
> activerecord (7.0.3.1) lib/active_record/connection_adapters/postgresql_adapter.rb:768:in `block (2 levels) in exec_no_cache'
> 
> activesupport (7.0.3.1) lib/active_support/concurrency/share_lock.rb:187:in `yield_shares'
> 
> activesupport (7.0.3.1) lib/active_support/dependencies/interlock.rb:41:in `permit_concurrent_loads'
> 
> activerecord (7.0.3.1) lib/active_record/connection_adapters/postgresql_adapter.rb:767:in `block in exec_no_cache'
> 
> activesupport (7.0.3.1) lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `handle_interrupt'
> 
> activesupport (7.0.3.1) lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `block in synchronize'
> 
> activesupport (7.0.3.1) lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `handle_interrupt'
> 
> activesupport (7.0.3.1) lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `synchronize'
> 
> activerecord (7.0.3.1) lib/active_record/connection_adapters/abstract_adapter.rb:765:in `block in log'
> 
> activesupport (7.0.3.1) lib/active_support/notifications/instrumenter.rb:24:in `instrument'
> 
> activerecord (7.0.3.1) lib/active_record/connection_adapters/abstract_adapter.rb:756:in `log'
> 
> activerecord (7.0.3.1) lib/active_record/connection_adapters/postgresql_adapter.rb:766:in `exec_no_cache'
> 
> activerecord (7.0.3.1) lib/active_record/connection_adapters/postgresql_adapter.rb:745:in `execute_and_clear'
> 
> activerecord (7.0.3.1) lib/active_record/connection_adapters/postgresql/database_statements.rb:54:in `exec_query'
> 
> activerecord (7.0.3.1) lib/active_record/connection_adapters/abstract/database_statements.rb:132:in `exec_insert'
> 
> activerecord (7.0.3.1) lib/active_record/connection_adapters/postgresql/database_statements.rb:92:in `exec_insert'
> 
> activerecord (7.0.3.1) lib/active_record/connection_adapters/abstract/database_statements.rb:167:in `insert'
> 
> activerecord (7.0.3.1) lib/active_record/connection_adapters/abstract/query_cache.rb:22:in `insert'
> 
> activerecord (7.0.3.1) lib/active_record/persistence.rb:496:in `_insert_record'
> 
> activerecord (7.0.3.1) lib/active_record/persistence.rb:1096:in `_create_record'
> 
> activerecord (7.0.3.1) lib/active_record/counter_cache.rb:166:in `_create_record'
> 
> activerecord (7.0.3.1) lib/active_record/locking/optimistic.rb:79:in `_create_record'
> 
> activerecord (7.0.3.1) lib/active_record/attribute_methods/dirty.rb:222:in `_create_record'
> 
> activerecord (7.0.3.1) lib/active_record/callbacks.rb:461:in `block in _create_record'
> 
> activesupport (7.0.3.1) lib/active_support/callbacks.rb:107:in `run_callbacks'
> 
> activesupport (7.0.3.1) lib/active_support/callbacks.rb:929:in `_run_create_callbacks'
> 
> activerecord (7.0.3.1) lib/active_record/callbacks.rb:461:in `_create_record'
> 
> activerecord (7.0.3.1) lib/active_record/timestamp.rb:108:in `_create_record'
> 
> activerecord (7.0.3.1) lib/active_record/persistence.rb:1067:in `create_or_update'
> 
> activerecord (7.0.3.1) lib/active_record/callbacks.rb:457:in `block in create_or_update'
> 
> activesupport (7.0.3.1) lib/active_support/callbacks.rb:107:in `run_callbacks'
> 
> activesupport (7.0.3.1) lib/active_support/callbacks.rb:929:in `_run_save_callbacks'
> 
> activerecord (7.0.3.1) lib/active_record/callbacks.rb:457:in `create_or_update'
> 
> activerecord (7.0.3.1) lib/active_record/timestamp.rb:126:in `create_or_update'
> 
> activerecord (7.0.3.1) lib/active_record/persistence.rb:648:in `save!'
> 
> activerecord (7.0.3.1) lib/active_record/validations.rb:53:in `save!'
> 
> activerecord (7.0.3.1) lib/active_record/transactions.rb:302:in `block in save!'
> 
> activerecord (7.0.3.1) lib/active_record/transactions.rb:354:in `block in with_transaction_returning_status'
> 
> activerecord (7.0.3.1) lib/active_record/connection_adapters/abstract/database_statements.rb:314:in `transaction'
> 
> activerecord (7.0.3.1) lib/active_record/transactions.rb:350:in `with_transaction_returning_status'
> 
> activerecord (7.0.3.1) lib/active_record/transactions.rb:302:in `save!'
> 
> activerecord (7.0.3.1) lib/active_record/suppressor.rb:54:in `save!'
> 
> activerecord (7.0.3.1) lib/active_record/persistence.rb:55:in `create!'
> 
> app/models/user.rb:1734:in `create_user_option'
> 
> activesupport (7.0.3.1) lib/active_support/callbacks.rb:400:in `block in make_lambda'
> 
> activesupport (7.0.3.1) lib/active_support/callbacks.rb:236:in `block in halting_and_conditional'
> 
> activesupport (7.0.3.1) lib/active_support/callbacks.rb:599:in `block in invoke_after'
> 
> activesupport (7.0.3.1) lib/active_support/callbacks.rb:599:in `each'
> 
> activesupport (7.0.3.1) lib/active_support/callbacks.rb:599:in `invoke_after'
> 
> activesupport (7.0.3.1) lib/active_support/callbacks.rb:108:in `run_callbacks'
> 
> activesupport (7.0.3.1) lib/active_support/callbacks.rb:929:in `_run_create_callbacks'
> 
> activerecord (7.0.3.1) lib/active_record/callbacks.rb:461:in `_create_record'
> 
> activerecord (7.0.3.1) lib/active_record/timestamp.rb:108:in `_create_record'
> 
> activerecord (7.0.3.1) lib/active_record/persistence.rb:1067:in `create_or_update'
> 
> activerecord (7.0.3.1) lib/active_record/callbacks.rb:457:in `block in create_or_update'
> 
> activesupport (7.0.3.1) lib/active_support/callbacks.rb:118:in `block in run_callbacks'
> 
> activerecord (7.0.3.1) lib/active_record/autosave_association.rb:370:in `around_save_collection_association'
> 
> activesupport (7.0.3.1) lib/active_support/callbacks.rb:127:in `block in run_callbacks'
> 
> activesupport (7.0.3.1) lib/active_support/callbacks.rb:138:in `run_callbacks'
> 
> activesupport (7.0.3.1) lib/active_support/callbacks.rb:929:in `_run_save_callbacks'
> 
> activerecord (7.0.3.1) lib/active_record/callbacks.rb:457:in `create_or_update'
> 
> activerecord (7.0.3.1) lib/active_record/timestamp.rb:126:in `create_or_update'
> 
> activerecord (7.0.3.1) lib/active_record/persistence.rb:648:in `save!'
> 
> activerecord (7.0.3.1) lib/active_record/validations.rb:53:in `save!'
> 
> activerecord (7.0.3.1) lib/active_record/transactions.rb:302:in `block in save!'
> 
> activerecord (7.0.3.1) lib/active_record/transactions.rb:354:in `block in with_transaction_returning_status'
> 
> activerecord (7.0.3.1) lib/active_record/connection_adapters/abstract/database_statements.rb:314:in `transaction'
> 
> activerecord (7.0.3.1) lib/active_record/transactions.rb:350:in `with_transaction_returning_status'
> 
> activerecord (7.0.3.1) lib/active_record/transactions.rb:302:in `save!'
> 
> activerecord (7.0.3.1) lib/active_record/suppressor.rb:54:in `save!'
> 
> app/models/invite_redeemer.rb:142:in `create_user_from_invite'
> 
> app/models/invite_redeemer.rb:208:in `invited_user'
> 
> app/models/invite_redeemer.rb:260:in `add_user_to_groups'
> 
> app/models/invite_redeemer.rb:226:in `process_invitation'
> 
> app/models/invite_redeemer.rb:55:in `block in redeem'
> 
> activerecord (7.0.3.1) lib/active_record/connection_adapters/abstract/transaction.rb:319:in `block in within_new_transaction'
> 
> activesupport (7.0.3.1) lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `handle_interrupt'
> 
> activesupport (7.0.3.1) lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `block in synchronize'
> 
> activesupport (7.0.3.1) lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `handle_interrupt'
> 
> activesupport (7.0.3.1) lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `synchronize'
> 
> activerecord (7.0.3.1) lib/active_record/connection_adapters/abstract/transaction.rb:317:in `within_new_transaction'
> 
> activerecord (7.0.3.1) lib/active_record/connection_adapters/abstract/database_statements.rb:316:in `transaction'
> 
> activerecord (7.0.3.1) lib/active_record/transactions.rb:209:in `transaction'
> 
> app/models/invite_redeemer.rb:53:in `redeem'
> 
> app/models/invite.rb:227:in `redeem'
> 
> app/controllers/invites_controller.rb:227:in `perform_accept_invitation'
> 
> actionpack (7.0.3.1) lib/action_controller/metal/basic_implicit_render.rb:6:in `send_action'
> 
> actionpack (7.0.3.1) lib/abstract_controller/base.rb:215:in `process_action'
> 
> actionpack (7.0.3.1) lib/action_controller/metal/rendering.rb:53:in `process_action'
> 
> actionpack (7.0.3.1) lib/abstract_controller/callbacks.rb:234:in `block in process_action'
> 
> activesupport (7.0.3.1) lib/active_support/callbacks.rb:118:in `block in run_callbacks'
> 
> app/controllers/application_control
> 
> ```

Which is probably related with [Discourse Encrypt (for Private Messages)](https://meta.discourse.org/t/discourse-encrypt-for-private-messages/107918) plugin it was an update 12 days ago so when I first updated the site yesterday this is also updated.  
This plugin is installed on my site but is disabled. I try to comment out in `app.yml` and see how it works. 🙂

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [November 23, 2022, 10:24am UTC](https://meta.discourse.org/t/account-creation-not-working-with-discourse-encrypt/246520/5 "2022-11-23T10:24:53Z")

</div>

I can replicate that now. 👍

I also have encrypt on my test site, but it was enabled. If I disable it then my test user registrations kick up errors.

---

<div class="post-metadata">

### Author: ![Don](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/don/32/228726_2.png) [@Don](https://meta.discourse.org/u/Don)
#### Post date: [November 23, 2022, 10:28am UTC](https://meta.discourse.org/t/account-creation-not-working-with-discourse-encrypt/246520/6 "2022-11-23T10:28:08Z")

</div>

That is a great news 🙂 I just rebuild now but now I have calmed down 😃 Thanks Jammy 🙂 Can you move it to #Contribute > Bug?

---

<div class="post-metadata">

### Author: ![Don](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/don/32/228726_2.png) [@Don](https://meta.discourse.org/u/Don)
#### Post date: [November 23, 2022, 10:44am UTC](https://meta.discourse.org/t/account-creation-not-working-with-discourse-encrypt/246520/7 "2022-11-23T10:44:40Z")

</div>

Unfortunately it is not working yet for me after rebuild without the plugin. Maybe that is not enough… 🤷

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [November 23, 2022, 10:46am UTC](https://meta.discourse.org/t/account-creation-not-working-with-discourse-encrypt/246520/8 "2022-11-23T10:46:08Z")

</div>

When I toggle it off it breaks, but when I toggle it back on it works again. I think you may need to reinstall it and turn it on while a fix is worked on?

---

<div class="post-metadata">

### Author: ![RGJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rgj/32/523185_2.png) [@RGJ](https://meta.discourse.org/u/RGJ)
#### Post date: [November 23, 2022, 11:15am UTC](https://meta.discourse.org/t/account-creation-not-working-with-discourse-encrypt/246520/10 "2022-11-23T11:15:32Z")

</div>

I wonder what the idea is behind having plugins [modify the columns of core tables](https://github.com/discourse/discourse-encrypt/blob/main/db/migrate/20221102045508_add_encrypt_pms_default_to_user_options.rb) instead of using the `plugin_store_rows` table or dedicated `discourse_pluginname_function` tables.

IMO it always ends in tears (or in Sams words: “a bit of a nightmare”) and [complex problems](https://meta.discourse.org/t/uninstalling-a-plugin-on-multisite/223743).

---

<div class="post-metadata">

### Author: ![Don](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/don/32/228726_2.png) [@Don](https://meta.discourse.org/u/Don)
#### Post date: [November 23, 2022, 11:28am UTC](https://meta.discourse.org/t/account-creation-not-working-with-discourse-encrypt/246520/11 "2022-11-23T11:28:29Z")

</div>

> [@JammyDodger](#):
>
> I think you may need to reinstall it and turn it on while a fix is worked on?

This seems to works 👍 Thanks! 🙂

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [November 23, 2022, 11:28am UTC](https://meta.discourse.org/t/account-creation-not-working-with-discourse-encrypt/246520/12 "2022-11-23T11:28:41Z")

</div>

> [@RGJ](#):
>
> I wonder what the idea is behind having plugins [modify the columns of core tables](https://github.com/discourse/discourse-encrypt/blob/main/db/migrate/20221102045508_add_encrypt_pms_default_to_user_options.rb) instead of using the `plugin_store_rows` table or dedicated `discourse_pluginname_function` tables.

Wow. Or a `user_custom_field`. That’s surprising indeed.

---

<div class="post-metadata">

### Author: ![pmusaraj](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pmusaraj/32/119489_2.png) [@pmusaraj](https://meta.discourse.org/u/pmusaraj)
#### Post date: [November 24, 2022, 4:54pm UTC](https://meta.discourse.org/t/account-creation-not-working-with-discourse-encrypt/246520/15 "2022-11-24T16:54:29Z")

</div>

Just wanted to say thanks for the report @Don, we are working on a fix for this and should have one shortly.

Update: a fix is in the works [FIX: allow encrypt\_pms\_default to be null by KrisKotlarek · Pull Request #231 · discourse/discourse-encrypt · GitHub](https://github.com/discourse/discourse-encrypt/pull/231), it should be merged shortly.

---

<div class="post-metadata">

### Author: ![Don](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/don/32/228726_2.png) [@Don](https://meta.discourse.org/u/Don)
#### Post date: [November 25, 2022, 8:44am UTC](https://meta.discourse.org/t/account-creation-not-working-with-discourse-encrypt/246520/16 "2022-11-25T08:44:59Z")

</div>

I updated today and now it works great if I disable the plugin. I didn’t try to remove it and rebuild yet but I am sure that will work too. Thanks so much for the fix! 🙂

---

<div class="post-metadata">

### Author: ![pmusaraj](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pmusaraj/32/119489_2.png) [@pmusaraj](https://meta.discourse.org/u/pmusaraj)
#### Post date: [November 25, 2022, 2:00pm UTC](https://meta.discourse.org/t/account-creation-not-working-with-discourse-encrypt/246520/17 "2022-11-25T14:00:06Z")

</div>


