[GH-ISSUE #1547] can't create identities (new fresh install with apache) #1217

Closed
opened 2026-02-27 11:15:55 +03:00 by kerem · 13 comments
Owner

Originally created by @JayBeRayBearGun on GitHub (Aug 5, 2018).
Original GitHub issue: https://github.com/modoboa/modoboa/issues/1547

Hi all,

Subject says it all. No identities can be created. I am using appache currently and will also test it with nginx and report here.

cheers,
JBR

Impacted versions

  • Modoboa: 1.10.6
  • installer used: Yes
  • Webserver: Apache

Steps to reproduce

  • Open the webinterface go to identities and click on '+Add'
  • Fill in the required fields, press, 'Next' and 'Submit'

Current behavior

No result. The dialog windows with the 'Submit' button stays on screen.

Expected behaviour

Create an identity (i.e. user in this case)

Javascript Console, output


 [Show/hide message details.] SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data jquery.min.js:3:4315
parseJSON
https://mail.nerderlands.net/sitestatic/jquery/jquery.min.js:3:4315
post/<
https://mail.nerderlands.net/sitestatic/js/creation_wizard.js:61:28
i
https://mail.nerderlands.net/sitestatic/jquery/jquery.min.js:3:6334
c
https://mail.nerderlands.net/sitestatic/jquery/jquery.min.js:3:7852
fireWith
https://mail.nerderlands.net/sitestatic/jquery/jquery.min.js:3:8658
k
https://mail.nerderlands.net/sitestatic/jquery/jquery.min.js:5:14038
r
https://mail.nerderlands.net/sitestatic/jquery/jquery.min.js:5:18226
[Show/hide message details.] SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data jquery.min.js:3:4315
parseJSON
https://mail.nerderlands.net/sitestatic/jquery/jquery.min.js:3:4315
post/<
https://mail.nerderlands.net/sitestatic/js/creation_wizard.js:61:28
i
https://mail.nerderlands.net/sitestatic/jquery/jquery.min.js:3:6334
c
https://mail.nerderlands.net/sitestatic/jquery/jquery.min.js:3:7852
fireWith
https://mail.nerderlands.net/sitestatic/jquery/jquery.min.js:3:8658
k
https://mail.nerderlands.net/sitestatic/jquery/jquery.min.js:5:14038
r
https://mail.nerderlands.net/sitestatic/jquery/jquery.min.js:5:18226
[Show/hide message details.] SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data jquery.min.js:3:4315
parseJSON
https://mail.nerderlands.net/sitestatic/jquery/jquery.min.js:3:4315
post/<
https://mail.nerderlands.net/sitestatic/js/creation_wizard.js:61:28
i
https://mail.nerderlands.net/sitestatic/jquery/jquery.min.js:3:6334
c
https://mail.nerderlands.net/sitestatic/jquery/jquery.min.js:3:7852
fireWith
https://mail.nerderlands.net/sitestatic/jquery/jquery.min.js:3:8658
k
https://mail.nerderlands.net/sitestatic/jquery/jquery.min.js:5:14038
r
https://mail.nerderlands.net/sitestatic/jquery/jquery.min.js:5:18226

Originally created by @JayBeRayBearGun on GitHub (Aug 5, 2018). Original GitHub issue: https://github.com/modoboa/modoboa/issues/1547 Hi all, Subject says it all. No identities can be created. I am using appache currently and will also test it with nginx and report here. cheers, JBR # Impacted versions * Modoboa: 1.10.6 * installer used: Yes * Webserver: Apache # Steps to reproduce * Open the webinterface go to identities and click on '+Add' * Fill in the required fields, press, 'Next' and 'Submit' # Current behavior No result. The dialog windows with the 'Submit' button stays on screen. # Expected behaviour Create an identity (i.e. user in this case) # Javascript Console, output ``` [Show/hide message details.] SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data jquery.min.js:3:4315 parseJSON https://mail.nerderlands.net/sitestatic/jquery/jquery.min.js:3:4315 post/< https://mail.nerderlands.net/sitestatic/js/creation_wizard.js:61:28 i https://mail.nerderlands.net/sitestatic/jquery/jquery.min.js:3:6334 c https://mail.nerderlands.net/sitestatic/jquery/jquery.min.js:3:7852 fireWith https://mail.nerderlands.net/sitestatic/jquery/jquery.min.js:3:8658 k https://mail.nerderlands.net/sitestatic/jquery/jquery.min.js:5:14038 r https://mail.nerderlands.net/sitestatic/jquery/jquery.min.js:5:18226 [Show/hide message details.] SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data jquery.min.js:3:4315 parseJSON https://mail.nerderlands.net/sitestatic/jquery/jquery.min.js:3:4315 post/< https://mail.nerderlands.net/sitestatic/js/creation_wizard.js:61:28 i https://mail.nerderlands.net/sitestatic/jquery/jquery.min.js:3:6334 c https://mail.nerderlands.net/sitestatic/jquery/jquery.min.js:3:7852 fireWith https://mail.nerderlands.net/sitestatic/jquery/jquery.min.js:3:8658 k https://mail.nerderlands.net/sitestatic/jquery/jquery.min.js:5:14038 r https://mail.nerderlands.net/sitestatic/jquery/jquery.min.js:5:18226 [Show/hide message details.] SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data jquery.min.js:3:4315 parseJSON https://mail.nerderlands.net/sitestatic/jquery/jquery.min.js:3:4315 post/< https://mail.nerderlands.net/sitestatic/js/creation_wizard.js:61:28 i https://mail.nerderlands.net/sitestatic/jquery/jquery.min.js:3:6334 c https://mail.nerderlands.net/sitestatic/jquery/jquery.min.js:3:7852 fireWith https://mail.nerderlands.net/sitestatic/jquery/jquery.min.js:3:8658 k https://mail.nerderlands.net/sitestatic/jquery/jquery.min.js:5:14038 r https://mail.nerderlands.net/sitestatic/jquery/jquery.min.js:5:18226 ```
kerem 2026-02-27 11:15:55 +03:00
Author
Owner

@JayBeRayBearGun commented on GitHub (Aug 5, 2018):

Aha,.. using nginx it works,... Could it be that apache can't access the pdfcredentials directory perhaps?

How do I fix this if this indeed is the case? Add a corresponding directory stanza? (use an Alias?)

<VirtualHost *:443>
  ServerName mail.nerderlands.net
  DocumentRoot /srv/modoboa/instance/

  Alias /media/ /srv/modoboa/instance/media/
  <Directory /srv/modoboa/instance/media>
    Require all granted
  </Directory>

  Alias /sitestatic/ /srv/modoboa/instance/sitestatic/
  <Directory /srv/modoboa/instance/sitestatic>
    Require all granted
  </Directory>

  WSGIScriptAlias / /srv/modoboa/instance/instance/wsgi.py
  WSGIDaemonProcess mail.nerderlands.net python-path=/srv/modoboa/instance:/srv/modoboa/env/lib/python2.7/site-packages
  WSGIProcessGroup mail.nerderlands.net

  # Pass Authorization header to enable API usage:
  WSGIPassAuthorization On
</VirtualHost>

<!-- gh-comment-id:410528891 --> @JayBeRayBearGun commented on GitHub (Aug 5, 2018): Aha,.. using nginx it works,... Could it be that apache can't access the pdfcredentials directory perhaps? How do I fix this if this indeed is the case? Add a corresponding directory stanza? (use an Alias?) ``` <VirtualHost *:443> ServerName mail.nerderlands.net DocumentRoot /srv/modoboa/instance/ Alias /media/ /srv/modoboa/instance/media/ <Directory /srv/modoboa/instance/media> Require all granted </Directory> Alias /sitestatic/ /srv/modoboa/instance/sitestatic/ <Directory /srv/modoboa/instance/sitestatic> Require all granted </Directory> WSGIScriptAlias / /srv/modoboa/instance/instance/wsgi.py WSGIDaemonProcess mail.nerderlands.net python-path=/srv/modoboa/instance:/srv/modoboa/env/lib/python2.7/site-packages WSGIProcessGroup mail.nerderlands.net # Pass Authorization header to enable API usage: WSGIPassAuthorization On </VirtualHost> ```
Author
Owner

@JayBeRayBearGun commented on GitHub (Aug 5, 2018):

Using apache to delete the just created identity I get this response at the top of the browser:

Failed to retrieve mailbox location ( We trust you have received the
usual lecture from the local System Administrator. It usually boils
down to these three things: #1) Respect the privacy of others. #2)
Think before you type. #3) With great power comes great
responsibility. sudo: no tty present and no askpass program specified
)

This does not happen with nginx. It just deletes as it's supposed to do.

<!-- gh-comment-id:410529371 --> @JayBeRayBearGun commented on GitHub (Aug 5, 2018): Using apache to delete the just created identity I get this response at the top of the browser: ``` Failed to retrieve mailbox location ( We trust you have received the usual lecture from the local System Administrator. It usually boils down to these three things: #1) Respect the privacy of others. #2) Think before you type. #3) With great power comes great responsibility. sudo: no tty present and no askpass program specified ) ``` This does not happen with nginx. It just deletes as it's supposed to do.
Author
Owner

@JayBeRayBearGun commented on GitHub (Aug 5, 2018):

PS: the apache.conf already contains this,...

<Directory /srv/>
        Options Indexes FollowSymLinks
        AllowOverride None
        Require all granted
</Directory>

<!-- gh-comment-id:410530121 --> @JayBeRayBearGun commented on GitHub (Aug 5, 2018): PS: the apache.conf already contains this,... ``` <Directory /srv/> Options Indexes FollowSymLinks AllowOverride None Require all granted </Directory> ```
Author
Owner

@tonioo commented on GitHub (Aug 7, 2018):

@JayBeRayBearGun Looks like the user running apache has not the permission to run doveadm.

<!-- gh-comment-id:410969154 --> @tonioo commented on GitHub (Aug 7, 2018): @JayBeRayBearGun Looks like the user running apache has not the permission to run doveadm.
Author
Owner

@JayBeRayBearGun commented on GitHub (Aug 7, 2018):

Hi Antoine,

Thanks for the response.

That would be www-data the same user as nginx is using. What else could it be? Could it be some missing or disabled module perhaps?

How can I test this? By the way I tried the DEBUG=True but where do I find the output? In the browser?

JBR

<!-- gh-comment-id:410973055 --> @JayBeRayBearGun commented on GitHub (Aug 7, 2018): Hi Antoine, Thanks for the response. That would be www-data the same user as nginx is using. What else could it be? Could it be some missing or disabled module perhaps? How can I test this? By the way I tried the DEBUG=True but where do I find the output? In the browser? JBR
Author
Owner

@tonioo commented on GitHub (Aug 7, 2018):

Look at this: http://modoboa.readthedocs.io/en/latest/configuration.html#host-configuration (check your sudoers file).

<!-- gh-comment-id:411004105 --> @tonioo commented on GitHub (Aug 7, 2018): Look at this: http://modoboa.readthedocs.io/en/latest/configuration.html#host-configuration (check your sudoers file).
Author
Owner

@JayBeRayBearGun commented on GitHub (Aug 7, 2018):

That is something I suspected initially due to the message generated in the browser:

Failed to retrieve mailbox location ( We trust you have received the
usual lecture from the local System Administrator. It usually boils
down to these three things: #1) Respect the privacy of others. #2)
Think before you type. #3) With great power comes great
responsibility. sudo: no tty present and no askpass program specified
)

However the /etc/sudoers.d/ already contains a file named modoboa with this content:

# This file was automatically installed on 2018-08-05T10:57:45.367870
modoboa ALL=(vmail) NOPASSWD: /usr/bin/doveadm

This is correct I presume when you have used the automated installer, right?

<!-- gh-comment-id:411009335 --> @JayBeRayBearGun commented on GitHub (Aug 7, 2018): That is something I suspected initially due to the message generated in the browser: ``` Failed to retrieve mailbox location ( We trust you have received the usual lecture from the local System Administrator. It usually boils down to these three things: #1) Respect the privacy of others. #2) Think before you type. #3) With great power comes great responsibility. sudo: no tty present and no askpass program specified ) ``` However the /etc/sudoers.d/ already contains a file named modoboa with this content: ``` # This file was automatically installed on 2018-08-05T10:57:45.367870 modoboa ALL=(vmail) NOPASSWD: /usr/bin/doveadm ``` This is correct I presume when you have used the automated installer, right?
Author
Owner

@tonioo commented on GitHub (Aug 7, 2018):

Yes, it is correct because uwsgi runs as modoboa. Since apache runs as www-data, you can update this line and replace modoboa by www-data.

<!-- gh-comment-id:411023442 --> @tonioo commented on GitHub (Aug 7, 2018): Yes, it is correct because uwsgi runs as modoboa. Since apache runs as www-data, you can update this line and replace modoboa by www-data.
Author
Owner

@JayBeRayBearGun commented on GitHub (Aug 7, 2018):

Hmm,.. did as directed. Restarted webserver, uwsgi etc. Also turned DEBUG=True no succes no output

<!-- gh-comment-id:411035100 --> @JayBeRayBearGun commented on GitHub (Aug 7, 2018): Hmm,.. did as directed. Restarted webserver, uwsgi etc. Also turned DEBUG=True no succes no output
Author
Owner

@JayBeRayBearGun commented on GitHub (Aug 7, 2018):

Another unrelated thing i noticed is that apache and nginx apparentlyt use different selfsigned certificates. Eventually I want to remedy this by employing a letsencrypt certificate (for both). In the end though when all works I'd like to switch to apache which i know better :)

<!-- gh-comment-id:411053260 --> @JayBeRayBearGun commented on GitHub (Aug 7, 2018): Another unrelated thing i noticed is that apache and nginx apparentlyt use different selfsigned certificates. Eventually I want to remedy this by employing a letsencrypt certificate (for both). In the end though when all works I'd like to switch to apache which i know better :)
Author
Owner

@tonioo commented on GitHub (Sep 16, 2018):

@JayBeRayBearGun Any news?

<!-- gh-comment-id:421790860 --> @tonioo commented on GitHub (Sep 16, 2018): @JayBeRayBearGun Any news?
Author
Owner

@ByteSizedMarius commented on GitHub (Feb 11, 2021):

Sorry for bumping this 3yr old thread, but I had the exact same problem and as this is the first resource you find on google, I would like to maybe help the next desperate person searching for the answer.
My problem was that the www-data user didnt have any perms for the /srv/modoboa/pdfcredentials/ directory. chowning it/ giving it perms manually fixed it for me.

<!-- gh-comment-id:777645302 --> @ByteSizedMarius commented on GitHub (Feb 11, 2021): Sorry for bumping this 3yr old thread, but I had the exact same problem and as this is the first resource you find on google, I would like to maybe help the next desperate person searching for the answer. My problem was that the www-data user didnt have any perms for the /srv/modoboa/pdfcredentials/ directory. chowning it/ giving it perms manually fixed it for me.
Author
Owner

@ksaadDE commented on GitHub (Apr 21, 2021):

Sorry for bumping this 3yr old thread, but I had the exact same problem and as this is the first resource you find on google, I would like to maybe help the next desperate person searching for the answer.
My problem was that the www-data user didnt have any perms for the /srv/modoboa/pdfcredentials/ directory. chowning it/ giving it perms manually fixed it for me.

Same weirdity occured here. I did the same. In my case chmod 755 -R /srv/modoboa/pdfcredentials was NOT enough.
Sadly it's so annoying you need 7777 otherwise the admin panel won't create the user (why ever!)

<!-- gh-comment-id:823745778 --> @ksaadDE commented on GitHub (Apr 21, 2021): > Sorry for bumping this 3yr old thread, but I had the exact same problem and as this is the first resource you find on google, I would like to maybe help the next desperate person searching for the answer. > My problem was that the www-data user didnt have any perms for the /srv/modoboa/pdfcredentials/ directory. chowning it/ giving it perms manually fixed it for me. Same weirdity occured here. I did the same. In my case **chmod 755 -R /srv/modoboa/pdfcredentials** was **NOT** enough. Sadly it's so annoying you need 7777 otherwise the admin panel won't create the user (why ever!)
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/modoboa-modoboa#1217
No description provided.