Closed Bug 1779306 Opened 3 years ago Closed 3 years ago

Automatical `check for new messages every NN minutes` stops after network error until manual `Get messages` (POP)

Categories

(MailNews Core :: Networking: POP, defect, P2)

Thunderbird 102

Tracking

(thunderbird_esr102+ fixed, thunderbird104 wontfix)

RESOLVED FIXED
105 Branch
Tracking Status
thunderbird_esr102 + fixed
thunderbird104 --- wontfix

People

(Reporter: johnbast, Assigned: mkmelin)

References

(Blocks 1 open bug, )

Details

(Whiteboard: [STR in comment 7])

Attachments

(1 file)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Firefox/91.0

Steps to reproduce:

Update to Thunderbird from version 91. Start Thunderbird.

Current version: 102.0.2 (64-bit) Windows.
Multiple mail servers and accounts: pop3, STARTTLS, normal password.

DKIM Verifier 5.0.0 enabled.
https://addons.thunderbird.net/en-US/thunderbird/addon/dkim-verifier/

Actual results:

Initially messages are downloaded. Automatic downloading of messages is stopped when in the background Thunderbird performs a HTTP request, e.g. for https://location.services.mozilla.com/v1/country?key=

The way to restart this is to push the Get Messages button manually.

Reproducible by renaming web site visit urls from https:// to xhttps:// .

Expected results:

Automatic downloading of messages should not be stopped. Any fail or not finished web site (internal app) visit should not block getting new messages.

Summary: downloading messages stalls if a background HTTP request fails → downloading messages stalls if a background URL request fails
Severity: -- → S3
Component: Untriaged → Networking
Priority: -- → P3
Product: Thunderbird → MailNews Core
Summary: downloading messages stalls if a background URL request fails → Downloading messages stalls if a background URL request fails

Is there any issue without the add-on? Can you reproduce in Help | Troubleshoot mode?

Summary: Downloading messages stalls if a background URL request fails → Downloading messages stalls if a background URL request by dkim verifier fails

I would be surprised if this is related to the DKIM Verifier add-on, as it is not doing any HTTP requests. The only network requests initiated by the add-on are DNS queries if an e-mail is viewed.

