[GH-ISSUE #107] [1.6.6] [db] SQL logic error: no such column: Sort (1) #71

Closed
opened 2026-03-15 12:23:36 +03:00 by kerem · 5 comments
Owner

Originally created by @PhilETaylor on GitHub (May 4, 2023).
Original GitHub issue: https://github.com/axllent/mailpit/issues/107

Just noticed this when running the docker container today

mysites-mailhog       | ERRO[2023/05/04 11:25:05] [db] SQL logic error: no such column: Sort (1)
mysites-mailhog       | ERRO[2023/05/04 11:26:05] [db] SQL logic error: no such column: Sort (1)
mysites-mailhog       | ERRO[2023/05/04 11:27:05] [db] SQL logic error: no such column: Sort (1)
mysites-mailhog       | ERRO[2023/05/04 11:28:05] [db] SQL logic error: no such column: Sort (1)
Originally created by @PhilETaylor on GitHub (May 4, 2023). Original GitHub issue: https://github.com/axllent/mailpit/issues/107 Just noticed this when running the docker container today ``` mysites-mailhog | ERRO[2023/05/04 11:25:05] [db] SQL logic error: no such column: Sort (1) mysites-mailhog | ERRO[2023/05/04 11:26:05] [db] SQL logic error: no such column: Sort (1) mysites-mailhog | ERRO[2023/05/04 11:27:05] [db] SQL logic error: no such column: Sort (1) mysites-mailhog | ERRO[2023/05/04 11:28:05] [db] SQL logic error: no such column: Sort (1) ```
kerem closed this issue 2026-03-15 12:23:41 +03:00
Author
Owner

@axllent commented on GitHub (May 4, 2023):

Hmmm, is it running with an existing database, or a temporary one? If existing, is it possible that more than one Mailpit instance is running using the same database, and that this error message is coming from an older version of Mailpit? The Sort column had been replaced and I'm fairly sure there should be no references to Sort in the code.

<!-- gh-comment-id:1534621004 --> @axllent commented on GitHub (May 4, 2023): Hmmm, is it running with an existing database, or a temporary one? If existing, is it possible that more than one Mailpit instance is running using the same database, and that this error message is coming from an older version of Mailpit? The Sort column had been replaced and I'm fairly sure there should be no references to Sort in the code.
Author
Owner

@PhilETaylor commented on GitHub (May 4, 2023):

sorry should have said this is running as a docker container - so totally new 1.6.6 container instantiated by docker-compose

  mailhog.mysites.guru:
    container_name: 'mysites-mailhog'
    image: axllent/mailpit
    ports:
      - "25:1025"
      - "1080:8025"
<!-- gh-comment-id:1534624941 --> @PhilETaylor commented on GitHub (May 4, 2023): sorry should have said this is running as a docker container - so totally new 1.6.6 container instantiated by docker-compose ``` mailhog.mysites.guru: container_name: 'mysites-mailhog' image: axllent/mailpit ports: - "25:1025" - "1080:8025" ```
Author
Owner

@amaurycid commented on GitHub (May 4, 2023):

Same happening to me using an existing database running locally (no docker).
I'm sure that I'm running one instance.

<!-- gh-comment-id:1534758938 --> @amaurycid commented on GitHub (May 4, 2023): Same happening to me using an existing database running locally (no docker). I'm sure that I'm running one instance.
Author
Owner

@PhilETaylor commented on GitHub (May 4, 2023):

I have completely removed the docker container, and started again from scratch using the documented standard way of running the container

docker run  -p 8025:8025 -p 1025:1025 axllent/mailpit

and I get output

INFO[2023/05/04 16:30:39] [smtpd] starting on 0.0.0.0:1025
INFO[2023/05/04 16:30:39] [http] starting server on http://0.0.0.0:8025/

and then after a short while I get the error

ERRO[2023/05/04 16:31:39] [db] SQL logic error: no such column: Sort (1)

I'm fairly sure there should be no references to Sort in the code.

I know nothing about the go programming language, but a quick search of your repo has a suspect Sort here:

github.com/axllent/mailpit@f2bce03e9e/storage/utils.go (L95)

<!-- gh-comment-id:1535051343 --> @PhilETaylor commented on GitHub (May 4, 2023): I have completely removed the docker container, and started again from scratch using the documented standard way of running the container ``` docker run -p 8025:8025 -p 1025:1025 axllent/mailpit ``` and I get output ``` INFO[2023/05/04 16:30:39] [smtpd] starting on 0.0.0.0:1025 INFO[2023/05/04 16:30:39] [http] starting server on http://0.0.0.0:8025/ ``` and then after a short while I get the error ``` ERRO[2023/05/04 16:31:39] [db] SQL logic error: no such column: Sort (1) ``` > I'm fairly sure there should be no references to Sort in the code. I know nothing about the `go` programming language, but a quick search of your repo has a suspect `Sort` here: https://github.com/axllent/mailpit/blob/f2bce03e9e57a32b7aa83c815e540fe2d112075a/storage/utils.go#L95
Author
Owner

@axllent commented on GitHub (May 4, 2023):

You're absolutely correct. Fortunately this didn't break anything, it just did not auto-delete any messages (if greater than the current maximum setting) due to the error. I have fixed this now in v1.6.7. Thanks for the report!

<!-- gh-comment-id:1535283588 --> @axllent commented on GitHub (May 4, 2023): You're absolutely correct. Fortunately this didn't break anything, it just did not auto-delete any messages (if greater than the current maximum setting) due to the error. I have fixed this now in v1.6.7. Thanks for the report!
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/mailpit#71
No description provided.