rnwood/smtp4dev

Connecting.... Error: No Connection with that ID: Status code '404'

odombrovska opened this issue · 8 comments

We had smtp4dev running in a Docker container in our k8s cluster for like 6 months or so, no issues. For some reason now in the UI I see it erroring:

image
Screenshot 2024-04-29 182743

We had 3.1.4, so I decided to give it an update and bumped it to 3.4.0 thinking that will resolve it - no luck.

In the logs of the container itself I don't see anything suspicious:

smtp4dev version 3.4.0+6a02795ece04ee6d805a6c5c99e9848a2c23cd52
https://github.com/rnwood/smtp4dev
.NET Core runtime version: .NET 8.0.2

 > For help use argument --help

Install location: C:\
DataDir: smtp4dev
Default settings file: C:\app\appsettings.json
User settings file: smtp4dev\appsettings.json
Parsing AutomaticRelayExpression
Parsing CredentialsValidationExpression
Parsing RecipientValidationExpression
Parsing MessageValidationExpression
Using Sqlite database at C:\smtp4dev\database.db
Updating DB schema with migrations: 20181020095712_InitialCreate, 20181021072518_AddSessionToMessageReln, 20181021105259_AddSessionStartData, 20181022132948_AddSessionErrorInfo, 20181022163054_AddAttachmentCount, 20190310130227_AddMessageUnreadFlag, 20200904135503_AddRelayError, 20200924120747_AddImapState, 20210211134331_AddMessageSecurity, 20210731045851_UTCTimeMigration, 20210807032903_MessageRelay, 20210901140449_Fix_Messages_PK, 20240308081358_AddSessionEncoding, 20240309084542_AddMessageEightBitTransport, 20240425190525_AddMailboxes
Creating mailbox Default
TLS mode: None
SMTP Server is listening on port 25 (::).
Keeping last 50 messages per mailbox and 50 sessions.
IMAP Server is listening on port 143 (::)
Now listening on: http://[::]:80

I can see messages get received and processed in the logs. I don't see a single message in the UI though, it just throws the errors above, indicating that there's a connection problem of some sort.
I've no idea what it might want to function properly again. We didn't introduce anything networking-wise etc, so any suggestion would be appreciated! Thanks.

Hi, here you go, both /api/messages and the failing one:

Screenshot 2024-04-29 195050
Screenshot 2024-04-29 195206

There are no messages displayed in the UI, so that is a bit worrisome to me, cause before we were able to see them.

I don't see the messages when refreshing manually.

These are the only env variables I supply to the container:


        - name: ServerOptions__Hostname
          value: abc.xyz.net
        - name: ServerOptions__BasePath
          value: /smtp
        - name: ServerOptions__Port
          value: "25"
        - name: ServerOptions__NumberOfMessagesToKeep
          value: "50"
        - name: ServerOptions__NumberOfSessionsToKeep
          value: "50"

And here are ingress and service that expose the UI and make port 25 available for the server, just for reference:

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  annotations:
    appgw.ingress.kubernetes.io/appgw-ssl-certificate: wildcard-net
    appgw.ingress.kubernetes.io/backend-protocol: http
    appgw.ingress.kubernetes.io/request-timeout: "240"
    appgw.ingress.kubernetes.io/ssl-redirect: "true"
  name: smtp-ingress
spec:
  ingressClassName: azure-application-gateway
  rules:
  - host: abc.xyz.net
    http:
      paths:
      - backend:
          service:
            name: smtp-service
            port:
              number: 80
        path: /smtp
        pathType: Prefix
        
--- 

apiVersion: v1
kind: Service
metadata:
  name: smtp-service
spec:
  ports:
  - name: smtp
    port: 25
    protocol: TCP
    targetPort: 25
  - name: http
    port: 80
    protocol: TCP
    targetPort: 80
  selector:
    app: smtp

I can see a bunch of sessions in the 'Sessions' tab as well as some messages info, but the messages never appear in the 'Messages' tab itself:

Screenshot 2024-04-29 204801

This is the Windows container image I believe? (based on seeing c:\).

Is there just a single instance/replica of this container or are you running more than one?

Just a single replica, and yes, it's a Windows image

Closing stale issue.