[GH-ISSUE #2543] API documentation, "Authorization" examples #1627

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

Originally created by @gsloop on GitHub (Jun 17, 2022).
Original GitHub issue: https://github.com/modoboa/modoboa/issues/2543

Impacted versions; 2.0.1

  • Tested with Ubuntu 22.04 (But is almost certainly the same no matter what distro/version.)
  • Modoboa: 2.0.1
  • installer used: Yes
  • Webserver: Nginx

Steps to reproduce

Simply do a standard setup with the installer.
Go into the API documentation link

I have not checked EVERY API call, but I've checked quite a number and it's been the same in every case.

The examples when you "Try it out" show the "Authorization" header like this:
-H 'Authorization: API Key Here'

However this ALWAYS FAILS, because it's wrong. (You get a warning/error that you haven't authenticated., and indeed, contrary to what you might think, you haven't "properly" authenticated.)

The proper header is
-H 'Authorization: Token API Key Here'

So, for example, if the API Key was ABCDE the header should look like this:
-H 'Authorization: Token ABCDE'

This works.
Personally tested and verified.

I'd be glad to try to generate a PR to fix this error in the docs/examples, but have no idea where to find it in the code/project. Some simple greps haven't been helpful. So, some pointers would be good.

Originally created by @gsloop on GitHub (Jun 17, 2022). Original GitHub issue: https://github.com/modoboa/modoboa/issues/2543 Impacted versions; 2.0.1 * Tested with Ubuntu 22.04 (But is almost certainly the same no matter what distro/version.) * Modoboa: 2.0.1 * installer used: Yes * Webserver: Nginx # Steps to reproduce Simply do a standard setup with the installer. Go into the API documentation link I have not checked EVERY API call, but I've checked quite a number and it's been the same in every case. The examples when you "Try it out" show the "Authorization" header like this: -H 'Authorization: API Key Here' However this ALWAYS FAILS, because it's wrong. (You get a warning/error that you haven't authenticated., and indeed, contrary to what you might think, you haven't "properly" authenticated.) The proper header is -H 'Authorization: Token API Key Here' So, for example, if the API Key was ABCDE the header should look like this: -H 'Authorization: Token ABCDE' This works. Personally tested and verified. I'd be glad to try to generate a PR to fix this error in the docs/examples, but have no idea where to find it in the code/project. Some simple greps haven't been helpful. So, some pointers would be good.
kerem 2026-02-27 11:18:12 +03:00
Author
Owner

@stale[bot] commented on GitHub (Sep 16, 2022):

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

<!-- gh-comment-id:1248805036 --> @stale[bot] commented on GitHub (Sep 16, 2022): This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Author
Owner

@gsloop commented on GitHub (Sep 16, 2022):

Not stale. Docs need update.

<!-- gh-comment-id:1249756738 --> @gsloop commented on GitHub (Sep 16, 2022): Not stale. Docs need update.
Author
Owner

@tonioo commented on GitHub (Sep 17, 2022):

@gsloop Have you seen this page: https://modoboa.readthedocs.io/en/latest/rest_api.html ?

<!-- gh-comment-id:1250034436 --> @tonioo commented on GitHub (Sep 17, 2022): @gsloop Have you seen this page: https://modoboa.readthedocs.io/en/latest/rest_api.html ?
Author
Owner

@gsloop commented on GitHub (Sep 18, 2022):

Perhaps there's some misunderstanding.

(I also can't go re-review the initial report, since there seems to be some problem showing the API docs on a live 22.04 install...I get" "Failed to load API definition." Fetch error Internal Server Error /api/schema-v2/ So, I don't have an working install I can look at, ATM.)

But I think my point was that the docs the UI points at (on the Modoboa local install) when you enable API access are, at best vague, at worst, wrong. So clarifying them would be good.

Is what I'm trying to convey not clear? Or do you think that because the docs on the web (read-the-docs) seem to show it correctly, that the server based docs showing it wrong/unclear are not a problem? (IMO, it would be good to have it right both places.)

<!-- gh-comment-id:1250393607 --> @gsloop commented on GitHub (Sep 18, 2022): Perhaps there's some misunderstanding. (I also can't go re-review the initial report, since there seems to be some problem showing the API docs on a live 22.04 install...I get" "Failed to load API definition." Fetch error Internal Server Error /api/schema-v2/ So, I don't have an working install I can look at, ATM.) But I think my point was that the docs the UI points at (on the Modoboa local install) when you enable API access are, at best vague, at worst, wrong. So clarifying them would be good. Is what I'm trying to convey not clear? Or do you think that because the docs on the web (read-the-docs) seem to show it correctly, that the server based docs showing it wrong/unclear are not a problem? (IMO, it would be good to have it right both places.)
Author
Owner

@cremesk commented on GitHub (Sep 21, 2022):

i think i have the same issue here.

https://mail.envs.net/api/schema-v2/swagger/

Failed to load API definition.

image

https://mail.envs.net/api/v1/

The requested page does not exist.

https://mail.envs.net/docs/api/

The requested page does not exist.

my User has enabled API in settings.

Modoboa Version: 2.0.1
OS: Debian 11
installed via modoboa-installer

log (DEBUG: True)

envs.net [pid: 611246|app: 1|req: 22/60] my_ip () {66 vars in 1186 bytes} [Thu Sep 22 11:08:38 2022] GET /api/schema-v2/swagger/ => generated 4254 bytes in 502 msecs (HTTP/1.0 200) 7 headers in 366 bytes (1 switches on core 0
)                                                                                                                                                                                                                                              
Error #0: UserAccountViewSet: unable to guess serializer. This is graceful fallback handling for APIViews. Consider using GenericAPIView as view base class, if view is under your control. Ignoring view for now. 
Warning #0: AccountViewSet: AccountSerializer: MailboxSerializer: Encountered 2 components with identical names "Mailbox" and different classes <class 'modoboa.admin.api.v1.serializers.MailboxSerializer'> and <class 'modoboa_radicale.seria
lizers.MailboxSerializer'>. This will very likely result in an incorrect schema. Try renaming one.
Warning #1: AccountViewSet: AccountSerializer: unable to resolve type hint for function "get_resources". Consider using a type hint or @extend_schema_field. Defaulting to string.
Warning #2: AccountViewSet: WritableAccountSerializer: MailboxSerializer: Encountered 2 components with identical names "Mailbox" and different classes <class 'modoboa.admin.api.v2.serializers.MailboxSerializer'> and <class 'modoboa_radica
le.serializers.MailboxSerializer'>. This will very likely result in an incorrect schema. Try renaming one.
Warning #3: AccountViewSet: WritableAccountSerializer: Encountered 2 components with identical names "WritableAccount" and different classes <class 'modoboa.admin.api.v1.serializers.WritableAccountSerializer'> and <class 'modoboa.admin.api
.v2.serializers.WritableAccountSerializer'>. This will very likely result in an incorrect schema. Try renaming one.
Warning #4: AddressBookViewSet: AddressBookSerializer: unable to resolve type hint for function "url". Consider using a type hint or @extend_schema_field. Defaulting to string.
Warning #5: AttendeeViewSet: could not derive type of path parameter "id" because it is untyped and obtaining queryset from the viewset failed. Consider adding a type to the path (e.g. <int:id>) or annotating the parameter type with @exten
d_schema. Defaulting to "string".
Warning #6: DomainViewSet: DomainSerializer: DomainResourceSerializer: unable to resolve type hint for function "label". Consider using a type hint or @extend_schema_field. Defaulting to string.
Warning #7: DomainViewSet: DomainSerializer: DomainResourceSerializer: unable to resolve type hint for function "current_value". Consider using a type hint or @extend_schema_field. Defaulting to string.
Warning #8: DomainViewSet: DomainSerializer: DomainResourceSerializer: unable to resolve type hint for function "usage". Consider using a type hint or @extend_schema_field. Defaulting to string.
Warning #9: EmailAddressViewSet: EmailAddressWithNameSerializer: unable to resolve type hint for function "get_display_name". Consider using a type hint or @extend_schema_field. Defaulting to string.
Error #1: LanguageViewSet: unable to guess serializer. This is graceful fallback handling for APIViews. Consider using GenericAPIView as view base class, if view is under your control. Ignoring view for now. 
Warning #10: RelayDomainViewSet: RelayDomainSerializer: TransportSerializer: Encountered 2 components with identical names "Transport" and different classes <class 'modoboa.relaydomains.api.v1.serializers.TransportSerializer'> and <class '
modoboa.transport.api.v2.serializers.TransportSerializer'>. This will very likely result in an incorrect schema. Try renaming one.
Warning #11: SharedCalendarViewSet: SharedCalendarSerializer: unable to resolve type hint for function "path". Consider using a type hint or @extend_schema_field. Defaulting to string.
Warning #12: SharedCalendarViewSet: SharedCalendarSerializer: DomainSerializer: Encountered 2 components with identical names "Domain" and different classes <class 'modoboa_radicale.serializers.DomainSerializer'> and <class 'modoboa.admin.
api.v2.serializers.DomainSerializer'>. This will very likely result in an incorrect schema. Try renaming one.
Warning #13: SharedCalendarViewSet: SharedCalendarSerializer: unable to resolve type hint for function "full_url". Consider using a type hint or @extend_schema_field. Defaulting to string.
Warning #14: SharedCalendarViewSet: SharedCalendarSerializer: unable to resolve type hint for function "share_url". Consider using a type hint or @extend_schema_field. Defaulting to string.
Warning #15: SharedEventViewSet: could not derive type of path parameter "calendar_pk" because it is untyped and obtaining queryset from the viewset failed. Consider adding a type to the path (e.g. <int:calendar_pk>) or annotating the para
meter type with @extend_schema. Defaulting to "string".
mail.envs.net [pid: 611247|app: 1|req: 38/61] my_ip () {62 vars in 1517 bytes} [Thu Sep 22 11:08:41 2022] GET /api/schema-v2/ => generated 172623 bytes in 1020 msecs (HTTP/1.0 500) 5 headers in 169 bytes (1 switches on core 0)
Error #0: SharedEventViewSet: UserAccountViewSet: unable to guess serializer. This is graceful fallback handling for APIViews. Consider using GenericAPIView as view base class, if view is under your control. Ignoring view for now. 
Warning #0: SharedEventViewSet: AccountViewSet: AccountSerializer: MailboxSerializer: Encountered 2 components with identical names "Mailbox" and different classes <class 'modoboa.admin.api.v1.serializers.MailboxSerializer'> and <class 'mo
doboa_radicale.serializers.MailboxSerializer'>. This will very likely result in an incorrect schema. Try renaming one.
Warning #1: SharedEventViewSet: AccountViewSet: AccountSerializer: unable to resolve type hint for function "get_resources". Consider using a type hint or @extend_schema_field. Defaulting to string.
Warning #2: SharedEventViewSet: AccountViewSet: WritableAccountSerializer: MailboxSerializer: Encountered 2 components with identical names "Mailbox" and different classes <class 'modoboa.admin.api.v2.serializers.MailboxSerializer'> and <c
lass 'modoboa_radicale.serializers.MailboxSerializer'>. This will very likely result in an incorrect schema. Try renaming one.
Warning #3: SharedEventViewSet: AccountViewSet: WritableAccountSerializer: Encountered 2 components with identical names "WritableAccount" and different classes <class 'modoboa.admin.api.v1.serializers.WritableAccountSerializer'> and <clas
s 'modoboa.admin.api.v2.serializers.WritableAccountSerializer'>. This will very likely result in an incorrect schema. Try renaming one.
Warning #4: SharedEventViewSet: AddressBookViewSet: AddressBookSerializer: unable to resolve type hint for function "url". Consider using a type hint or @extend_schema_field. Defaulting to string.
Warning #5: SharedEventViewSet: AttendeeViewSet: could not derive type of path parameter "id" because it is untyped and obtaining queryset from the viewset failed. Consider adding a type to the path (e.g. <int:id>) or annotating the parame
ter type with @extend_schema. Defaulting to "string".
Warning #6: SharedEventViewSet: DomainViewSet: DomainSerializer: DomainResourceSerializer: unable to resolve type hint for function "label". Consider using a type hint or @extend_schema_field. Defaulting to string.
Warning #7: SharedEventViewSet: DomainViewSet: DomainSerializer: DomainResourceSerializer: unable to resolve type hint for function "current_value". Consider using a type hint or @extend_schema_field. Defaulting to string.
Warning #8: SharedEventViewSet: DomainViewSet: DomainSerializer: DomainResourceSerializer: unable to resolve type hint for function "usage". Consider using a type hint or @extend_schema_field. Defaulting to string.
Warning #9: SharedEventViewSet: EmailAddressViewSet: EmailAddressWithNameSerializer: unable to resolve type hint for function "get_display_name". Consider using a type hint or @extend_schema_field. Defaulting to string.
Error #1: SharedEventViewSet: LanguageViewSet: unable to guess serializer. This is graceful fallback handling for APIViews. Consider using GenericAPIView as view base class, if view is under your control. Ignoring view for now. 
Warning #10: SharedEventViewSet: RelayDomainViewSet: RelayDomainSerializer: TransportSerializer: Encountered 2 components with identical names "Transport" and different classes <class 'modoboa.relaydomains.api.v1.serializers.TransportSeria
lizer'> and <class 'modoboa.transport.api.v2.serializers.TransportSerializer'>. This will very likely result in an incorrect schema. Try renaming one.
Warning #11: SharedEventViewSet: SharedCalendarViewSet: SharedCalendarSerializer: unable to resolve type hint for function "path". Consider using a type hint or @extend_schema_field. Defaulting to string.
Warning #12: SharedEventViewSet: SharedCalendarViewSet: SharedCalendarSerializer: DomainSerializer: Encountered 2 components with identical names "Domain" and different classes <class 'modoboa_radicale.serializers.DomainSerializer'> and <c
lass 'modoboa.admin.api.v2.serializers.DomainSerializer'>. This will very likely result in an incorrect schema. Try renaming one.
Warning #13: SharedEventViewSet: SharedCalendarViewSet: SharedCalendarSerializer: unable to resolve type hint for function "full_url". Consider using a type hint or @extend_schema_field. Defaulting to string.
Warning #14: SharedEventViewSet: SharedCalendarViewSet: SharedCalendarSerializer: unable to resolve type hint for function "share_url". Consider using a type hint or @extend_schema_field. Defaulting to string.
Warning #15: SharedEventViewSet: SharedEventViewSet: could not derive type of path parameter "calendar_pk" because it is untyped and obtaining queryset from the viewset failed. Consider adding a type to the path (e.g. <int:calendar_pk>) or
 annotating the parameter type with @extend_schema. Defaulting to "string".
mail.envs.net [pid: 611247|app: 1|req: 39/62] my_ip () {62 vars in 1517 bytes} [Thu Sep 22 11:08:43 2022] GET /api/schema-v2/ => generated 172623 bytes in 1012 msecs (HTTP/1.0 500) 5 headers in 169 bytes (1 switches on core 0)

image

<!-- gh-comment-id:1253459860 --> @cremesk commented on GitHub (Sep 21, 2022): > i think i have the same issue here. https://mail.envs.net/api/schema-v2/swagger/ > Failed to load API definition. ![image](https://user-images.githubusercontent.com/7526990/191471005-9f3e61bb-67c3-48fb-80c1-66f3de221950.png) https://mail.envs.net/api/v1/ > The requested page does not exist. https://mail.envs.net/docs/api/ > The requested page does not exist. my User has enabled API in settings. Modoboa Version: 2.0.1 OS: Debian 11 installed via modoboa-installer # log (DEBUG: True) ``` envs.net [pid: 611246|app: 1|req: 22/60] my_ip () {66 vars in 1186 bytes} [Thu Sep 22 11:08:38 2022] GET /api/schema-v2/swagger/ => generated 4254 bytes in 502 msecs (HTTP/1.0 200) 7 headers in 366 bytes (1 switches on core 0 ) Error #0: UserAccountViewSet: unable to guess serializer. This is graceful fallback handling for APIViews. Consider using GenericAPIView as view base class, if view is under your control. Ignoring view for now. Warning #0: AccountViewSet: AccountSerializer: MailboxSerializer: Encountered 2 components with identical names "Mailbox" and different classes <class 'modoboa.admin.api.v1.serializers.MailboxSerializer'> and <class 'modoboa_radicale.seria lizers.MailboxSerializer'>. This will very likely result in an incorrect schema. Try renaming one. Warning #1: AccountViewSet: AccountSerializer: unable to resolve type hint for function "get_resources". Consider using a type hint or @extend_schema_field. Defaulting to string. Warning #2: AccountViewSet: WritableAccountSerializer: MailboxSerializer: Encountered 2 components with identical names "Mailbox" and different classes <class 'modoboa.admin.api.v2.serializers.MailboxSerializer'> and <class 'modoboa_radica le.serializers.MailboxSerializer'>. This will very likely result in an incorrect schema. Try renaming one. Warning #3: AccountViewSet: WritableAccountSerializer: Encountered 2 components with identical names "WritableAccount" and different classes <class 'modoboa.admin.api.v1.serializers.WritableAccountSerializer'> and <class 'modoboa.admin.api .v2.serializers.WritableAccountSerializer'>. This will very likely result in an incorrect schema. Try renaming one. Warning #4: AddressBookViewSet: AddressBookSerializer: unable to resolve type hint for function "url". Consider using a type hint or @extend_schema_field. Defaulting to string. Warning #5: AttendeeViewSet: could not derive type of path parameter "id" because it is untyped and obtaining queryset from the viewset failed. Consider adding a type to the path (e.g. <int:id>) or annotating the parameter type with @exten d_schema. Defaulting to "string". Warning #6: DomainViewSet: DomainSerializer: DomainResourceSerializer: unable to resolve type hint for function "label". Consider using a type hint or @extend_schema_field. Defaulting to string. Warning #7: DomainViewSet: DomainSerializer: DomainResourceSerializer: unable to resolve type hint for function "current_value". Consider using a type hint or @extend_schema_field. Defaulting to string. Warning #8: DomainViewSet: DomainSerializer: DomainResourceSerializer: unable to resolve type hint for function "usage". Consider using a type hint or @extend_schema_field. Defaulting to string. Warning #9: EmailAddressViewSet: EmailAddressWithNameSerializer: unable to resolve type hint for function "get_display_name". Consider using a type hint or @extend_schema_field. Defaulting to string. Error #1: LanguageViewSet: unable to guess serializer. This is graceful fallback handling for APIViews. Consider using GenericAPIView as view base class, if view is under your control. Ignoring view for now. Warning #10: RelayDomainViewSet: RelayDomainSerializer: TransportSerializer: Encountered 2 components with identical names "Transport" and different classes <class 'modoboa.relaydomains.api.v1.serializers.TransportSerializer'> and <class ' modoboa.transport.api.v2.serializers.TransportSerializer'>. This will very likely result in an incorrect schema. Try renaming one. Warning #11: SharedCalendarViewSet: SharedCalendarSerializer: unable to resolve type hint for function "path". Consider using a type hint or @extend_schema_field. Defaulting to string. Warning #12: SharedCalendarViewSet: SharedCalendarSerializer: DomainSerializer: Encountered 2 components with identical names "Domain" and different classes <class 'modoboa_radicale.serializers.DomainSerializer'> and <class 'modoboa.admin. api.v2.serializers.DomainSerializer'>. This will very likely result in an incorrect schema. Try renaming one. Warning #13: SharedCalendarViewSet: SharedCalendarSerializer: unable to resolve type hint for function "full_url". Consider using a type hint or @extend_schema_field. Defaulting to string. Warning #14: SharedCalendarViewSet: SharedCalendarSerializer: unable to resolve type hint for function "share_url". Consider using a type hint or @extend_schema_field. Defaulting to string. Warning #15: SharedEventViewSet: could not derive type of path parameter "calendar_pk" because it is untyped and obtaining queryset from the viewset failed. Consider adding a type to the path (e.g. <int:calendar_pk>) or annotating the para meter type with @extend_schema. Defaulting to "string". mail.envs.net [pid: 611247|app: 1|req: 38/61] my_ip () {62 vars in 1517 bytes} [Thu Sep 22 11:08:41 2022] GET /api/schema-v2/ => generated 172623 bytes in 1020 msecs (HTTP/1.0 500) 5 headers in 169 bytes (1 switches on core 0) Error #0: SharedEventViewSet: UserAccountViewSet: unable to guess serializer. This is graceful fallback handling for APIViews. Consider using GenericAPIView as view base class, if view is under your control. Ignoring view for now. Warning #0: SharedEventViewSet: AccountViewSet: AccountSerializer: MailboxSerializer: Encountered 2 components with identical names "Mailbox" and different classes <class 'modoboa.admin.api.v1.serializers.MailboxSerializer'> and <class 'mo doboa_radicale.serializers.MailboxSerializer'>. This will very likely result in an incorrect schema. Try renaming one. Warning #1: SharedEventViewSet: AccountViewSet: AccountSerializer: unable to resolve type hint for function "get_resources". Consider using a type hint or @extend_schema_field. Defaulting to string. Warning #2: SharedEventViewSet: AccountViewSet: WritableAccountSerializer: MailboxSerializer: Encountered 2 components with identical names "Mailbox" and different classes <class 'modoboa.admin.api.v2.serializers.MailboxSerializer'> and <c lass 'modoboa_radicale.serializers.MailboxSerializer'>. This will very likely result in an incorrect schema. Try renaming one. Warning #3: SharedEventViewSet: AccountViewSet: WritableAccountSerializer: Encountered 2 components with identical names "WritableAccount" and different classes <class 'modoboa.admin.api.v1.serializers.WritableAccountSerializer'> and <clas s 'modoboa.admin.api.v2.serializers.WritableAccountSerializer'>. This will very likely result in an incorrect schema. Try renaming one. Warning #4: SharedEventViewSet: AddressBookViewSet: AddressBookSerializer: unable to resolve type hint for function "url". Consider using a type hint or @extend_schema_field. Defaulting to string. Warning #5: SharedEventViewSet: AttendeeViewSet: could not derive type of path parameter "id" because it is untyped and obtaining queryset from the viewset failed. Consider adding a type to the path (e.g. <int:id>) or annotating the parame ter type with @extend_schema. Defaulting to "string". Warning #6: SharedEventViewSet: DomainViewSet: DomainSerializer: DomainResourceSerializer: unable to resolve type hint for function "label". Consider using a type hint or @extend_schema_field. Defaulting to string. Warning #7: SharedEventViewSet: DomainViewSet: DomainSerializer: DomainResourceSerializer: unable to resolve type hint for function "current_value". Consider using a type hint or @extend_schema_field. Defaulting to string. Warning #8: SharedEventViewSet: DomainViewSet: DomainSerializer: DomainResourceSerializer: unable to resolve type hint for function "usage". Consider using a type hint or @extend_schema_field. Defaulting to string. Warning #9: SharedEventViewSet: EmailAddressViewSet: EmailAddressWithNameSerializer: unable to resolve type hint for function "get_display_name". Consider using a type hint or @extend_schema_field. Defaulting to string. Error #1: SharedEventViewSet: LanguageViewSet: unable to guess serializer. This is graceful fallback handling for APIViews. Consider using GenericAPIView as view base class, if view is under your control. Ignoring view for now. Warning #10: SharedEventViewSet: RelayDomainViewSet: RelayDomainSerializer: TransportSerializer: Encountered 2 components with identical names "Transport" and different classes <class 'modoboa.relaydomains.api.v1.serializers.TransportSeria lizer'> and <class 'modoboa.transport.api.v2.serializers.TransportSerializer'>. This will very likely result in an incorrect schema. Try renaming one. Warning #11: SharedEventViewSet: SharedCalendarViewSet: SharedCalendarSerializer: unable to resolve type hint for function "path". Consider using a type hint or @extend_schema_field. Defaulting to string. Warning #12: SharedEventViewSet: SharedCalendarViewSet: SharedCalendarSerializer: DomainSerializer: Encountered 2 components with identical names "Domain" and different classes <class 'modoboa_radicale.serializers.DomainSerializer'> and <c lass 'modoboa.admin.api.v2.serializers.DomainSerializer'>. This will very likely result in an incorrect schema. Try renaming one. Warning #13: SharedEventViewSet: SharedCalendarViewSet: SharedCalendarSerializer: unable to resolve type hint for function "full_url". Consider using a type hint or @extend_schema_field. Defaulting to string. Warning #14: SharedEventViewSet: SharedCalendarViewSet: SharedCalendarSerializer: unable to resolve type hint for function "share_url". Consider using a type hint or @extend_schema_field. Defaulting to string. Warning #15: SharedEventViewSet: SharedEventViewSet: could not derive type of path parameter "calendar_pk" because it is untyped and obtaining queryset from the viewset failed. Consider adding a type to the path (e.g. <int:calendar_pk>) or annotating the parameter type with @extend_schema. Defaulting to "string". mail.envs.net [pid: 611247|app: 1|req: 39/62] my_ip () {62 vars in 1517 bytes} [Thu Sep 22 11:08:43 2022] GET /api/schema-v2/ => generated 172623 bytes in 1012 msecs (HTTP/1.0 500) 5 headers in 169 bytes (1 switches on core 0) ``` ![image](https://user-images.githubusercontent.com/7526990/191708378-e12f8d6a-8ab5-487e-84c9-04f4e3beaa58.png)
Author
Owner

@Spitfireap commented on GitHub (Sep 21, 2022):

Weird, it works well here (although swagger would need better api description).

What are the requests you're receiving/sending, are you logged on dashboard V1 before loading this page ?

<!-- gh-comment-id:1253652622 --> @Spitfireap commented on GitHub (Sep 21, 2022): Weird, it works well here (although swagger would need better api description). What are the requests you're receiving/sending, are you logged on dashboard V1 before loading this page ?
Author
Owner

@cremesk commented on GitHub (Sep 21, 2022):

i am logged into v1 dashboard and the new-admin page.

<!-- gh-comment-id:1253747953 --> @cremesk commented on GitHub (Sep 21, 2022): i am logged into v1 dashboard and the new-admin page.
Author
Owner

@imbraintl commented on GitHub (Oct 7, 2022):

i think i have the same issue here.

https://mail.envs.net/api/schema-v2/swagger/

Failed to load API definition.

image

https://mail.envs.net/api/v1/

The requested page does not exist.

https://mail.envs.net/docs/api/

The requested page does not exist.

my User has enabled API in settings.

Modoboa Version: 2.0.1 OS: Debian 11 installed via modoboa-installer

log (DEBUG: True)

envs.net [pid: 611246|app: 1|req: 22/60] my_ip () {66 vars in 1186 bytes} [Thu Sep 22 11:08:38 2022] GET /api/schema-v2/swagger/ => generated 4254 bytes in 502 msecs (HTTP/1.0 200) 7 headers in 366 bytes (1 switches on core 0
)                                                                                                                                                                                                                                              
Error #0: UserAccountViewSet: unable to guess serializer. This is graceful fallback handling for APIViews. Consider using GenericAPIView as view base class, if view is under your control. Ignoring view for now. 
Warning #0: AccountViewSet: AccountSerializer: MailboxSerializer: Encountered 2 components with identical names "Mailbox" and different classes <class 'modoboa.admin.api.v1.serializers.MailboxSerializer'> and <class 'modoboa_radicale.seria
lizers.MailboxSerializer'>. This will very likely result in an incorrect schema. Try renaming one.
Warning #1: AccountViewSet: AccountSerializer: unable to resolve type hint for function "get_resources". Consider using a type hint or @extend_schema_field. Defaulting to string.
Warning #2: AccountViewSet: WritableAccountSerializer: MailboxSerializer: Encountered 2 components with identical names "Mailbox" and different classes <class 'modoboa.admin.api.v2.serializers.MailboxSerializer'> and <class 'modoboa_radica
le.serializers.MailboxSerializer'>. This will very likely result in an incorrect schema. Try renaming one.
Warning #3: AccountViewSet: WritableAccountSerializer: Encountered 2 components with identical names "WritableAccount" and different classes <class 'modoboa.admin.api.v1.serializers.WritableAccountSerializer'> and <class 'modoboa.admin.api
.v2.serializers.WritableAccountSerializer'>. This will very likely result in an incorrect schema. Try renaming one.
Warning #4: AddressBookViewSet: AddressBookSerializer: unable to resolve type hint for function "url". Consider using a type hint or @extend_schema_field. Defaulting to string.
Warning #5: AttendeeViewSet: could not derive type of path parameter "id" because it is untyped and obtaining queryset from the viewset failed. Consider adding a type to the path (e.g. <int:id>) or annotating the parameter type with @exten
d_schema. Defaulting to "string".
Warning #6: DomainViewSet: DomainSerializer: DomainResourceSerializer: unable to resolve type hint for function "label". Consider using a type hint or @extend_schema_field. Defaulting to string.
Warning #7: DomainViewSet: DomainSerializer: DomainResourceSerializer: unable to resolve type hint for function "current_value". Consider using a type hint or @extend_schema_field. Defaulting to string.
Warning #8: DomainViewSet: DomainSerializer: DomainResourceSerializer: unable to resolve type hint for function "usage". Consider using a type hint or @extend_schema_field. Defaulting to string.
Warning #9: EmailAddressViewSet: EmailAddressWithNameSerializer: unable to resolve type hint for function "get_display_name". Consider using a type hint or @extend_schema_field. Defaulting to string.
Error #1: LanguageViewSet: unable to guess serializer. This is graceful fallback handling for APIViews. Consider using GenericAPIView as view base class, if view is under your control. Ignoring view for now. 
Warning #10: RelayDomainViewSet: RelayDomainSerializer: TransportSerializer: Encountered 2 components with identical names "Transport" and different classes <class 'modoboa.relaydomains.api.v1.serializers.TransportSerializer'> and <class '
modoboa.transport.api.v2.serializers.TransportSerializer'>. This will very likely result in an incorrect schema. Try renaming one.
Warning #11: SharedCalendarViewSet: SharedCalendarSerializer: unable to resolve type hint for function "path". Consider using a type hint or @extend_schema_field. Defaulting to string.
Warning #12: SharedCalendarViewSet: SharedCalendarSerializer: DomainSerializer: Encountered 2 components with identical names "Domain" and different classes <class 'modoboa_radicale.serializers.DomainSerializer'> and <class 'modoboa.admin.
api.v2.serializers.DomainSerializer'>. This will very likely result in an incorrect schema. Try renaming one.
Warning #13: SharedCalendarViewSet: SharedCalendarSerializer: unable to resolve type hint for function "full_url". Consider using a type hint or @extend_schema_field. Defaulting to string.
Warning #14: SharedCalendarViewSet: SharedCalendarSerializer: unable to resolve type hint for function "share_url". Consider using a type hint or @extend_schema_field. Defaulting to string.
Warning #15: SharedEventViewSet: could not derive type of path parameter "calendar_pk" because it is untyped and obtaining queryset from the viewset failed. Consider adding a type to the path (e.g. <int:calendar_pk>) or annotating the para
meter type with @extend_schema. Defaulting to "string".
mail.envs.net [pid: 611247|app: 1|req: 38/61] my_ip () {62 vars in 1517 bytes} [Thu Sep 22 11:08:41 2022] GET /api/schema-v2/ => generated 172623 bytes in 1020 msecs (HTTP/1.0 500) 5 headers in 169 bytes (1 switches on core 0)
Error #0: SharedEventViewSet: UserAccountViewSet: unable to guess serializer. This is graceful fallback handling for APIViews. Consider using GenericAPIView as view base class, if view is under your control. Ignoring view for now. 
Warning #0: SharedEventViewSet: AccountViewSet: AccountSerializer: MailboxSerializer: Encountered 2 components with identical names "Mailbox" and different classes <class 'modoboa.admin.api.v1.serializers.MailboxSerializer'> and <class 'mo
doboa_radicale.serializers.MailboxSerializer'>. This will very likely result in an incorrect schema. Try renaming one.
Warning #1: SharedEventViewSet: AccountViewSet: AccountSerializer: unable to resolve type hint for function "get_resources". Consider using a type hint or @extend_schema_field. Defaulting to string.
Warning #2: SharedEventViewSet: AccountViewSet: WritableAccountSerializer: MailboxSerializer: Encountered 2 components with identical names "Mailbox" and different classes <class 'modoboa.admin.api.v2.serializers.MailboxSerializer'> and <c
lass 'modoboa_radicale.serializers.MailboxSerializer'>. This will very likely result in an incorrect schema. Try renaming one.
Warning #3: SharedEventViewSet: AccountViewSet: WritableAccountSerializer: Encountered 2 components with identical names "WritableAccount" and different classes <class 'modoboa.admin.api.v1.serializers.WritableAccountSerializer'> and <clas
s 'modoboa.admin.api.v2.serializers.WritableAccountSerializer'>. This will very likely result in an incorrect schema. Try renaming one.
Warning #4: SharedEventViewSet: AddressBookViewSet: AddressBookSerializer: unable to resolve type hint for function "url". Consider using a type hint or @extend_schema_field. Defaulting to string.
Warning #5: SharedEventViewSet: AttendeeViewSet: could not derive type of path parameter "id" because it is untyped and obtaining queryset from the viewset failed. Consider adding a type to the path (e.g. <int:id>) or annotating the parame
ter type with @extend_schema. Defaulting to "string".
Warning #6: SharedEventViewSet: DomainViewSet: DomainSerializer: DomainResourceSerializer: unable to resolve type hint for function "label". Consider using a type hint or @extend_schema_field. Defaulting to string.
Warning #7: SharedEventViewSet: DomainViewSet: DomainSerializer: DomainResourceSerializer: unable to resolve type hint for function "current_value". Consider using a type hint or @extend_schema_field. Defaulting to string.
Warning #8: SharedEventViewSet: DomainViewSet: DomainSerializer: DomainResourceSerializer: unable to resolve type hint for function "usage". Consider using a type hint or @extend_schema_field. Defaulting to string.
Warning #9: SharedEventViewSet: EmailAddressViewSet: EmailAddressWithNameSerializer: unable to resolve type hint for function "get_display_name". Consider using a type hint or @extend_schema_field. Defaulting to string.
Error #1: SharedEventViewSet: LanguageViewSet: unable to guess serializer. This is graceful fallback handling for APIViews. Consider using GenericAPIView as view base class, if view is under your control. Ignoring view for now. 
Warning #10: SharedEventViewSet: RelayDomainViewSet: RelayDomainSerializer: TransportSerializer: Encountered 2 components with identical names "Transport" and different classes <class 'modoboa.relaydomains.api.v1.serializers.TransportSeria
lizer'> and <class 'modoboa.transport.api.v2.serializers.TransportSerializer'>. This will very likely result in an incorrect schema. Try renaming one.
Warning #11: SharedEventViewSet: SharedCalendarViewSet: SharedCalendarSerializer: unable to resolve type hint for function "path". Consider using a type hint or @extend_schema_field. Defaulting to string.
Warning #12: SharedEventViewSet: SharedCalendarViewSet: SharedCalendarSerializer: DomainSerializer: Encountered 2 components with identical names "Domain" and different classes <class 'modoboa_radicale.serializers.DomainSerializer'> and <c
lass 'modoboa.admin.api.v2.serializers.DomainSerializer'>. This will very likely result in an incorrect schema. Try renaming one.
Warning #13: SharedEventViewSet: SharedCalendarViewSet: SharedCalendarSerializer: unable to resolve type hint for function "full_url". Consider using a type hint or @extend_schema_field. Defaulting to string.
Warning #14: SharedEventViewSet: SharedCalendarViewSet: SharedCalendarSerializer: unable to resolve type hint for function "share_url". Consider using a type hint or @extend_schema_field. Defaulting to string.
Warning #15: SharedEventViewSet: SharedEventViewSet: could not derive type of path parameter "calendar_pk" because it is untyped and obtaining queryset from the viewset failed. Consider adding a type to the path (e.g. <int:calendar_pk>) or
 annotating the parameter type with @extend_schema. Defaulting to "string".
mail.envs.net [pid: 611247|app: 1|req: 39/62] my_ip () {62 vars in 1517 bytes} [Thu Sep 22 11:08:43 2022] GET /api/schema-v2/ => generated 172623 bytes in 1012 msecs (HTTP/1.0 500) 5 headers in 169 bytes (1 switches on core 0)

image

I am having the same issues here, anyone managed to solve this

<!-- gh-comment-id:1271371050 --> @imbraintl commented on GitHub (Oct 7, 2022): > > > > i think i have the same issue here. > > https://mail.envs.net/api/schema-v2/swagger/ > > > Failed to load API definition. > > ![image](https://user-images.githubusercontent.com/7526990/191471005-9f3e61bb-67c3-48fb-80c1-66f3de221950.png) > > https://mail.envs.net/api/v1/ > > > The requested page does not exist. > > https://mail.envs.net/docs/api/ > > > The requested page does not exist. > > my User has enabled API in settings. > > Modoboa Version: 2.0.1 OS: Debian 11 installed via modoboa-installer > > # log (DEBUG: True) > ``` > envs.net [pid: 611246|app: 1|req: 22/60] my_ip () {66 vars in 1186 bytes} [Thu Sep 22 11:08:38 2022] GET /api/schema-v2/swagger/ => generated 4254 bytes in 502 msecs (HTTP/1.0 200) 7 headers in 366 bytes (1 switches on core 0 > ) > Error #0: UserAccountViewSet: unable to guess serializer. This is graceful fallback handling for APIViews. Consider using GenericAPIView as view base class, if view is under your control. Ignoring view for now. > Warning #0: AccountViewSet: AccountSerializer: MailboxSerializer: Encountered 2 components with identical names "Mailbox" and different classes <class 'modoboa.admin.api.v1.serializers.MailboxSerializer'> and <class 'modoboa_radicale.seria > lizers.MailboxSerializer'>. This will very likely result in an incorrect schema. Try renaming one. > Warning #1: AccountViewSet: AccountSerializer: unable to resolve type hint for function "get_resources". Consider using a type hint or @extend_schema_field. Defaulting to string. > Warning #2: AccountViewSet: WritableAccountSerializer: MailboxSerializer: Encountered 2 components with identical names "Mailbox" and different classes <class 'modoboa.admin.api.v2.serializers.MailboxSerializer'> and <class 'modoboa_radica > le.serializers.MailboxSerializer'>. This will very likely result in an incorrect schema. Try renaming one. > Warning #3: AccountViewSet: WritableAccountSerializer: Encountered 2 components with identical names "WritableAccount" and different classes <class 'modoboa.admin.api.v1.serializers.WritableAccountSerializer'> and <class 'modoboa.admin.api > .v2.serializers.WritableAccountSerializer'>. This will very likely result in an incorrect schema. Try renaming one. > Warning #4: AddressBookViewSet: AddressBookSerializer: unable to resolve type hint for function "url". Consider using a type hint or @extend_schema_field. Defaulting to string. > Warning #5: AttendeeViewSet: could not derive type of path parameter "id" because it is untyped and obtaining queryset from the viewset failed. Consider adding a type to the path (e.g. <int:id>) or annotating the parameter type with @exten > d_schema. Defaulting to "string". > Warning #6: DomainViewSet: DomainSerializer: DomainResourceSerializer: unable to resolve type hint for function "label". Consider using a type hint or @extend_schema_field. Defaulting to string. > Warning #7: DomainViewSet: DomainSerializer: DomainResourceSerializer: unable to resolve type hint for function "current_value". Consider using a type hint or @extend_schema_field. Defaulting to string. > Warning #8: DomainViewSet: DomainSerializer: DomainResourceSerializer: unable to resolve type hint for function "usage". Consider using a type hint or @extend_schema_field. Defaulting to string. > Warning #9: EmailAddressViewSet: EmailAddressWithNameSerializer: unable to resolve type hint for function "get_display_name". Consider using a type hint or @extend_schema_field. Defaulting to string. > Error #1: LanguageViewSet: unable to guess serializer. This is graceful fallback handling for APIViews. Consider using GenericAPIView as view base class, if view is under your control. Ignoring view for now. > Warning #10: RelayDomainViewSet: RelayDomainSerializer: TransportSerializer: Encountered 2 components with identical names "Transport" and different classes <class 'modoboa.relaydomains.api.v1.serializers.TransportSerializer'> and <class ' > modoboa.transport.api.v2.serializers.TransportSerializer'>. This will very likely result in an incorrect schema. Try renaming one. > Warning #11: SharedCalendarViewSet: SharedCalendarSerializer: unable to resolve type hint for function "path". Consider using a type hint or @extend_schema_field. Defaulting to string. > Warning #12: SharedCalendarViewSet: SharedCalendarSerializer: DomainSerializer: Encountered 2 components with identical names "Domain" and different classes <class 'modoboa_radicale.serializers.DomainSerializer'> and <class 'modoboa.admin. > api.v2.serializers.DomainSerializer'>. This will very likely result in an incorrect schema. Try renaming one. > Warning #13: SharedCalendarViewSet: SharedCalendarSerializer: unable to resolve type hint for function "full_url". Consider using a type hint or @extend_schema_field. Defaulting to string. > Warning #14: SharedCalendarViewSet: SharedCalendarSerializer: unable to resolve type hint for function "share_url". Consider using a type hint or @extend_schema_field. Defaulting to string. > Warning #15: SharedEventViewSet: could not derive type of path parameter "calendar_pk" because it is untyped and obtaining queryset from the viewset failed. Consider adding a type to the path (e.g. <int:calendar_pk>) or annotating the para > meter type with @extend_schema. Defaulting to "string". > mail.envs.net [pid: 611247|app: 1|req: 38/61] my_ip () {62 vars in 1517 bytes} [Thu Sep 22 11:08:41 2022] GET /api/schema-v2/ => generated 172623 bytes in 1020 msecs (HTTP/1.0 500) 5 headers in 169 bytes (1 switches on core 0) > Error #0: SharedEventViewSet: UserAccountViewSet: unable to guess serializer. This is graceful fallback handling for APIViews. Consider using GenericAPIView as view base class, if view is under your control. Ignoring view for now. > Warning #0: SharedEventViewSet: AccountViewSet: AccountSerializer: MailboxSerializer: Encountered 2 components with identical names "Mailbox" and different classes <class 'modoboa.admin.api.v1.serializers.MailboxSerializer'> and <class 'mo > doboa_radicale.serializers.MailboxSerializer'>. This will very likely result in an incorrect schema. Try renaming one. > Warning #1: SharedEventViewSet: AccountViewSet: AccountSerializer: unable to resolve type hint for function "get_resources". Consider using a type hint or @extend_schema_field. Defaulting to string. > Warning #2: SharedEventViewSet: AccountViewSet: WritableAccountSerializer: MailboxSerializer: Encountered 2 components with identical names "Mailbox" and different classes <class 'modoboa.admin.api.v2.serializers.MailboxSerializer'> and <c > lass 'modoboa_radicale.serializers.MailboxSerializer'>. This will very likely result in an incorrect schema. Try renaming one. > Warning #3: SharedEventViewSet: AccountViewSet: WritableAccountSerializer: Encountered 2 components with identical names "WritableAccount" and different classes <class 'modoboa.admin.api.v1.serializers.WritableAccountSerializer'> and <clas > s 'modoboa.admin.api.v2.serializers.WritableAccountSerializer'>. This will very likely result in an incorrect schema. Try renaming one. > Warning #4: SharedEventViewSet: AddressBookViewSet: AddressBookSerializer: unable to resolve type hint for function "url". Consider using a type hint or @extend_schema_field. Defaulting to string. > Warning #5: SharedEventViewSet: AttendeeViewSet: could not derive type of path parameter "id" because it is untyped and obtaining queryset from the viewset failed. Consider adding a type to the path (e.g. <int:id>) or annotating the parame > ter type with @extend_schema. Defaulting to "string". > Warning #6: SharedEventViewSet: DomainViewSet: DomainSerializer: DomainResourceSerializer: unable to resolve type hint for function "label". Consider using a type hint or @extend_schema_field. Defaulting to string. > Warning #7: SharedEventViewSet: DomainViewSet: DomainSerializer: DomainResourceSerializer: unable to resolve type hint for function "current_value". Consider using a type hint or @extend_schema_field. Defaulting to string. > Warning #8: SharedEventViewSet: DomainViewSet: DomainSerializer: DomainResourceSerializer: unable to resolve type hint for function "usage". Consider using a type hint or @extend_schema_field. Defaulting to string. > Warning #9: SharedEventViewSet: EmailAddressViewSet: EmailAddressWithNameSerializer: unable to resolve type hint for function "get_display_name". Consider using a type hint or @extend_schema_field. Defaulting to string. > Error #1: SharedEventViewSet: LanguageViewSet: unable to guess serializer. This is graceful fallback handling for APIViews. Consider using GenericAPIView as view base class, if view is under your control. Ignoring view for now. > Warning #10: SharedEventViewSet: RelayDomainViewSet: RelayDomainSerializer: TransportSerializer: Encountered 2 components with identical names "Transport" and different classes <class 'modoboa.relaydomains.api.v1.serializers.TransportSeria > lizer'> and <class 'modoboa.transport.api.v2.serializers.TransportSerializer'>. This will very likely result in an incorrect schema. Try renaming one. > Warning #11: SharedEventViewSet: SharedCalendarViewSet: SharedCalendarSerializer: unable to resolve type hint for function "path". Consider using a type hint or @extend_schema_field. Defaulting to string. > Warning #12: SharedEventViewSet: SharedCalendarViewSet: SharedCalendarSerializer: DomainSerializer: Encountered 2 components with identical names "Domain" and different classes <class 'modoboa_radicale.serializers.DomainSerializer'> and <c > lass 'modoboa.admin.api.v2.serializers.DomainSerializer'>. This will very likely result in an incorrect schema. Try renaming one. > Warning #13: SharedEventViewSet: SharedCalendarViewSet: SharedCalendarSerializer: unable to resolve type hint for function "full_url". Consider using a type hint or @extend_schema_field. Defaulting to string. > Warning #14: SharedEventViewSet: SharedCalendarViewSet: SharedCalendarSerializer: unable to resolve type hint for function "share_url". Consider using a type hint or @extend_schema_field. Defaulting to string. > Warning #15: SharedEventViewSet: SharedEventViewSet: could not derive type of path parameter "calendar_pk" because it is untyped and obtaining queryset from the viewset failed. Consider adding a type to the path (e.g. <int:calendar_pk>) or > annotating the parameter type with @extend_schema. Defaulting to "string". > mail.envs.net [pid: 611247|app: 1|req: 39/62] my_ip () {62 vars in 1517 bytes} [Thu Sep 22 11:08:43 2022] GET /api/schema-v2/ => generated 172623 bytes in 1012 msecs (HTTP/1.0 500) 5 headers in 169 bytes (1 switches on core 0) > ``` > > ![image](https://user-images.githubusercontent.com/7526990/191708378-e12f8d6a-8ab5-487e-84c9-04f4e3beaa58.png) I am having the same issues here, anyone managed to solve this
Author
Owner

@tonioo commented on GitHub (Oct 12, 2022):

Looks like an issue with one of the plugins (maybe the radicale one)

<!-- gh-comment-id:1275676904 --> @tonioo commented on GitHub (Oct 12, 2022): Looks like an issue with one of the plugins (maybe the radicale one)
Author
Owner

@kalungia commented on GitHub (Oct 13, 2022):

Good day,
Am also having the same issue here. Please help.

<!-- gh-comment-id:1277215233 --> @kalungia commented on GitHub (Oct 13, 2022): Good day, Am also having the same issue here. Please help.
Author
Owner

@fedi-will commented on GitHub (Oct 18, 2022):

Same problem here.
I cannot access API doc.

Debian 11, Modoboa 2.0.2, installed with installer-script
using dashboard v1, created new superadmin, gave api access to that user

Result:
calling /api/schema-v2/swagger/ returns "Fetch error. Internal Server Error /api/schema-v2/", see attached image
calling /api/v1/ returns 404
calling /docs/api/ returns 404

modo-api-failed

Please Help, I am out of ideas

Update:

in /var/log/uwsgi/app/modoboa-instance.log I have dozens of entries like this:
Warning #10: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: SharedCalendarViewSet: SharedCalendarSerializer: DomainSerializer: Encountered 2 components with identical names "Domain" and different classes <class 'modoboa_radicale.serializers.DomainSerializer'> and <class 'modoboa.admin.api.v2.serializers.DomainSerializer'>. This will very likely result in an incorrect schema. Try renaming one.

No idea if thats relevant, I just grepped for 'api' int the logs.

<!-- gh-comment-id:1282532793 --> @fedi-will commented on GitHub (Oct 18, 2022): Same problem here. I cannot access API doc. Debian 11, Modoboa 2.0.2, installed with installer-script using dashboard v1, created new superadmin, gave api access to that user Result: calling /api/schema-v2/swagger/ returns "Fetch error. Internal Server Error /api/schema-v2/", see attached image calling /api/v1/ returns 404 calling /docs/api/ returns 404 ![modo-api-failed](https://user-images.githubusercontent.com/89528154/196466511-0e32e7d2-e099-4c54-bdc9-0a9d3da6c4dd.png) Please Help, I am out of ideas Update: in /var/log/uwsgi/app/modoboa-instance.log I have dozens of entries like this: `Warning #10: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: SharedCalendarViewSet: SharedCalendarSerializer: DomainSerializer: Encountered 2 components with identical names "Domain" and different classes <class 'modoboa_radicale.serializers.DomainSerializer'> and <class 'modoboa.admin.api.v2.serializers.DomainSerializer'>. This will very likely result in an incorrect schema. Try renaming one.` No idea if thats relevant, I just grepped for 'api' int the logs.
Author
Owner

@tonioo commented on GitHub (Oct 18, 2022):

@fedi-will Can you set DEBUG to True inside the settings.py, reload uwsgi and try again please?

<!-- gh-comment-id:1282567759 --> @tonioo commented on GitHub (Oct 18, 2022): @fedi-will Can you set DEBUG to True inside the settings.py, reload uwsgi and try again please?
Author
Owner

@fedi-will commented on GitHub (Oct 18, 2022):

@tonioo :
set debug to true, restarted uwsgi service, try to access /api/schema-v2/swagger/ in a browser

Resulting log from /var/log/uwsgi/app/modoboa-instance.log is:

Tue Oct 18 17:25:35 2022 - SIGINT/SIGQUIT received...killing workers...
Tue Oct 18 17:25:37 2022 - worker 1 buried after 2 seconds
Tue Oct 18 17:25:37 2022 - worker 2 buried after 2 seconds
Tue Oct 18 17:25:37 2022 - goodbye to uWSGI.
Tue Oct 18 17:25:38 2022 - VACUUM: unix socket /run/uwsgi/app/modoboa_instance/socket removed.
Tue Oct 18 17:25:38 2022 - *** Starting uWSGI 2.0.19.1-debian (64bit) on [Tue Oct 18 17:25:38 2022] ***
Tue Oct 18 17:25:38 2022 - compiled with version: 10.2.1 20210110 on 11 June 2021 09:08:33
Tue Oct 18 17:25:38 2022 - os: Linux-5.10.0-18-amd64 #1 SMP Debian 5.10.140-1 (2022-09-02)
Tue Oct 18 17:25:38 2022 - nodename: mailserver
Tue Oct 18 17:25:38 2022 - machine: x86_64
Tue Oct 18 17:25:38 2022 - clock source: unix
Tue Oct 18 17:25:38 2022 - pcre jit disabled
Tue Oct 18 17:25:38 2022 - detected number of CPU cores: 1
Tue Oct 18 17:25:38 2022 - current working directory: /
Tue Oct 18 17:25:38 2022 - writing pidfile to /run/uwsgi/app/modoboa_instance/pid
Tue Oct 18 17:25:38 2022 - detected binary path: /usr/bin/uwsgi-core
Tue Oct 18 17:25:38 2022 - chdir() to /opt/services/modoboa/instance
Tue Oct 18 17:25:38 2022 - your processes number limit is 7820
Tue Oct 18 17:25:38 2022 - your memory page size is 4096 bytes
Tue Oct 18 17:25:38 2022 - detected max file descriptor number: 1024
Tue Oct 18 17:25:38 2022 - VirtualHosting mode enabled.
Tue Oct 18 17:25:38 2022 - lock engine: pthread robust mutexes
Tue Oct 18 17:25:38 2022 - thunder lock: disabled (you can enable it with --thunder-lock)
Tue Oct 18 17:25:38 2022 - uwsgi socket 0 bound to UNIX address /run/uwsgi/app/modoboa_instance/socket fd 3
Tue Oct 18 17:25:38 2022 - setgid() to 1001
Tue Oct 18 17:25:38 2022 - setuid() to 1001
Tue Oct 18 17:25:38 2022 - Python version: 3.9.2 (default, Feb 28 2021, 17:03:44)  [GCC 10.2.1 20210110]
Tue Oct 18 17:25:38 2022 - PEP 405 virtualenv detected: /opt/services/modoboa/env
Tue Oct 18 17:25:38 2022 - Set PythonHome to /opt/services/modoboa/env
Tue Oct 18 17:25:38 2022 - *** Python threads support is disabled. You can enable it with --enable-threads ***
Tue Oct 18 17:25:38 2022 - Python main interpreter initialized at 0x5597503d6010
Tue Oct 18 17:25:38 2022 - your server socket listen backlog is limited to 100 connections
Tue Oct 18 17:25:38 2022 - your mercy for graceful operations on workers is 60 seconds
Tue Oct 18 17:25:38 2022 - mapped 218808 bytes (213 KB) for 2 cores
Tue Oct 18 17:25:38 2022 - *** Operational MODE: preforking ***
Tue Oct 18 17:25:40 2022 - WSGI app 0 (mountpoint='') ready in 2 seconds on interpreter 0x5597503d6010 pid: 726879
Tue Oct 18 17:25:40 2022 - spawned uWSGI master process (pid: 726879)
Tue Oct 18 17:25:40 2022 - spawned uWSGI worker 1 (pid: 726886, cores: 1)
Tue Oct 18 17:25:40 2022 - spawned uWSGI worker 2 (pid: 726887, cores: 1)
Tue Oct 18 17:26:01 2022 - WSGI app 1 (mountpoint='mail.myserver.email|') ready in 0 seconds on interpreter 0x5597503d6010 pid: 726886
mail.myserver.email [pid: 726886|app: 1|req: 1/1] 23.32.173.189 () {60 vars in 1093 bytes} [Tue Oct 18 17:26:01 2022] GET /api/schema-v2/swagger/ => generated 4254 bytes in 3858 msecs (HTTP/1.1 200) 7 headers in 366 bytes (1 switches on core 0)
Error #0: UserAccountViewSet: unable to guess serializer. This is graceful fallback handling for APIViews. Consider using GenericAPIView as view base class, if view is under your control. Ignoring view for now.
Warning #0: AccountViewSet: AccountSerializer: MailboxSerializer: Encountered 2 components with identical names "Mailbox" and different classes <class 'modoboa.admin.api.v1.serializers.MailboxSerializer'> and <class 'modoboa_radicale.serializers.MailboxSerializer'>. This will very likely result in an incorrect schema. Try renaming one.
Warning #1: AccountViewSet: AccountSerializer: unable to resolve type hint for function "get_resources". Consider using a type hint or @extend_schema_field. Defaulting to string.
Warning #2: AccountViewSet: WritableAccountSerializer: MailboxSerializer: Encountered 2 components with identical names "Mailbox" and different classes <class 'modoboa.admin.api.v2.serializers.MailboxSerializer'> and <class 'modoboa_radicale.serializers.MailboxSerializer'>. This will very likely result in an incorrect schema. Try renaming one.
Warning #3: AccountViewSet: WritableAccountSerializer: Encountered 2 components with identical names "WritableAccount" and different classes <class 'modoboa.admin.api.v1.serializers.WritableAccountSerializer'> and <class 'modoboa.admin.api.v2.serializers.WritableAccountSerializer'>. This will very likely result in an incorrect schema. Try renaming one.
Warning #4: AddressBookViewSet: AddressBookSerializer: unable to resolve type hint for function "url". Consider using a type hint or @extend_schema_field. Defaulting to string.
Warning #5: AlarmViewSet: AlarmSerializer: NestedSerializer: Encountered 2 components with identical names "Nested" and different classes <class 'rest_framework.serializers.ModelSerializer.build_nested_field.<locals>.NestedSerializer'> and <class 'rest_framework.serializers.ModelSerializer.build_nested_field.<locals>.NestedSerializer'>. This will very likely result in an incorrect schema. Try renaming one.
Warning #6: AttendeeViewSet: could not derive type of path parameter "id" because it is untyped and obtaining queryset from the viewset failed. Consider adding a type to the path (e.g. <int:id>) or annotating the parameter type with @extend_schema. Defaulting to "string".
Warning #7: EmailAddressViewSet: EmailAddressWithNameSerializer: unable to resolve type hint for function "get_display_name". Consider using a type hint or @extend_schema_field. Defaulting to string.
Error #1: LanguageViewSet: unable to guess serializer. This is graceful fallback handling for APIViews. Consider using GenericAPIView as view base class, if view is under your control. Ignoring view for now.
Warning #8: RelayDomainViewSet: RelayDomainSerializer: TransportSerializer: Encountered 2 components with identical names "Transport" and different classes <class 'modoboa.relaydomains.api.v1.serializers.TransportSerializer'> and <class 'modoboa.transport.api.v2.serializers.TransportSerializer'>. This will very likely result in an incorrect schema. Try renaming one.
Warning #9: SharedCalendarViewSet: SharedCalendarSerializer: unable to resolve type hint for function "path". Consider using a type hint or @extend_schema_field. Defaulting to string.
Warning #10: SharedCalendarViewSet: SharedCalendarSerializer: DomainSerializer: Encountered 2 components with identical names "Domain" and different classes <class 'modoboa_radicale.serializers.DomainSerializer'> and <class 'modoboa.admin.api.v2.serializers.DomainSerializer'>. This will very likely result in an incorrect schema. Try renaming one.
Warning #11: SharedCalendarViewSet: SharedCalendarSerializer: unable to resolve type hint for function "full_url". Consider using a type hint or @extend_schema_field. Defaulting to string.
Warning #12: SharedCalendarViewSet: SharedCalendarSerializer: unable to resolve type hint for function "share_url". Consider using a type hint or @extend_schema_field. Defaulting to string.
Warning #13: SharedEventViewSet: could not derive type of path parameter "calendar_pk" because it is untyped and obtaining queryset from the viewset failed. Consider adding a type to the path (e.g. <int:calendar_pk>) or annotating the parameter type with @extend_schema. Defaulting to "string".
mail.myserver.email [pid: 726886|app: 1|req: 2/2] 23.32.173.189 () {58 vars in 1018 bytes} [Tue Oct 18 17:26:05 2022] GET /api/schema-v2/ => generated 171789 bytes in 2994 msecs (HTTP/1.1 500) 5 headers in 169 bytes (1 switches on core 0)
Tue Oct 18 17:26:09 2022 - WSGI app 1 (mountpoint='mail.myserver.email|') ready in 0 seconds on interpreter 0x5597503d6010 pid: 726887
Error #0: UserAccountViewSet: unable to guess serializer. This is graceful fallback handling for APIViews. Consider using GenericAPIView as view base class, if view is under your control. Ignoring view for now.
Warning #0: AccountViewSet: AccountSerializer: MailboxSerializer: Encountered 2 components with identical names "Mailbox" and different classes <class 'modoboa.admin.api.v1.serializers.MailboxSerializer'> and <class 'modoboa_radicale.serializers.MailboxSerializer'>. This will very likely result in an incorrect schema. Try renaming one.
Warning #1: AccountViewSet: AccountSerializer: unable to resolve type hint for function "get_resources". Consider using a type hint or @extend_schema_field. Defaulting to string.
Warning #2: AccountViewSet: WritableAccountSerializer: MailboxSerializer: Encountered 2 components with identical names "Mailbox" and different classes <class 'modoboa.admin.api.v2.serializers.MailboxSerializer'> and <class 'modoboa_radicale.serializers.MailboxSerializer'>. This will very likely result in an incorrect schema. Try renaming one.
Warning #3: AccountViewSet: WritableAccountSerializer: Encountered 2 components with identical names "WritableAccount" and different classes <class 'modoboa.admin.api.v1.serializers.WritableAccountSerializer'> and <class 'modoboa.admin.api.v2.serializers.WritableAccountSerializer'>. This will very likely result in an incorrect schema. Try renaming one.
Warning #4: AddressBookViewSet: AddressBookSerializer: unable to resolve type hint for function "url". Consider using a type hint or @extend_schema_field. Defaulting to string.
Warning #5: AlarmViewSet: AlarmSerializer: NestedSerializer: Encountered 2 components with identical names "Nested" and different classes <class 'rest_framework.serializers.ModelSerializer.build_nested_field.<locals>.NestedSerializer'> and <class 'rest_framework.serializers.ModelSerializer.build_nested_field.<locals>.NestedSerializer'>. This will very likely result in an incorrect schema. Try renaming one.
Warning #6: AttendeeViewSet: could not derive type of path parameter "id" because it is untyped and obtaining queryset from the viewset failed. Consider adding a type to the path (e.g. <int:id>) or annotating the parameter type with @extend_schema. Defaulting to "string".
Warning #7: EmailAddressViewSet: EmailAddressWithNameSerializer: unable to resolve type hint for function "get_display_name". Consider using a type hint or @extend_schema_field. Defaulting to string.
Error #1: LanguageViewSet: unable to guess serializer. This is graceful fallback handling for APIViews. Consider using GenericAPIView as view base class, if view is under your control. Ignoring view for now.
Warning #8: RelayDomainViewSet: RelayDomainSerializer: TransportSerializer: Encountered 2 components with identical names "Transport" and different classes <class 'modoboa.relaydomains.api.v1.serializers.TransportSerializer'> and <class 'modoboa.transport.api.v2.serializers.TransportSerializer'>. This will very likely result in an incorrect schema. Try renaming one.
Warning #9: SharedCalendarViewSet: SharedCalendarSerializer: unable to resolve type hint for function "path". Consider using a type hint or @extend_schema_field. Defaulting to string.
Warning #10: SharedCalendarViewSet: SharedCalendarSerializer: DomainSerializer: Encountered 2 components with identical names "Domain" and different classes <class 'modoboa_radicale.serializers.DomainSerializer'> and <class 'modoboa.admin.api.v2.serializers.DomainSerializer'>. This will very likely result in an incorrect schema. Try renaming one.
Warning #11: SharedCalendarViewSet: SharedCalendarSerializer: unable to resolve type hint for function "full_url". Consider using a type hint or @extend_schema_field. Defaulting to string.
Warning #12: SharedCalendarViewSet: SharedCalendarSerializer: unable to resolve type hint for function "share_url". Consider using a type hint or @extend_schema_field. Defaulting to string.
Warning #13: SharedEventViewSet: could not derive type of path parameter "calendar_pk" because it is untyped and obtaining queryset from the viewset failed. Consider adding a type to the path (e.g. <int:calendar_pk>) or annotating the parameter type with @extend_schema. Defaulting to "string".
mail.myserver.email [pid: 726887|app: 1|req: 1/3] 23.32.173.189 () {58 vars in 1018 bytes} [Tue Oct 18 17:26:09 2022] GET /api/schema-v2/ => generated 171789 bytes in 1833 msecs (HTTP/1.1 500) 5 headers in 169 bytes (1 switches on core 0)
<!-- gh-comment-id:1282599765 --> @fedi-will commented on GitHub (Oct 18, 2022): @tonioo : set debug to true, restarted uwsgi service, try to access /api/schema-v2/swagger/ in a browser Resulting log from /var/log/uwsgi/app/modoboa-instance.log is: ``` Tue Oct 18 17:25:35 2022 - SIGINT/SIGQUIT received...killing workers... Tue Oct 18 17:25:37 2022 - worker 1 buried after 2 seconds Tue Oct 18 17:25:37 2022 - worker 2 buried after 2 seconds Tue Oct 18 17:25:37 2022 - goodbye to uWSGI. Tue Oct 18 17:25:38 2022 - VACUUM: unix socket /run/uwsgi/app/modoboa_instance/socket removed. Tue Oct 18 17:25:38 2022 - *** Starting uWSGI 2.0.19.1-debian (64bit) on [Tue Oct 18 17:25:38 2022] *** Tue Oct 18 17:25:38 2022 - compiled with version: 10.2.1 20210110 on 11 June 2021 09:08:33 Tue Oct 18 17:25:38 2022 - os: Linux-5.10.0-18-amd64 #1 SMP Debian 5.10.140-1 (2022-09-02) Tue Oct 18 17:25:38 2022 - nodename: mailserver Tue Oct 18 17:25:38 2022 - machine: x86_64 Tue Oct 18 17:25:38 2022 - clock source: unix Tue Oct 18 17:25:38 2022 - pcre jit disabled Tue Oct 18 17:25:38 2022 - detected number of CPU cores: 1 Tue Oct 18 17:25:38 2022 - current working directory: / Tue Oct 18 17:25:38 2022 - writing pidfile to /run/uwsgi/app/modoboa_instance/pid Tue Oct 18 17:25:38 2022 - detected binary path: /usr/bin/uwsgi-core Tue Oct 18 17:25:38 2022 - chdir() to /opt/services/modoboa/instance Tue Oct 18 17:25:38 2022 - your processes number limit is 7820 Tue Oct 18 17:25:38 2022 - your memory page size is 4096 bytes Tue Oct 18 17:25:38 2022 - detected max file descriptor number: 1024 Tue Oct 18 17:25:38 2022 - VirtualHosting mode enabled. Tue Oct 18 17:25:38 2022 - lock engine: pthread robust mutexes Tue Oct 18 17:25:38 2022 - thunder lock: disabled (you can enable it with --thunder-lock) Tue Oct 18 17:25:38 2022 - uwsgi socket 0 bound to UNIX address /run/uwsgi/app/modoboa_instance/socket fd 3 Tue Oct 18 17:25:38 2022 - setgid() to 1001 Tue Oct 18 17:25:38 2022 - setuid() to 1001 Tue Oct 18 17:25:38 2022 - Python version: 3.9.2 (default, Feb 28 2021, 17:03:44) [GCC 10.2.1 20210110] Tue Oct 18 17:25:38 2022 - PEP 405 virtualenv detected: /opt/services/modoboa/env Tue Oct 18 17:25:38 2022 - Set PythonHome to /opt/services/modoboa/env Tue Oct 18 17:25:38 2022 - *** Python threads support is disabled. You can enable it with --enable-threads *** Tue Oct 18 17:25:38 2022 - Python main interpreter initialized at 0x5597503d6010 Tue Oct 18 17:25:38 2022 - your server socket listen backlog is limited to 100 connections Tue Oct 18 17:25:38 2022 - your mercy for graceful operations on workers is 60 seconds Tue Oct 18 17:25:38 2022 - mapped 218808 bytes (213 KB) for 2 cores Tue Oct 18 17:25:38 2022 - *** Operational MODE: preforking *** Tue Oct 18 17:25:40 2022 - WSGI app 0 (mountpoint='') ready in 2 seconds on interpreter 0x5597503d6010 pid: 726879 Tue Oct 18 17:25:40 2022 - spawned uWSGI master process (pid: 726879) Tue Oct 18 17:25:40 2022 - spawned uWSGI worker 1 (pid: 726886, cores: 1) Tue Oct 18 17:25:40 2022 - spawned uWSGI worker 2 (pid: 726887, cores: 1) Tue Oct 18 17:26:01 2022 - WSGI app 1 (mountpoint='mail.myserver.email|') ready in 0 seconds on interpreter 0x5597503d6010 pid: 726886 mail.myserver.email [pid: 726886|app: 1|req: 1/1] 23.32.173.189 () {60 vars in 1093 bytes} [Tue Oct 18 17:26:01 2022] GET /api/schema-v2/swagger/ => generated 4254 bytes in 3858 msecs (HTTP/1.1 200) 7 headers in 366 bytes (1 switches on core 0) Error #0: UserAccountViewSet: unable to guess serializer. This is graceful fallback handling for APIViews. Consider using GenericAPIView as view base class, if view is under your control. Ignoring view for now. Warning #0: AccountViewSet: AccountSerializer: MailboxSerializer: Encountered 2 components with identical names "Mailbox" and different classes <class 'modoboa.admin.api.v1.serializers.MailboxSerializer'> and <class 'modoboa_radicale.serializers.MailboxSerializer'>. This will very likely result in an incorrect schema. Try renaming one. Warning #1: AccountViewSet: AccountSerializer: unable to resolve type hint for function "get_resources". Consider using a type hint or @extend_schema_field. Defaulting to string. Warning #2: AccountViewSet: WritableAccountSerializer: MailboxSerializer: Encountered 2 components with identical names "Mailbox" and different classes <class 'modoboa.admin.api.v2.serializers.MailboxSerializer'> and <class 'modoboa_radicale.serializers.MailboxSerializer'>. This will very likely result in an incorrect schema. Try renaming one. Warning #3: AccountViewSet: WritableAccountSerializer: Encountered 2 components with identical names "WritableAccount" and different classes <class 'modoboa.admin.api.v1.serializers.WritableAccountSerializer'> and <class 'modoboa.admin.api.v2.serializers.WritableAccountSerializer'>. This will very likely result in an incorrect schema. Try renaming one. Warning #4: AddressBookViewSet: AddressBookSerializer: unable to resolve type hint for function "url". Consider using a type hint or @extend_schema_field. Defaulting to string. Warning #5: AlarmViewSet: AlarmSerializer: NestedSerializer: Encountered 2 components with identical names "Nested" and different classes <class 'rest_framework.serializers.ModelSerializer.build_nested_field.<locals>.NestedSerializer'> and <class 'rest_framework.serializers.ModelSerializer.build_nested_field.<locals>.NestedSerializer'>. This will very likely result in an incorrect schema. Try renaming one. Warning #6: AttendeeViewSet: could not derive type of path parameter "id" because it is untyped and obtaining queryset from the viewset failed. Consider adding a type to the path (e.g. <int:id>) or annotating the parameter type with @extend_schema. Defaulting to "string". Warning #7: EmailAddressViewSet: EmailAddressWithNameSerializer: unable to resolve type hint for function "get_display_name". Consider using a type hint or @extend_schema_field. Defaulting to string. Error #1: LanguageViewSet: unable to guess serializer. This is graceful fallback handling for APIViews. Consider using GenericAPIView as view base class, if view is under your control. Ignoring view for now. Warning #8: RelayDomainViewSet: RelayDomainSerializer: TransportSerializer: Encountered 2 components with identical names "Transport" and different classes <class 'modoboa.relaydomains.api.v1.serializers.TransportSerializer'> and <class 'modoboa.transport.api.v2.serializers.TransportSerializer'>. This will very likely result in an incorrect schema. Try renaming one. Warning #9: SharedCalendarViewSet: SharedCalendarSerializer: unable to resolve type hint for function "path". Consider using a type hint or @extend_schema_field. Defaulting to string. Warning #10: SharedCalendarViewSet: SharedCalendarSerializer: DomainSerializer: Encountered 2 components with identical names "Domain" and different classes <class 'modoboa_radicale.serializers.DomainSerializer'> and <class 'modoboa.admin.api.v2.serializers.DomainSerializer'>. This will very likely result in an incorrect schema. Try renaming one. Warning #11: SharedCalendarViewSet: SharedCalendarSerializer: unable to resolve type hint for function "full_url". Consider using a type hint or @extend_schema_field. Defaulting to string. Warning #12: SharedCalendarViewSet: SharedCalendarSerializer: unable to resolve type hint for function "share_url". Consider using a type hint or @extend_schema_field. Defaulting to string. Warning #13: SharedEventViewSet: could not derive type of path parameter "calendar_pk" because it is untyped and obtaining queryset from the viewset failed. Consider adding a type to the path (e.g. <int:calendar_pk>) or annotating the parameter type with @extend_schema. Defaulting to "string". mail.myserver.email [pid: 726886|app: 1|req: 2/2] 23.32.173.189 () {58 vars in 1018 bytes} [Tue Oct 18 17:26:05 2022] GET /api/schema-v2/ => generated 171789 bytes in 2994 msecs (HTTP/1.1 500) 5 headers in 169 bytes (1 switches on core 0) Tue Oct 18 17:26:09 2022 - WSGI app 1 (mountpoint='mail.myserver.email|') ready in 0 seconds on interpreter 0x5597503d6010 pid: 726887 Error #0: UserAccountViewSet: unable to guess serializer. This is graceful fallback handling for APIViews. Consider using GenericAPIView as view base class, if view is under your control. Ignoring view for now. Warning #0: AccountViewSet: AccountSerializer: MailboxSerializer: Encountered 2 components with identical names "Mailbox" and different classes <class 'modoboa.admin.api.v1.serializers.MailboxSerializer'> and <class 'modoboa_radicale.serializers.MailboxSerializer'>. This will very likely result in an incorrect schema. Try renaming one. Warning #1: AccountViewSet: AccountSerializer: unable to resolve type hint for function "get_resources". Consider using a type hint or @extend_schema_field. Defaulting to string. Warning #2: AccountViewSet: WritableAccountSerializer: MailboxSerializer: Encountered 2 components with identical names "Mailbox" and different classes <class 'modoboa.admin.api.v2.serializers.MailboxSerializer'> and <class 'modoboa_radicale.serializers.MailboxSerializer'>. This will very likely result in an incorrect schema. Try renaming one. Warning #3: AccountViewSet: WritableAccountSerializer: Encountered 2 components with identical names "WritableAccount" and different classes <class 'modoboa.admin.api.v1.serializers.WritableAccountSerializer'> and <class 'modoboa.admin.api.v2.serializers.WritableAccountSerializer'>. This will very likely result in an incorrect schema. Try renaming one. Warning #4: AddressBookViewSet: AddressBookSerializer: unable to resolve type hint for function "url". Consider using a type hint or @extend_schema_field. Defaulting to string. Warning #5: AlarmViewSet: AlarmSerializer: NestedSerializer: Encountered 2 components with identical names "Nested" and different classes <class 'rest_framework.serializers.ModelSerializer.build_nested_field.<locals>.NestedSerializer'> and <class 'rest_framework.serializers.ModelSerializer.build_nested_field.<locals>.NestedSerializer'>. This will very likely result in an incorrect schema. Try renaming one. Warning #6: AttendeeViewSet: could not derive type of path parameter "id" because it is untyped and obtaining queryset from the viewset failed. Consider adding a type to the path (e.g. <int:id>) or annotating the parameter type with @extend_schema. Defaulting to "string". Warning #7: EmailAddressViewSet: EmailAddressWithNameSerializer: unable to resolve type hint for function "get_display_name". Consider using a type hint or @extend_schema_field. Defaulting to string. Error #1: LanguageViewSet: unable to guess serializer. This is graceful fallback handling for APIViews. Consider using GenericAPIView as view base class, if view is under your control. Ignoring view for now. Warning #8: RelayDomainViewSet: RelayDomainSerializer: TransportSerializer: Encountered 2 components with identical names "Transport" and different classes <class 'modoboa.relaydomains.api.v1.serializers.TransportSerializer'> and <class 'modoboa.transport.api.v2.serializers.TransportSerializer'>. This will very likely result in an incorrect schema. Try renaming one. Warning #9: SharedCalendarViewSet: SharedCalendarSerializer: unable to resolve type hint for function "path". Consider using a type hint or @extend_schema_field. Defaulting to string. Warning #10: SharedCalendarViewSet: SharedCalendarSerializer: DomainSerializer: Encountered 2 components with identical names "Domain" and different classes <class 'modoboa_radicale.serializers.DomainSerializer'> and <class 'modoboa.admin.api.v2.serializers.DomainSerializer'>. This will very likely result in an incorrect schema. Try renaming one. Warning #11: SharedCalendarViewSet: SharedCalendarSerializer: unable to resolve type hint for function "full_url". Consider using a type hint or @extend_schema_field. Defaulting to string. Warning #12: SharedCalendarViewSet: SharedCalendarSerializer: unable to resolve type hint for function "share_url". Consider using a type hint or @extend_schema_field. Defaulting to string. Warning #13: SharedEventViewSet: could not derive type of path parameter "calendar_pk" because it is untyped and obtaining queryset from the viewset failed. Consider adding a type to the path (e.g. <int:calendar_pk>) or annotating the parameter type with @extend_schema. Defaulting to "string". mail.myserver.email [pid: 726887|app: 1|req: 1/3] 23.32.173.189 () {58 vars in 1018 bytes} [Tue Oct 18 17:26:09 2022] GET /api/schema-v2/ => generated 171789 bytes in 1833 msecs (HTTP/1.1 500) 5 headers in 169 bytes (1 switches on core 0) ```
Author
Owner

@imbraintl commented on GitHub (Nov 10, 2022):

Hello, has anyone come up to a solution to this.

<!-- gh-comment-id:1309834556 --> @imbraintl commented on GitHub (Nov 10, 2022): Hello, has anyone come up to a solution to this.
Author
Owner

@tonioo commented on GitHub (Nov 10, 2022):

@fedi-will Sorry for the delay. Could you look at the Response tab (with DEBUG enabled) for the request which comes back with a 500 error?

<!-- gh-comment-id:1309933329 --> @tonioo commented on GitHub (Nov 10, 2022): @fedi-will Sorry for the delay. Could you look at the Response tab (with DEBUG enabled) for the request which comes back with a 500 error?
Author
Owner

@imbraintl commented on GitHub (Nov 10, 2022):

set debug to true, restarted uwsgi service, try to access /api/schema-v2/swagger/ in a browser

Resulting log from modoboa-instance.log is:

myipaddress [pid: 1438|app: 3|req: 17/146] 128.199.186.142 () {42 vars in 664 bytes} [Thu Nov 10 12:17:45 2022] GET /stalker_portal/c/version.js => generated 69877 bytes in 57 msecs (HTTP/1.1 400) 1 headers in 53 bytes (1 switches on core 0)
myipaddress [pid: 1437|app: 2|req: 17/147] 128.79.186.142 () {42 vars in 636 bytes} [Thu Nov 10 12:17:46 2022] GET /stream/live.php => generated 69725 bytes in 58 msecs (HTTP/1.1 400) 1 headers in 53 bytes (1 switches on core 0)
myipaddress [pid: 1438|app: 3|req: 18/148] 128.19.186.142 () {42 vars in 634 bytes} [Thu Nov 10 12:17:47 2022] GET /flu/403.html => generated 69697 bytes in 66 msecs (HTTP/1.1 400) 1 headers in 53 bytes (2 switches on core 0)
myipaddress [pid: 1437|app: 2|req: 18/149] 128.199.186.142 () {42 vars in 610 bytes} [Thu Nov 10 12:17:48 2022] GET / => generated 69553 bytes in 58 msecs (HTTP/1.1 400) 1 headers in 53 bytes (2 switches on core 0)
mail.mydomain.com [pid: 1438|app: 1|req: 57/150] 41.74.49.9 () {62 vars in 1769 bytes} [Thu Nov 10 12:17:59 2022] GET /core/top_notifications/check/ => generated 67 bytes in 402 msecs (HTTP/1.1 200) 5 headers in 153 bytes (1 switches on core 0)
Thu Nov 10 12:18:08 2022 - WSGI app 3 (mountpoint='myipaddress:443|') ready in 0 seconds on interpreter 0x5638e07d0390 pid: 1437
myipaddress:443 [pid: 1437|app: 3|req: 1/151] 103.103.204.110 () {46 vars in 718 bytes} [Thu Nov 10 12:18:08 2022] GET / => generated 69837 bytes in 57 msecs (HTTP/1.1 400) 1 headers in 53 bytes (2 switches on core 0)
mail.mydomain.com [pid: 1438|app: 1|req: 58/152] 41.74.49.9 () {62 vars in 1768 bytes} [Thu Nov 10 12:18:31 2022] GET /core/top_notifications/check/ => generated 67 bytes in 399 msecs (HTTP/1.1 200) 5 headers in 153 bytes (2 switches on core 0)
mail.mydomain.com [pid: 1437|app: 1|req: 57/153] 41.74.49.9 () {62 vars in 1769 bytes} [Thu Nov 10 12:19:04 2022] GET /core/top_notifications/check/ => generated 67 bytes in 407 msecs (HTTP/1.1 200) 5 headers in 153 bytes (1 switches on core 0)
mail.mydomain.com [pid: 1438|app: 1|req: 59/154] 41.74.49.9 () {62 vars in 1769 bytes} [Thu Nov 10 12:19:36 2022] GET /core/top_notifications/check/ => generated 67 bytes in 401 msecs (HTTP/1.1 200) 5 headers in 153 bytes (1 switches on core 0)
mail.mydomain.com [pid: 1437|app: 1|req: 58/155] 41.74.49.9 () {68 vars in 1925 bytes} [Thu Nov 10 12:20:08 2022] GET /api/schema-v2/swagger/ => generated 4254 bytes in 1337 msecs (HTTP/1.1 200) 7 headers in 366 bytes (1 switches on core 0)
mail.mydomain.com [pid: 1438|app: 1|req: 60/156] 41.74.49.9 () {62 vars in 1769 bytes} [Thu Nov 10 12:20:08 2022] GET /core/top_notifications/check/ => generated 67 bytes in 1311 msecs (HTTP/1.1 200) 5 headers in 153 bytes (1 switches on core 0)
Warning #0: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: AccessRuleViewSet: Failed to obtain model through view's queryset due to raised exception. Prevent this either by setting "queryset = Model.objects.none()" on the view, checking for "getattr(self, "swagger_fake_view", False)" in get_queryset() or by simply using @extend_schema. (Exception: User has no mailbox.)
Warning #1: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: AccessRuleViewSet: could not derive type of path parameter "id" because it is untyped and obtaining queryset from the viewset failed. Consider adding a type to the path (e.g. int:id) or annotating the parameter type with @extend_schema. Defaulting to "string".
Error #0: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: UserAccountViewSet: unable to guess serializer. This is graceful fallback handling for APIViews. Consider using GenericAPIView as view base class, if view is under your control. Ignoring view for now.
Warning #2: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: AccountViewSet: AccountSerializer: MailboxSerializer: Encountered 2 components with identical names "Mailbox" and different classes <class 'modoboa.admin.api.v1.serializers.MailboxSerializer'> and <class 'modoboa_radicale.serializers.MailboxSerializer'>. This will very likely result in an incorrect schema. Try renaming one.
Warning #3: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: AccountViewSet: AccountSerializer: Encountered 2 components with identical names "Account" and different classes <class 'modoboa.admin.api.v2.serializers.AccountSerializer'> and <class 'modoboa.admin.api.v1.serializers.AccountSerializer'>. This will very likely result in an incorrect schema. Try renaming one.
Warning #4: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: AccountViewSet: WritableAccountSerializer: MailboxSerializer: Encountered 2 components with identical names "Mailbox" and different classes <class 'modoboa.admin.api.v2.serializers.MailboxSerializer'> and <class 'modoboa_radicale.serializers.MailboxSerializer'>. This will very likely result in an incorrect schema. Try renaming one.
Warning #5: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: AccountViewSet: WritableAccountSerializer: Encountered 2 components with identical names "WritableAccount" and different classes <class 'modoboa.admin.api.v1.serializers.WritableAccountSerializer'> and <class 'modoboa.admin.api.v2.serializers.WritableAccountSerializer'>. This will very likely result in an incorrect schema. Try renaming one.
Warning #6: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: AddressBookViewSet: AddressBookSerializer: unable to resolve type hint for function "url". Consider using a type hint or @extend_schema_field. Defaulting to string.
Warning #7: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: AlarmViewSet: AlarmSerializer: NestedSerializer: Encountered 2 components with identical names "Nested" and different classes <class 'rest_framework.serializers.ModelSerializer.build_nested_field..NestedSerializer'> and <class 'rest_framework.serializers.ModelSerializer.build_nested_field..NestedSerializer'>. This will very likely result in an incorrect schema. Try renaming one.
Warning #8: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: AttendeeViewSet: could not derive type of path parameter "id" because it is untyped and obtaining queryset from the viewset failed. Consider adding a type to the path (e.g. int:id) or annotating the parameter type with @extend_schema. Defaulting to "string".
Warning #9: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: EmailAddressViewSet: EmailAddressWithNameSerializer: unable to resolve type hint for function "get_display_name". Consider using a type hint or @extend_schema_field. Defaulting to string.
Error #1: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: LanguageViewSet: unable to guess serializer. This is graceful fallback handling for APIViews. Consider using GenericAPIView as view base class, if view is under your control. Ignoring view for now.
Warning #10: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: MailboxViewSet: could not derive type of path parameter "id" because it is untyped and obtaining queryset from the viewset failed. Consider adding a type to the path (e.g. int:id) or annotating the parameter type with @extend_schema. Defaulting to "string".
Warning #11: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: RelayDomainViewSet: RelayDomainSerializer: TransportSerializer: Encountered 2 components with identical names "Transport" and different classes <class 'modoboa.relaydomains.api.v1.serializers.TransportSerializer'> and <class 'modoboa.transport.api.v2.serializers.TransportSerializer'>. This will very likely result in an incorrect schema. Try renaming one.
Warning #12: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: SharedCalendarViewSet: SharedCalendarSerializer: unable to resolve type hint for function "path". Consider using a type hint or @extend_schema_field. Defaulting to string.
Warning #13: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: SharedCalendarViewSet: SharedCalendarSerializer: DomainSerializer: Encountered 2 components with identical names "Domain" and different classes <class 'modoboa_radicale.serializers.DomainSerializer'> and <class 'modoboa.admin.api.v2.serializers.DomainSerializer'>. This will very likely result in an incorrect schema. Try renaming one.
Warning #14: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: SharedCalendarViewSet: SharedCalendarSerializer: unable to resolve type hint for function "full_url". Consider using a type hint or @extend_schema_field. Defaulting to string.
Warning #15: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: SharedCalendarViewSet: SharedCalendarSerializer: unable to resolve type hint for function "share_url". Consider using a type hint or @extend_schema_field. Defaulting to string.
Warning #16: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: could not derive type of path parameter "calendar_pk" because it is untyped and obtaining queryset from the viewset failed. Consider adding a type to the path (e.g. int:calendar_pk) or annotating the parameter type with @extend_schema. Defaulting to "string".
mail.mydomain.com [pid: 1437|app: 1|req: 59/157] 41.74.49.9 () {64 vars in 1744 bytes} [Thu Nov 10 12:20:12 2022] GET /api/schema-v2/ => generated 173399 bytes in 1863 msecs (HTTP/1.1 500) 5 headers in 169 bytes (1 switches on core 0)
Warning #0: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: AccessRuleViewSet: Failed to obtain model through view's queryset due to raised exception. Prevent this either by setting "queryset = Model.objects.none()" on the view, checking for "getattr(self, "swagger_fake_view", False)" in get_queryset() or by simply using @extend_schema. (Exception: User has no mailbox.)
Warning #1: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: AccessRuleViewSet: could not derive type of path parameter "id" because it is untyped and obtaining queryset from the viewset failed. Consider adding a type to the path (e.g. int:id) or annotating the parameter type with @extend_schema. Defaulting to "string".
Error #0: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: UserAccountViewSet: unable to guess serializer. This is graceful fallback handling for APIViews. Consider using GenericAPIView as view base class, if view is under your control. Ignoring view for now.
Warning #2: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: AccountViewSet: AccountSerializer: MailboxSerializer: Encountered 2 components with identical names "Mailbox" and different classes <class 'modoboa.admin.api.v1.serializers.MailboxSerializer'> and <class 'modoboa_radicale.serializers.MailboxSerializer'>. This will very likely result in an incorrect schema. Try renaming one.
Warning #3: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: AccountViewSet: AccountSerializer: Encountered 2 components with identical names "Account" and different classes <class 'modoboa.admin.api.v2.serializers.AccountSerializer'> and <class 'modoboa.admin.api.v1.serializers.AccountSerializer'>. This will very likely result in an incorrect schema. Try renaming one.
Warning #4: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: AccountViewSet: WritableAccountSerializer: MailboxSerializer: Encountered 2 components with identical names "Mailbox" and different classes <class 'modoboa.admin.api.v2.serializers.MailboxSerializer'> and <class 'modoboa_radicale.serializers.MailboxSerializer'>. This will very likely result in an incorrect schema. Try renaming one.
Warning #5: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: AccountViewSet: WritableAccountSerializer: Encountered 2 components with identical names "WritableAccount" and different classes <class 'modoboa.admin.api.v1.serializers.WritableAccountSerializer'> and <class 'modoboa.admin.api.v2.serializers.WritableAccountSerializer'>. This will very likely result in an incorrect schema. Try renaming one.
Warning #6: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: AddressBookViewSet: AddressBookSerializer: unable to resolve type hint for function "url". Consider using a type hint or @extend_schema_field. Defaulting to string.
Warning #7: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: AlarmViewSet: AlarmSerializer: NestedSerializer: Encountered 2 components with identical names "Nested" and different classes <class 'rest_framework.serializers.ModelSerializer.build_nested_field..NestedSerializer'> and <class 'rest_framework.serializers.ModelSerializer.build_nested_field..NestedSerializer'>. This will very likely result in an incorrect schema. Try renaming one.
Warning #8: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: AttendeeViewSet: could not derive type of path parameter "id" because it is untyped and obtaining queryset from the viewset failed. Consider adding a type to the path (e.g. int:id) or annotating the parameter type with @extend_schema. Defaulting to "string".
Warning #9: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: EmailAddressViewSet: EmailAddressWithNameSerializer: unable to resolve type hint for function "get_display_name". Consider using a type hint or @extend_schema_field. Defaulting to string.
Error #1: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: LanguageViewSet: unable to guess serializer. This is graceful fallback handling for APIViews. Consider using GenericAPIView as view base class, if view is under your control. Ignoring view for now.
Warning #10: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: MailboxViewSet: could not derive type of path parameter "id" because it is untyped and obtaining queryset from the viewset failed. Consider adding a type to the path (e.g. int:id) or annotating the parameter type with @extend_schema. Defaulting to "string".
Warning #11: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: RelayDomainViewSet: RelayDomainSerializer: TransportSerializer: Encountered 2 components with identical names "Transport" and different classes <class 'modoboa.relaydomains.api.v1.serializers.TransportSerializer'> and <class 'modoboa.transport.api.v2.serializers.TransportSerializer'>. This will very likely result in an incorrect schema. Try renaming one.
Warning #12: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: SharedCalendarViewSet: SharedCalendarSerializer: unable to resolve type hint for function "path". Consider using a type hint or @extend_schema_field. Defaulting to string.
Warning #13: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: SharedCalendarViewSet: SharedCalendarSerializer: DomainSerializer: Encountered 2 components with identical names "Domain" and different classes <class 'modoboa_radicale.serializers.DomainSerializer'> and <class 'modoboa.admin.api.v2.serializers.DomainSerializer'>. This will very likely result in an incorrect schema. Try renaming one.
Warning #14: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: SharedCalendarViewSet: SharedCalendarSerializer: unable to resolve type hint for function "full_url". Consider using a type hint or @extend_schema_field. Defaulting to string.
Warning #15: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: SharedCalendarViewSet: SharedCalendarSerializer: unable to resolve type hint for function "share_url". Consider using a type hint or @extend_schema_field. Defaulting to string.
Warning #16: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: could not derive type of path parameter "calendar_pk" because it is untyped and obtaining queryset from the viewset failed. Consider adding a type to the path (e.g. int:calendar_pk) or annotating the parameter type with @extend_schema. Defaulting to "string".
mail.mydomain.com [pid: 1438|app: 1|req: 61/158] 41.74.49.9 () {60 vars in 1691 bytes} [Thu Nov 10 12:20:19 2022] GET /api/schema-v2/ => generated 173134 bytes in 1854 msecs (HTTP/1.1 500) 5 headers in 169 bytes (1 switches on core 0)

<!-- gh-comment-id:1310069958 --> @imbraintl commented on GitHub (Nov 10, 2022): set debug to true, restarted uwsgi service, try to access /api/schema-v2/swagger/ in a browser Resulting log from modoboa-instance.log is: myipaddress [pid: 1438|app: 3|req: 17/146] 128.199.186.142 () {42 vars in 664 bytes} [Thu Nov 10 12:17:45 2022] GET /stalker_portal/c/version.js => generated 69877 bytes in 57 msecs (HTTP/1.1 400) 1 headers in 53 bytes (1 switches on core 0) myipaddress [pid: 1437|app: 2|req: 17/147] 128.79.186.142 () {42 vars in 636 bytes} [Thu Nov 10 12:17:46 2022] GET /stream/live.php => generated 69725 bytes in 58 msecs (HTTP/1.1 400) 1 headers in 53 bytes (1 switches on core 0) myipaddress [pid: 1438|app: 3|req: 18/148] 128.19.186.142 () {42 vars in 634 bytes} [Thu Nov 10 12:17:47 2022] GET /flu/403.html => generated 69697 bytes in 66 msecs (HTTP/1.1 400) 1 headers in 53 bytes (2 switches on core 0) myipaddress [pid: 1437|app: 2|req: 18/149] 128.199.186.142 () {42 vars in 610 bytes} [Thu Nov 10 12:17:48 2022] GET / => generated 69553 bytes in 58 msecs (HTTP/1.1 400) 1 headers in 53 bytes (2 switches on core 0) mail.mydomain.com [pid: 1438|app: 1|req: 57/150] 41.74.49.9 () {62 vars in 1769 bytes} [Thu Nov 10 12:17:59 2022] GET /core/top_notifications/check/ => generated 67 bytes in 402 msecs (HTTP/1.1 200) 5 headers in 153 bytes (1 switches on core 0) Thu Nov 10 12:18:08 2022 - WSGI app 3 (mountpoint='myipaddress:443|') ready in 0 seconds on interpreter 0x5638e07d0390 pid: 1437 myipaddress:443 [pid: 1437|app: 3|req: 1/151] 103.103.204.110 () {46 vars in 718 bytes} [Thu Nov 10 12:18:08 2022] GET / => generated 69837 bytes in 57 msecs (HTTP/1.1 400) 1 headers in 53 bytes (2 switches on core 0) mail.mydomain.com [pid: 1438|app: 1|req: 58/152] 41.74.49.9 () {62 vars in 1768 bytes} [Thu Nov 10 12:18:31 2022] GET /core/top_notifications/check/ => generated 67 bytes in 399 msecs (HTTP/1.1 200) 5 headers in 153 bytes (2 switches on core 0) mail.mydomain.com [pid: 1437|app: 1|req: 57/153] 41.74.49.9 () {62 vars in 1769 bytes} [Thu Nov 10 12:19:04 2022] GET /core/top_notifications/check/ => generated 67 bytes in 407 msecs (HTTP/1.1 200) 5 headers in 153 bytes (1 switches on core 0) mail.mydomain.com [pid: 1438|app: 1|req: 59/154] 41.74.49.9 () {62 vars in 1769 bytes} [Thu Nov 10 12:19:36 2022] GET /core/top_notifications/check/ => generated 67 bytes in 401 msecs (HTTP/1.1 200) 5 headers in 153 bytes (1 switches on core 0) mail.mydomain.com [pid: 1437|app: 1|req: 58/155] 41.74.49.9 () {68 vars in 1925 bytes} [Thu Nov 10 12:20:08 2022] GET /api/schema-v2/swagger/ => generated 4254 bytes in 1337 msecs (HTTP/1.1 200) 7 headers in 366 bytes (1 switches on core 0) mail.mydomain.com [pid: 1438|app: 1|req: 60/156] 41.74.49.9 () {62 vars in 1769 bytes} [Thu Nov 10 12:20:08 2022] GET /core/top_notifications/check/ => generated 67 bytes in 1311 msecs (HTTP/1.1 200) 5 headers in 153 bytes (1 switches on core 0) Warning #0: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: AccessRuleViewSet: Failed to obtain model through view's queryset due to raised exception. Prevent this either by setting "queryset = Model.objects.none()" on the view, checking for "getattr(self, "swagger_fake_view", False)" in get_queryset() or by simply using @extend_schema. (Exception: User has no mailbox.) Warning #1: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: AccessRuleViewSet: could not derive type of path parameter "id" because it is untyped and obtaining queryset from the viewset failed. Consider adding a type to the path (e.g. <int:id>) or annotating the parameter type with @extend_schema. Defaulting to "string". Error #0: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: UserAccountViewSet: unable to guess serializer. This is graceful fallback handling for APIViews. Consider using GenericAPIView as view base class, if view is under your control. Ignoring view for now. Warning #2: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: AccountViewSet: AccountSerializer: MailboxSerializer: Encountered 2 components with identical names "Mailbox" and different classes <class 'modoboa.admin.api.v1.serializers.MailboxSerializer'> and <class 'modoboa_radicale.serializers.MailboxSerializer'>. This will very likely result in an incorrect schema. Try renaming one. Warning #3: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: AccountViewSet: AccountSerializer: Encountered 2 components with identical names "Account" and different classes <class 'modoboa.admin.api.v2.serializers.AccountSerializer'> and <class 'modoboa.admin.api.v1.serializers.AccountSerializer'>. This will very likely result in an incorrect schema. Try renaming one. Warning #4: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: AccountViewSet: WritableAccountSerializer: MailboxSerializer: Encountered 2 components with identical names "Mailbox" and different classes <class 'modoboa.admin.api.v2.serializers.MailboxSerializer'> and <class 'modoboa_radicale.serializers.MailboxSerializer'>. This will very likely result in an incorrect schema. Try renaming one. Warning #5: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: AccountViewSet: WritableAccountSerializer: Encountered 2 components with identical names "WritableAccount" and different classes <class 'modoboa.admin.api.v1.serializers.WritableAccountSerializer'> and <class 'modoboa.admin.api.v2.serializers.WritableAccountSerializer'>. This will very likely result in an incorrect schema. Try renaming one. Warning #6: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: AddressBookViewSet: AddressBookSerializer: unable to resolve type hint for function "url". Consider using a type hint or @extend_schema_field. Defaulting to string. Warning #7: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: AlarmViewSet: AlarmSerializer: NestedSerializer: Encountered 2 components with identical names "Nested" and different classes <class 'rest_framework.serializers.ModelSerializer.build_nested_field.<locals>.NestedSerializer'> and <class 'rest_framework.serializers.ModelSerializer.build_nested_field.<locals>.NestedSerializer'>. This will very likely result in an incorrect schema. Try renaming one. Warning #8: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: AttendeeViewSet: could not derive type of path parameter "id" because it is untyped and obtaining queryset from the viewset failed. Consider adding a type to the path (e.g. <int:id>) or annotating the parameter type with @extend_schema. Defaulting to "string". Warning #9: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: EmailAddressViewSet: EmailAddressWithNameSerializer: unable to resolve type hint for function "get_display_name". Consider using a type hint or @extend_schema_field. Defaulting to string. Error #1: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: LanguageViewSet: unable to guess serializer. This is graceful fallback handling for APIViews. Consider using GenericAPIView as view base class, if view is under your control. Ignoring view for now. Warning #10: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: MailboxViewSet: could not derive type of path parameter "id" because it is untyped and obtaining queryset from the viewset failed. Consider adding a type to the path (e.g. <int:id>) or annotating the parameter type with @extend_schema. Defaulting to "string". Warning #11: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: RelayDomainViewSet: RelayDomainSerializer: TransportSerializer: Encountered 2 components with identical names "Transport" and different classes <class 'modoboa.relaydomains.api.v1.serializers.TransportSerializer'> and <class 'modoboa.transport.api.v2.serializers.TransportSerializer'>. This will very likely result in an incorrect schema. Try renaming one. Warning #12: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: SharedCalendarViewSet: SharedCalendarSerializer: unable to resolve type hint for function "path". Consider using a type hint or @extend_schema_field. Defaulting to string. Warning #13: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: SharedCalendarViewSet: SharedCalendarSerializer: DomainSerializer: Encountered 2 components with identical names "Domain" and different classes <class 'modoboa_radicale.serializers.DomainSerializer'> and <class 'modoboa.admin.api.v2.serializers.DomainSerializer'>. This will very likely result in an incorrect schema. Try renaming one. Warning #14: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: SharedCalendarViewSet: SharedCalendarSerializer: unable to resolve type hint for function "full_url". Consider using a type hint or @extend_schema_field. Defaulting to string. Warning #15: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: SharedCalendarViewSet: SharedCalendarSerializer: unable to resolve type hint for function "share_url". Consider using a type hint or @extend_schema_field. Defaulting to string. Warning #16: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: could not derive type of path parameter "calendar_pk" because it is untyped and obtaining queryset from the viewset failed. Consider adding a type to the path (e.g. <int:calendar_pk>) or annotating the parameter type with @extend_schema. Defaulting to "string". mail.mydomain.com [pid: 1437|app: 1|req: 59/157] 41.74.49.9 () {64 vars in 1744 bytes} [Thu Nov 10 12:20:12 2022] GET /api/schema-v2/ => generated 173399 bytes in 1863 msecs (HTTP/1.1 500) 5 headers in 169 bytes (1 switches on core 0) Warning #0: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: AccessRuleViewSet: Failed to obtain model through view's queryset due to raised exception. Prevent this either by setting "queryset = Model.objects.none()" on the view, checking for "getattr(self, "swagger_fake_view", False)" in get_queryset() or by simply using @extend_schema. (Exception: User has no mailbox.) Warning #1: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: AccessRuleViewSet: could not derive type of path parameter "id" because it is untyped and obtaining queryset from the viewset failed. Consider adding a type to the path (e.g. <int:id>) or annotating the parameter type with @extend_schema. Defaulting to "string". Error #0: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: UserAccountViewSet: unable to guess serializer. This is graceful fallback handling for APIViews. Consider using GenericAPIView as view base class, if view is under your control. Ignoring view for now. Warning #2: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: AccountViewSet: AccountSerializer: MailboxSerializer: Encountered 2 components with identical names "Mailbox" and different classes <class 'modoboa.admin.api.v1.serializers.MailboxSerializer'> and <class 'modoboa_radicale.serializers.MailboxSerializer'>. This will very likely result in an incorrect schema. Try renaming one. Warning #3: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: AccountViewSet: AccountSerializer: Encountered 2 components with identical names "Account" and different classes <class 'modoboa.admin.api.v2.serializers.AccountSerializer'> and <class 'modoboa.admin.api.v1.serializers.AccountSerializer'>. This will very likely result in an incorrect schema. Try renaming one. Warning #4: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: AccountViewSet: WritableAccountSerializer: MailboxSerializer: Encountered 2 components with identical names "Mailbox" and different classes <class 'modoboa.admin.api.v2.serializers.MailboxSerializer'> and <class 'modoboa_radicale.serializers.MailboxSerializer'>. This will very likely result in an incorrect schema. Try renaming one. Warning #5: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: AccountViewSet: WritableAccountSerializer: Encountered 2 components with identical names "WritableAccount" and different classes <class 'modoboa.admin.api.v1.serializers.WritableAccountSerializer'> and <class 'modoboa.admin.api.v2.serializers.WritableAccountSerializer'>. This will very likely result in an incorrect schema. Try renaming one. Warning #6: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: AddressBookViewSet: AddressBookSerializer: unable to resolve type hint for function "url". Consider using a type hint or @extend_schema_field. Defaulting to string. Warning #7: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: AlarmViewSet: AlarmSerializer: NestedSerializer: Encountered 2 components with identical names "Nested" and different classes <class 'rest_framework.serializers.ModelSerializer.build_nested_field.<locals>.NestedSerializer'> and <class 'rest_framework.serializers.ModelSerializer.build_nested_field.<locals>.NestedSerializer'>. This will very likely result in an incorrect schema. Try renaming one. Warning #8: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: AttendeeViewSet: could not derive type of path parameter "id" because it is untyped and obtaining queryset from the viewset failed. Consider adding a type to the path (e.g. <int:id>) or annotating the parameter type with @extend_schema. Defaulting to "string". Warning #9: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: EmailAddressViewSet: EmailAddressWithNameSerializer: unable to resolve type hint for function "get_display_name". Consider using a type hint or @extend_schema_field. Defaulting to string. Error #1: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: LanguageViewSet: unable to guess serializer. This is graceful fallback handling for APIViews. Consider using GenericAPIView as view base class, if view is under your control. Ignoring view for now. Warning #10: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: MailboxViewSet: could not derive type of path parameter "id" because it is untyped and obtaining queryset from the viewset failed. Consider adding a type to the path (e.g. <int:id>) or annotating the parameter type with @extend_schema. Defaulting to "string". Warning #11: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: RelayDomainViewSet: RelayDomainSerializer: TransportSerializer: Encountered 2 components with identical names "Transport" and different classes <class 'modoboa.relaydomains.api.v1.serializers.TransportSerializer'> and <class 'modoboa.transport.api.v2.serializers.TransportSerializer'>. This will very likely result in an incorrect schema. Try renaming one. Warning #12: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: SharedCalendarViewSet: SharedCalendarSerializer: unable to resolve type hint for function "path". Consider using a type hint or @extend_schema_field. Defaulting to string. Warning #13: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: SharedCalendarViewSet: SharedCalendarSerializer: DomainSerializer: Encountered 2 components with identical names "Domain" and different classes <class 'modoboa_radicale.serializers.DomainSerializer'> and <class 'modoboa.admin.api.v2.serializers.DomainSerializer'>. This will very likely result in an incorrect schema. Try renaming one. Warning #14: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: SharedCalendarViewSet: SharedCalendarSerializer: unable to resolve type hint for function "full_url". Consider using a type hint or @extend_schema_field. Defaulting to string. Warning #15: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: SharedCalendarViewSet: SharedCalendarSerializer: unable to resolve type hint for function "share_url". Consider using a type hint or @extend_schema_field. Defaulting to string. Warning #16: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: SharedEventViewSet: could not derive type of path parameter "calendar_pk" because it is untyped and obtaining queryset from the viewset failed. Consider adding a type to the path (e.g. <int:calendar_pk>) or annotating the parameter type with @extend_schema. Defaulting to "string". mail.mydomain.com [pid: 1438|app: 1|req: 61/158] 41.74.49.9 () {60 vars in 1691 bytes} [Thu Nov 10 12:20:19 2022] GET /api/schema-v2/ => generated 173134 bytes in 1854 msecs (HTTP/1.1 500) 5 headers in 169 bytes (1 switches on core 0)
Author
Owner

@tonioo commented on GitHub (Nov 10, 2022):

@imbraintl Yes but those messages are warnings, they should not prevent the page from being displayed. Can you check in a browser like in the screenshot above?

<!-- gh-comment-id:1310073256 --> @tonioo commented on GitHub (Nov 10, 2022): @imbraintl Yes but those messages are warnings, they should not prevent the page from being displayed. Can you check in a browser like in the screenshot above?
Author
Owner

@fedi-will commented on GitHub (Nov 10, 2022):

No, not all are warnings.
In all the posted log files these errors commonly occur:

Error #0: UserAccountViewSet: unable to guess serializer. This is graceful fallback handling for APIViews. Consider using GenericAPIView as view base class, if view is under your control. Ignoring view for now.

Error #1: LanguageViewSet: unable to guess serializer. This is graceful fallback handling for APIViews. Consider using GenericAPIView as view base class, if view is under your control. Ignoring view for now.

<!-- gh-comment-id:1310107036 --> @fedi-will commented on GitHub (Nov 10, 2022): No, not all are warnings. In all the posted log files these errors commonly occur: `Error #0: UserAccountViewSet: unable to guess serializer. This is graceful fallback handling for APIViews. Consider using GenericAPIView as view base class, if view is under your control. Ignoring view for now. ` `Error #1: LanguageViewSet: unable to guess serializer. This is graceful fallback handling for APIViews. Consider using GenericAPIView as view base class, if view is under your control. Ignoring view for now.`
Author
Owner

@imbraintl commented on GitHub (Nov 10, 2022):

@imbraintl Yes but those messages are warnings, they should not prevent the page from being displayed. Can you check in a browser like in the screenshot above?

Hey @tonioo , I am getting the same 500 error just as @fedi-will when i check the in the browser just like in the screenshot above?

<!-- gh-comment-id:1310164220 --> @imbraintl commented on GitHub (Nov 10, 2022): > @imbraintl Yes but those messages are warnings, they should not prevent the page from being displayed. Can you check in a browser like in the screenshot above? Hey @tonioo , I am getting the same 500 error just as @fedi-will when i check the in the browser just like in the screenshot above?
Author
Owner

@fedi-will commented on GitHub (Nov 10, 2022):

Could you look at the Response tab (with DEBUG enabled) for the request which comes back with a 500 error?

This is a very long error trace.
The picture shows the start of it. Let me know if you need the whole output.
modoboa-error1

<!-- gh-comment-id:1310167375 --> @fedi-will commented on GitHub (Nov 10, 2022): > Could you look at the Response tab (with DEBUG enabled) for the request which comes back with a 500 error? This is a very long error trace. The picture shows the start of it. Let me know if you need the whole output. ![modoboa-error1](https://user-images.githubusercontent.com/89528154/201083019-814b176c-9d9f-4359-b275-1d68bf18c1e6.png)
Author
Owner

@imbraintl commented on GitHub (Nov 10, 2022):

Could you look at the Response tab (with DEBUG enabled) for the request which comes back with a 500 error?

This is a very long error trace. The picture shows the start of it. Let me know if you need the whole output. modoboa-error1

I do get the same thing at my side

<!-- gh-comment-id:1310169072 --> @imbraintl commented on GitHub (Nov 10, 2022): > > Could you look at the Response tab (with DEBUG enabled) for the request which comes back with a 500 error? > > This is a very long error trace. The picture shows the start of it. Let me know if you need the whole output. ![modoboa-error1](https://user-images.githubusercontent.com/89528154/201083019-814b176c-9d9f-4359-b275-1d68bf18c1e6.png) I do get the same thing at my side
Author
Owner

@fedi-will commented on GitHub (Nov 10, 2022):

FYI: From my point of view the calendar app is working fine.
I can log in as a regular user and access the calendar, create a new calendar and create events.
No errors showing up in firefox console or network tab.

<!-- gh-comment-id:1310202466 --> @fedi-will commented on GitHub (Nov 10, 2022): FYI: From my point of view the calendar app is working fine. I can log in as a regular user and access the calendar, create a new calendar and create events. No errors showing up in firefox console or network tab.
Author
Owner

@tonioo commented on GitHub (Nov 14, 2022):

@imbraintl The whole output would be useful. What kind of users are you connected with when you try to access the API doc?

<!-- gh-comment-id:1314020598 --> @tonioo commented on GitHub (Nov 14, 2022): @imbraintl The whole output would be useful. What kind of users are you connected with when you try to access the API doc?
Author
Owner

@tonioo commented on GitHub (Nov 14, 2022):

@imbraintl And what's the version of the modoboa-radicale plugin you're using?

<!-- gh-comment-id:1314028149 --> @tonioo commented on GitHub (Nov 14, 2022): @imbraintl And what's the version of the modoboa-radicale plugin you're using?
Author
Owner

@imbraintl commented on GitHub (Nov 15, 2022):

are y

@tonioo I am logined as the admin, the default admin account

<!-- gh-comment-id:1314899766 --> @imbraintl commented on GitHub (Nov 15, 2022): > are y @tonioo I am logined as the admin, the default admin account
Author
Owner

@imbraintl commented on GitHub (Nov 15, 2022):

modoboa-radicale

Hey @tonioo i am using version 1.6.0
image

<!-- gh-comment-id:1314930432 --> @imbraintl commented on GitHub (Nov 15, 2022): > modoboa-radicale Hey @tonioo i am using version 1.6.0 ![image](https://user-images.githubusercontent.com/105174874/201862985-e60d0592-74f8-41f5-91b9-05cd6086d781.png)
Author
Owner

@kalungia commented on GitHub (Nov 27, 2022):

Hello, any update on this

<!-- gh-comment-id:1328341239 --> @kalungia commented on GitHub (Nov 27, 2022): Hello, any update on this
Author
Owner

@fedi-will commented on GitHub (Dec 7, 2022):

@kalungia @imbraintl @tonioo
I manually edited serializers.py and added changes from this commit.
Now it works

<!-- gh-comment-id:1340830982 --> @fedi-will commented on GitHub (Dec 7, 2022): @kalungia @imbraintl @tonioo I manually edited serializers.py and added changes from [this commit](https://github.com/modoboa/modoboa-radicale/commit/bbfdd4d38eb82273d51ae81a6cd71f4430afef29). Now it works
Author
Owner

@imbraintl commented on GitHub (Dec 8, 2022):

@kalungia @imbraintl @tonioo I manually edited serializers.py and added changes from this commit. Now it works

This works, Thank you

<!-- gh-comment-id:1343353899 --> @imbraintl commented on GitHub (Dec 8, 2022): > @kalungia @imbraintl @tonioo I manually edited serializers.py and added changes from [this commit](https://github.com/modoboa/modoboa-radicale/commit/bbfdd4d38eb82273d51ae81a6cd71f4430afef29). Now it works This works, Thank you
Author
Owner

@tonioo commented on GitHub (Jan 4, 2023):

We released a new version of the radicale plugin which should fix this issue.

<!-- gh-comment-id:1370593439 --> @tonioo commented on GitHub (Jan 4, 2023): We released a new version of the radicale plugin which should fix this issue.
Author
Owner

@tomas-kucera commented on GitHub (Jan 10, 2023):

I can also confirm that this fix does the trick with the swagger. 👍

I can also test the API from it and all works great ... BUT when I try to do the same for example using the curl statement it displays or using Postman app, then I always get 401 Unauthorized with this {"detail":"Authentication credentials were not provided."}. The documentation says nothing about it and I was unable to find a way to get around it.

BTW, the new modoboa-radicale 1.6.1 does not install properly due to some package dependencies (see my issue for it: modoboa/modoboa-radicale#100.

<!-- gh-comment-id:1377953040 --> @tomas-kucera commented on GitHub (Jan 10, 2023): I can also confirm that this fix does the trick with the swagger. 👍 I can also test the API from it and all works great ... BUT when I try to do the same for example using the curl statement it displays or using Postman app, then I always get `401 Unauthorized` with this `{"detail":"Authentication credentials were not provided."}`. The documentation says nothing about it and I was unable to find a way to get around it. BTW, the new modoboa-radicale 1.6.1 does not install properly due to some package dependencies (see my issue for it: modoboa/modoboa-radicale#100.
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#1627
No description provided.