mirror of
https://github.com/cypht-org/cypht.git
synced 2026-04-25 21:15:56 +03:00
[GH-ISSUE #1119] FastCGI timeout (Not docker related) #577
Labels
No labels
2fa
I18N
PGP
Security
Security
account
advanced_search
advanced_search
announcement
api_login
authentication
awaiting feedback
blocker
bug
bug
bug
calendar
config
contacts
core
core
devops
docker
docs
duplicate
dynamic_login
enhancement
epic
feature
feeds
framework
github
github
gmail_contacts
good first issue
help wanted
history
history
imap
imap_folders
inline_message
installation
keyboard_shortcuts
keyboard_shortcuts
ldap_contacts
mobile
need-ssh-access
new module set
nux
pop3
profiles
pull-request
question
refactor
release
research
saved_searches
smtp
strategic
tags
tests
themes
website
wordpress
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/cypht#577
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @indridieinarsson on GitHub (Jul 15, 2024).
Original GitHub issue: https://github.com/cypht-org/cypht/issues/1119
Originally assigned to: @kambereBr, @josaphatim on GitHub.
🐛 Bugreport
I am running cypht using docker compose. Building the docker image from source locally.
Previous version ran without the issue described here (master branch ca. month ago). After updating to the most recent master branch, the issue began.
Cypht comes up as regular, and is usable (there are some issues regarding the Everything folder not displaying all accounts, but that was unchanged between versions).
After some usage, usually just a few minutes, cypth becomes unreachable, with the browser displaying just: "504 Gateway Time-out
nginx/1.26.1". Sometimes, browser says "404 page not found".
In the docker logs, I get the following:
After the "PHP Fatal error" is displayed, cypht becomes reachable again.
Once I'm in again, I notice, that the email I was reading once it became unresponsive (mail from a gmail account) is still marked as unread in the mail listing. Otherwise, marking unread mails as read once I have opened them works as expected.
Version & Environment
git commit :
5e88e14634OS : docker image, running on x64 host which is running debian.
@indridieinarsson commented on GitHub (Jul 15, 2024):
Somewhere on the internet, adding the following lines to the nginx.conf was suggested as a solution to a similar problem:
I tried that, but it did not solve anything. It seems, however, to prolong the waiting for the "PHP Fatal error".
@marclaporte commented on GitHub (Jul 16, 2024):
@indridieinarsson Thank you for your report.
FYI, we did a major change to Cypht Docker:
In summary, https://hub.docker.com/u/cypht replaced https://hub.docker.com/r/sailfrog/cypht-docker
Details: https://github.com/cypht-org/cypht-docker/issues/31
In doing so, many things changed. For example:
https://github.com/search?q=repo%3Acypht-org%2Fcypht+docker&type=pullrequests&s=created&o=desc
@jonocodes @Yannick243 @Shadow243 any ideas?
@indridieinarsson commented on GitHub (Jul 16, 2024):
@marclaporte thanks for the tip.
I only briefly tried the old (sailfrog) docker image. When I upgraded to the new docker image, I started fresh and set up everything anew (the setup is quite different from the old one).
The upgrade, at which this issue started, was when upgrading from the already new setup, compiled from master 2-3 weeks ago, and to master from a couple of days ago, so it was already working with the new docker setup.
@indridieinarsson commented on GitHub (Jul 18, 2024):
So, the timeout seems to be happening in
hm-imap-base.php, which saw some changes in a series of commits recently (July 9.).I tried reverting to the commit before that (commit
1a62fb449a), and now the issue seems to be gone (running using the exact same config as before, just pulled, re-built the docker image and started).So the primary cause is probably not in docker or nginx.
@marclaporte commented on GitHub (Jul 18, 2024):
@josaphatim Can you take a look? That commit is from https://github.com/cypht-org/cypht/pull/1107
@indridieinarsson Thank you for this investigation. It is very helpful.
Thanks!
@indridieinarsson commented on GitHub (Jul 19, 2024):
So, did some bisection:
In commit
1a62fb449athis is not reproducible.In commit
c08cac8a18this is reproducible.@marclaporte commented on GitHub (Jul 19, 2024):
Well done @indridieinarsson !
So then, we need @kambereBr instead of @josaphatim to review https://github.com/cypht-org/cypht/pull/1051
@josaphatim commented on GitHub (Jul 19, 2024):
Sorry I forgot to give my feedback yesterday. There are 3 commits that affected the file mentioned in the previous comment. I suspected only one
github.com/cypht-org/cypht@c08cac8a18as my commit didn't changed anything and Victor's commit came after @indridieinarsson addressed this issue. But I wasn't able to reproduce @indridieinarsson issue as on my side everything is working as expected.@indridieinarsson commented on GitHub (Jul 21, 2024):
@josaphatim : I'm not really familiar with php, so not really useful for any coding. But perhaps it would be possible to add some debug-logging statements around where this is happening (log says "imap/hm-imap-base.php on line 80"), just to find out more. I have 3 different accounts, and most of my mails contain some "funny symbols", as my native language (Icelandic) has some special symbols - perhaps that's relevant, since this seems to be about multibyte strings.
@marclaporte commented on GitHub (Aug 1, 2024):
@indridieinarsson Please pop by our chat room at https://gitter.im/cypht-org/community and find @kambereBr or @josaphatim to organize a screenshare.
@marclaporte commented on GitHub (Aug 20, 2024):
@indridieinarsson
We can't reproduce issue. Can you please try https://github.com/cypht-org/cypht/releases/tag/v2.2.0 ?
@indridieinarsson commented on GitHub (Aug 20, 2024):
I'll do that. And sorry for ghosting your previous reply, was on vacation and not reading messages.
@indridieinarsson commented on GitHub (Aug 20, 2024):
@marclaporte : this issue is still present on tag v2.2.0
I nuked the data and set it up using an imap server as authenticating agent as before, but this time a different imap server.
I also did not add my gmail account in there, only two accounts on two separate, independent mail servers (one of them run by me, on the same machine as the cypht instance).
And I still get stuff like below in the log, and the cypht web page becomes unresponsive.
When I think about it, it might be relevant, that I'm running this in a docker container, behind a traefik reverse proxy...
@indridieinarsson commented on GitHub (Aug 23, 2024):
I've been poking around a bit. A bit difficult to pinpoint. Going from tag 2.2.0, I replaced hm-imap-base.php with the version from commit
1a62fb449. In that constellation, the timeout is not reproducible.According to this SO post , mb_strlen is significantly slower than strlen - is it possible this is causing my issue?
@indridieinarsson commented on GitHub (Aug 23, 2024):
digging more, this part in read_literal from hm-imap-base.php is interesting (with some additional logging statement from me).
Every now and then,
strlenandmb_strlenare different, which in turn affects$lit_size. This is due to the fact, that strlen returns the number of bytes in the string, while mb_strlen returns the number of characters (the length of the actual string). For single-byte strings, this is obviously equal, but for strings with some multi-byte characters, it is not. As for myself, I come from Iceland, and we have a lot of "funny characters" (like ðÐþÞæÆöÖáÁ etc) in our language, which take more than one byte, so my mailbox is full of this stuff.On the other hand,
$sizeoriginates from this line :which is just a substring, and should be the same regards of mb or not.
So, the stop condition is hit earlier in case of
mb_strlenthan with thestrlenvariant.Anyone around wise enough to know what number it is that being drawn out as substring. Is it number of characters, or number of bytes?
@marclaporte commented on GitHub (Sep 6, 2024):
Thank you @indridieinarsson for your persistence on this.
@marclaporte commented on GitHub (Sep 9, 2024):
@indridieinarsson expects this to be solved by https://github.com/cypht-org/cypht/pull/1230#issuecomment-2338111218
So closing, and we'll reopen if the issue persists.