[GH-ISSUE #2782] api broken after update from v2.0.3 to v2.0.4 #1706

Closed
opened 2026-02-27 11:18:41 +03:00 by kerem · 4 comments
Owner

Originally created by @cremesk on GitHub (Feb 14, 2023).
Original GitHub issue: https://github.com/modoboa/modoboa/issues/2782

Impacted versions

  • OS Type: Debian
  • OS Version: 11
  • Database Type: PostgreSQL
  • Database version: 13
  • installer used: Yes
  • Webserver: Nginx

Steps to reproduce

with v2.0.3:

curl -s -X POST -H 'Content-Type: application/json' -H "Authorization: Token $(</root/priv/modoboa_api_token)" -d '{"username":"testuser12@envs.net","role":"SimpleUsers","password":"pkgBIzNEF06b","domains": [ "envs.net" ]}' 'https://mail.envs.net/api/v2/accounts/'

{"pk":738,"username":"testuser12@envs.net","first_name":"","last_name":"","is_active":true,"master_user":false,"mailbox":{"pk":737,"use_domain_quota":true,"quota":"250","message_limit":null},"role":"SimpleUsers","language":"en","phone_number":null,"secondary_email":null,"tfa_enabled":false,"date_joined":"2023-02-14T11:55:23.310251+01:00","last_login":null,"password":"{SHA512-CRYPT}$6$rounds=70000$R2sNRdO6yoslVuil$CCAyFMna8NHTiQ170RSSI8HKuXdj55WwjFE4kwgqNKPEQK/n1jWIUI3rHqIoeO8v8EvOIRy3kfrD/v8TLQweh1"}

with v2.0.4:

curl -s -X POST -H 'Content-Type: application/json' -H "Authorization: Token $(</root/priv/modoboa_api_token)" -d '{"username":"testuser12@envs.net","role":"SimpleUsers","password":"pkgBIzNEF06b","domains": [ "envs.net" ]}' 'https://mail.envs.net/api/v2/accounts/'

<!DOCTYPE html>

<html lang="">
  <head>
    <meta charset="utf-8" />
    <title></title>
    <link rel="icon" type="image/png" href="/sitestatic/css/logo-icon.png" />
    <link rel="stylesheet" type="text/css" href="/sitestatic/bootstrap/dist/css/bootstrap.min.css" />
    <script src="/sitestatic/bootstrap/dist/js/bootstrap.min.js" type="text/javascript"></script>
    <script src="/sitestatic/eonasdan-bootstrap-datetimepicker/build/js/bootstrap-datetimepicker.min.js" type="text/javascript"></script>
    <script type="text/javascript" src="/jsi18n/"></script>
    <style>
      body {
          padding-top: 60px;
      }
    </style>
  </head>

  <body>
    <div class="container-fluid">
      <div class="row-fluid">
        
<div class="alert alert-danger">
  <h4>Sorry</h4>
  <p>An internal error occured.</p>
</div>

      </div>
    </div>
  </body>
</html>
Originally created by @cremesk on GitHub (Feb 14, 2023). Original GitHub issue: https://github.com/modoboa/modoboa/issues/2782 # Impacted versions * OS Type: Debian * OS Version: 11 * Database Type: PostgreSQL * Database version: 13 * installer used: Yes * Webserver: Nginx # Steps to reproduce with v2.0.3: ``` curl -s -X POST -H 'Content-Type: application/json' -H "Authorization: Token $(</root/priv/modoboa_api_token)" -d '{"username":"testuser12@envs.net","role":"SimpleUsers","password":"pkgBIzNEF06b","domains": [ "envs.net" ]}' 'https://mail.envs.net/api/v2/accounts/' {"pk":738,"username":"testuser12@envs.net","first_name":"","last_name":"","is_active":true,"master_user":false,"mailbox":{"pk":737,"use_domain_quota":true,"quota":"250","message_limit":null},"role":"SimpleUsers","language":"en","phone_number":null,"secondary_email":null,"tfa_enabled":false,"date_joined":"2023-02-14T11:55:23.310251+01:00","last_login":null,"password":"{SHA512-CRYPT}$6$rounds=70000$R2sNRdO6yoslVuil$CCAyFMna8NHTiQ170RSSI8HKuXdj55WwjFE4kwgqNKPEQK/n1jWIUI3rHqIoeO8v8EvOIRy3kfrD/v8TLQweh1"} ``` with v2.0.4: ``` curl -s -X POST -H 'Content-Type: application/json' -H "Authorization: Token $(</root/priv/modoboa_api_token)" -d '{"username":"testuser12@envs.net","role":"SimpleUsers","password":"pkgBIzNEF06b","domains": [ "envs.net" ]}' 'https://mail.envs.net/api/v2/accounts/' <!DOCTYPE html> <html lang=""> <head> <meta charset="utf-8" /> <title></title> <link rel="icon" type="image/png" href="/sitestatic/css/logo-icon.png" /> <link rel="stylesheet" type="text/css" href="/sitestatic/bootstrap/dist/css/bootstrap.min.css" /> <script src="/sitestatic/bootstrap/dist/js/bootstrap.min.js" type="text/javascript"></script> <script src="/sitestatic/eonasdan-bootstrap-datetimepicker/build/js/bootstrap-datetimepicker.min.js" type="text/javascript"></script> <script type="text/javascript" src="/jsi18n/"></script> <style> body { padding-top: 60px; } </style> </head> <body> <div class="container-fluid"> <div class="row-fluid"> <div class="alert alert-danger"> <h4>Sorry</h4> <p>An internal error occured.</p> </div> </div> </div> </body> </html> ```
kerem closed this issue 2026-02-27 11:18:41 +03:00
Author
Owner

@tonioo commented on GitHub (Feb 14, 2023):

@cremesk Can you enable DEBUG mode?

<!-- gh-comment-id:1429539816 --> @tonioo commented on GitHub (Feb 14, 2023): @cremesk Can you enable DEBUG mode?
Author
Owner

@cremesk commented on GitHub (Feb 14, 2023):

@tonioo sure thing.

here is the output: https://envs.sh/heQ.txt
i delete my token in the file ;)

<!-- gh-comment-id:1429560465 --> @cremesk commented on GitHub (Feb 14, 2023): @tonioo sure thing. here is the output: https://envs.sh/heQ.txt i delete my token in the file ;)
Author
Owner

@tonioo commented on GitHub (Feb 14, 2023):

Have you followed upgrade instructions?
https://modoboa.readthedocs.io/en/latest/upgrade.html#id2

<!-- gh-comment-id:1429572339 --> @tonioo commented on GitHub (Feb 14, 2023): Have you followed upgrade instructions? https://modoboa.readthedocs.io/en/latest/upgrade.html#id2
Author
Owner

@cremesk commented on GitHub (Feb 14, 2023):

oops sorry my bad! I really forget to read it ;(

after doing adding the new things it works now!

<!-- gh-comment-id:1429605440 --> @cremesk commented on GitHub (Feb 14, 2023): oops sorry my bad! I really forget to read it ;( after doing adding the new things it works now!
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#1706
No description provided.