(In reply to Magnus Melin [:mkmelin] from comment #1)

Is there any issue without the add-on? Can you reproduce in Help | Troubleshoot mode?

It still happens without the add-on active, but it may happen less often.

Because I have to wait for URL requests to happen in the background (and the arrival of new mails), it's not easy to reproduce.

I've set up troubleshooting mode without options now.

Summary: Downloading messages stalls if a background URL request by dkim verifier fails → downloading messages stalls if a background HTTP request fails
Blocks: tb102found

some changed about:config settings: (prefix 'x' to URL or path) were:
dom.push.serverURL
media.decoder-doctor.new-issue-endpoint
network.connectivity-service.IPv4.url
network.connectivity-service.IPv6.url
privacy.clearOnShutdown.cache
privacy.restrict3rdpartystorage.partitionedHosts
security.ssl.errorReporting.url

What was done:

  1. some more calling home features were disabled using about:config
  2. disabled TLS 1.0 in favor of plain text (private network only)
  • does not solve the problem although it might theoretically reduce the number of incidents.
  1. ran in normal mode and in troubleshoot mode, DKIM extension still turned off
  • does not solve the problem

It's weekend, the number of emails is lower and so is the number of incidents occuring.

Error console report

A.
Using the 'x' method of disabling urls, such as https://location.services.mozilla.com/v1/country?key= results in these error messages:

Region.jsm: Error fetching region TypeError: NetworkError when attempting to fetch resource. Region.jsm:417:11
_getRegion resource://gre/modules/Region.jsm:417

Region.jsm: Failed to fetch region Error: NO_RESULT
_getRegion resource://gre/modules/Region.jsm:419
Region.jsm:216:11
_fetchRegion resource://gre/modules/Region.jsm:216

This is as expected.

B. some incidental network events:
mailnews.pop3.245:
error { target: TCPSocket, isTrusted: true, name: "ConnectionRefusedError", message: "Network", errorCode: 2152398861, srcElement: TCPSocket, currentTarget: TCPSocket, eventPhase: 2, bubbles: false, cancelable: false, … }
ConnectionRefusedError Network 2152398861

mailnews.pop3.245: Failed to send because socket state is closed

Network error 2152398861 means NS_ERROR_CONNECTION_REFUSED.

2152398861 = 0x804B000D

This is an incidental error. This happens at a pop3 account which gets most emails per day.

This could be a possible cause of stopping any more pop3 requests. That should not happen because connection refused can be an intermittent problem for a wide range of reasons, e.g. firewalls losing track, lost tcp packets, overzealous anti-dos measures, etc.

Wanted behavior: an error like this should not block further configured/timed pop3 requests. And it should not interfere with other configured mail servers at other accounts.

Summary: downloading messages stalls if a background HTTP request fails → automatically downloading messages stops after connection refused once
See Also: → 1763491

After a long time testing, I think there seems to be a one-to-one correlation with these network problems. Scheduled pop3 get messages in "Account Settings/Server Settings" are halted when the error message appears until the user manually uses the "Get Messages" button. When the same network error reappears, the scheduled pop3 get messages (once a minute) is halted again, and so on.

Firewalls may interfere and send tcp rst or other packets.

I think a network problem such as this should not halt scheduled pop3 message retrievals.

The server side belongs to an ISP.

Thomas, can you try this?

Flags: needinfo?(bugzilla2007)

(In reply to Magnus Melin [:mkmelin] from comment #6)

Thomas, can you try this?

Confirming exactly as described.
After trying some more complicated test scenarios, here's something reduced:

STR

  1. Thunderbird with a POP account set to check for new messages every 1 minute
  2. Open Tools > Activity manager and keep monitoring items about checking messages
  3. Check activity manager for 2 minutes in normal operation (after starting TB)
  4. Disconnect your computer's internet connection (e.g. disable ethernet adapter: Windows > Control panel > ... > Network connections)
  5. Check activity manager for 2 minutes after disconnecting
  6. Re-connect your internet connection
  7. Check activity manager for 2 minutes after reconnecting

Actual result

  • Step 3: in normal operation, activity manager reports that POP gets checked every minute (OK)
  • Step 5: after disconnecting internet, POP can no longer get checked, so no further POP entries (kinda OK, but strangely no error message in activity manager as for IMAP). Thunderbird notices the disconnection and automatically indicates OFFLINE icon in status bar.
  • Step 7: after reconnecting internet, POP no longer gets checked as per activity manager - no updated items seen, but TB has noticed reconnection as status bar icon shows.
  • Haven't tested IMAP that much, but we seem to have similar problems there. Actually, it doesn't even seem to start the timer at all unless you select one of the IMAP folders.

Expected result

  • As TB notices the reconnection, it should immediately restart/reactivate POP (and IMAP) timers to get messages automatically at prescribed intervals.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: needinfo?(bugzilla2007)
Priority: P3 → P2
Summary: automatically downloading messages stops after connection refused once → Automatical `check for new messages every NN minutes` stops after network error until manual `Get messages` (POP; similar for IMAP)
Whiteboard: [STR in comment 7]
See Also: → 352107
See Also: → 1784149

Biff won't go off for busy servers.
Also improve the logging a bit.

Assignee: nobody → mkmelin+mozilla
Status: NEW → ASSIGNED
Target Milestone: --- → 105 Branch
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED

Magnus, can you share if your patch here improves the situation for POP3 and IMAP?

Flags: needinfo?(mkmelin+mozilla)
See Also: → 1785916

Just to add a little murkiness to the discussion...

Does this error happen only if it's a genuine network error? What about a laptop simply going to sleep? Or hibernating? In these cases, the network still seems to disconnect and reconnects on wakeup. TB is running and resumes too, but I don't know whether this is before or after reconnection.

We do have a laptop that sleeps several times a day. TB 102 also misbehaves -- to the point where we can't trust it to use GET MESSAGES because it eventually at random starts downloading duplicate messages. (Even manual selective fetches sometimes triggers dups for that account.)

I'm just wondering if THIS error is related to my issues -- see Bug 1778037.

FYI, running TB 102.1.2 (32-bit) on Windows 7 Pro, with Norton AV. All accounts are POP3. All accounts (except one) have Check New Mail Every nn Minutes UNchecked, and no accounts (except the one) are Included When Getting New Messages.

This is/was strictly a POP3 problem. If a similar problem exists for IMAP it would have a different reason and fix.

It would happen if a network error event occurred. Sleeping the laptop shouldn't trigger it but of course there's a good possibility a fetch was triggered during that shutdown/resume and the error would then take place.

Component: Networking → Networking: POP
Flags: needinfo?(mkmelin+mozilla)
Summary: Automatical `check for new messages every NN minutes` stops after network error until manual `Get messages` (POP; similar for IMAP) → Automatical `check for new messages every NN minutes` stops after network error until manual `Get messages` (POP)

(In reply to Dan Pernokis from comment #12)

Just to add a little murkiness to the discussion...

Does this error happen only if it's a genuine network error? What about a laptop simply going to sleep? Or hibernating? In these cases, the network still seems to disconnect and reconnects on wakeup. TB is running and resumes too, but I don't know whether this is before or after reconnection.

We do have a laptop that sleeps several times a day. TB 102 also misbehaves -- to the point where we can't trust it to use GET MESSAGES because it eventually at random starts downloading duplicate messages. (Even manual selective fetches sometimes triggers dups for that account.)

I'm just wondering if THIS error is related to my issues -- see Bug 1778037.

FYI, running TB 102.1.2 (32-bit) on Windows 7 Pro, with Norton AV. All accounts are POP3. All accounts (except one) have Check New Mail Every nn Minutes UNchecked, and no accounts (except the one) are Included When Getting New Messages.

I can confirm this happens to me on a laptop. When it goes to sleep POP/IMAP mailboxes refuse to follow automatic email check and download.
I'm on Win 10. TB 102.1.2 (64bit) this was not an issue until the last update to 102.1.2

Comment on attachment 9289842 [details]
Bug 1779306 - Clear server busy state after socket error. r=rnons

[Approval Request Comment]
Regression caused by (bug #): pop3-js
User impact if declined: on network error, automatic retrieval will stop
Testing completed (on c-c, etc.): c-c, soon 105beta
Risk to taking this patch (and alternatives if risky): very safe

Attachment #9289842 - Flags: approval-comm-esr102?
Blocks: 1786726

Comment on attachment 9289842 [details]
Bug 1779306 - Clear server busy state after socket error. r=rnons

[Triage Comment]
Approved for esr102

Attachment #9289842 - Flags: approval-comm-esr102? → approval-comm-esr102+

I am running TB 102.4.1, and I am still seeing this problem. Was it really fixed? When it happens, is there any diagnostic information that I can capture for diagnosis? Thanks.

It was. You can get a pop3 protocol log. See https://wiki.mozilla.org/MailNews:Logging - set mailnews.pop3.loglevel to "All". Any findings in a new bug please.

I have set that variable/parameter, and I will open a new bug upon the next occurrence. Thanks.

See Also: → 1798785
See Also: → 1850679
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: