gristlabs/grist-core

Loading external image attachment thumbnail fails

Opened this issue · 3 comments

Describe the current behavior

Hello,

I use the self-hosted Grist, using external image attachments to Minio. When I open the page for the first time, some of the thumbnails do not have a preview, showing this:

Image

Steps to reproduce

Some unloaded thumbnails can be opened correctly by clicking on them, but others are not loading at all. If I reload the page, more thumbnails load each time. After repeating the process several times, all the thumbnails are loading correctly. Ultimately, when all thumbnails are displayed, everything opens correctly.

Describe the expected behavior

No response

Where have you encountered this bug?

Instance information (when self-hosting only)

  • Grist instance:
    • Version: 1.5.0

    • Installation mode: docker

    • Minio:RELEASE.2025-03-12T18-04-18Z

Thanks for reporting @georgetsagko. Hmm you're confident in your MinIO setup? No tight connection limit set? Anything suspicious in the logs either of MinIO or Grist? Sounds like the images are present in the bucket, but there's some issue serving them. Is there any kind of reverse proxy involved that could have its own limits?

@Spoffy any thoughts on debugging this?

Thank you, @paulfitz, for your reply.

The Grist log has no errors and show all the calls for the files (debug). The images that are loading are shown at the (info) inside the log. The thumbnails that are not loading are missing from the info log.

2025-04-02 17:26:00.071 - debug: AttachmentFileManager fetching attachment from external storage docName=pNzRdT7DA1xYwYiCazPhXw, docPoolId=pNzRdT7DA1xYwYiCazPhXw, fileIdent=37c2a92c662cd92222050adf93ea9a1c957fee06.jpg, storeId=2371dCvawdoVmfJ7dTYFAm-snapshots

2025-04-02 17:26:00.078 - info: ActiveDoc getAttachment: 37c2a92c662cd92222050adf93ea9a1c957fee06.jpg -> 1317072 bytes access=viewers, userId=1, email=anon@getgrist.com, org=tsagko, altSessionId=2eNfYVNZqmvM6J3CEnxK9u, clientId=f6e7ed83e8068e82, counter=2, docId=pNzRdT7DA1xYwYiCazPhXw

2025-04-02 17:26:00.086 - debug: AttachmentFileManager fetching attachment from external storage docName=pNzRdT7DA1xYwYiCazPhXw, docPoolId=pNzRdT7DA1xYwYiCazPhXw, fileIdent=5268c90611664d44c07b7abdb69297ca991e14cc.jpg, storeId=2371dCvawdoVmfJ7dTYFAm-snapshots

2025-04-02 17:26:00.088 - debug: AttachmentFileManager fetching attachment from external storage docName=pNzRdT7DA1xYwYiCazPhXw, docPoolId=pNzRdT7DA1xYwYiCazPhXw, fileIdent=831b2bea70ba67af312867464ab8e283cee483da.jpg, storeId=2371dCvawdoVmfJ7dTYFAm-snapshots

2025-04-02 17:26:00.090 - debug: AttachmentFileManager fetching attachment from external storage docName=pNzRdT7DA1xYwYiCazPhXw, docPoolId=pNzRdT7DA1xYwYiCazPhXw, fileIdent=e340204ca7966001c90fec76c67b4aaad6906654.jpg, storeId=2371dCvawdoVmfJ7dTYFAm-snapshots

2025-04-02 17:26:00.095 - debug: AttachmentFileManager fetching attachment from external storage docName=pNzRdT7DA1xYwYiCazPhXw, docPoolId=pNzRdT7DA1xYwYiCazPhXw, fileIdent=b1a6fd7bbd212424613bfeb455515592def97d98.jpg, storeId=2371dCvawdoVmfJ7dTYFAm-snapshots

2025-04-02 17:26:00.098 - info: ActiveDoc getAttachment: 5268c90611664d44c07b7abdb69297ca991e14cc.jpg -> 1357717 bytes access=viewers, userId=1, email=anon@getgrist.com, org=tsagko, altSessionId=2eNfYVNZqmvM6J3CEnxK9u, clientId=f6e7ed83e8068e82, counter=2, docId=pNzRdT7DA1xYwYiCazPhXw

2025-04-02 17:26:00.103 - debug: AttachmentFileManager fetching attachment from external storage docName=pNzRdT7DA1xYwYiCazPhXw, docPoolId=pNzRdT7DA1xYwYiCazPhXw, fileIdent=f021bd7a192203a82556ebd6cc839c8cb87b3dc9.jpg, storeId=2371dCvawdoVmfJ7dTYFAm-snapshots

2025-04-02 17:26:00.109 - info: ActiveDoc getAttachment: 831b2bea70ba67af312867464ab8e283cee483da.jpg -> 1567572 bytes access=viewers, userId=1, email=anon@getgrist.com, org=tsagko, altSessionId=2eNfYVNZqmvM6J3CEnxK9u, clientId=f6e7ed83e8068e82, counter=2, docId=pNzRdT7DA1xYwYiCazPhXw

2025-04-02 17:26:00.113 - info: ActiveDoc getAttachment: f021bd7a192203a82556ebd6cc839c8cb87b3dc9.jpg -> 1020650 bytes access=viewers, userId=1, email=anon@getgrist.com, org=tsagko, altSessionId=2eNfYVNZqmvM6J3CEnxK9u, clientId=f6e7ed83e8068e82, counter=2, docId=pNzRdT7DA1xYwYiCazPhXw

2025-04-02 17:26:00.115 - debug: AttachmentFileManager fetching attachment from external storage docName=pNzRdT7DA1xYwYiCazPhXw, docPoolId=pNzRdT7DA1xYwYiCazPhXw, fileIdent=ae08e8bacc10c2b29ce1665b2ace77e6d18bdb03.jpg, storeId=2371dCvawdoVmfJ7dTYFAm-snapshots

2025-04-02 17:26:00.118 - debug: AttachmentFileManager fetching attachment from external storage docName=pNzRdT7DA1xYwYiCazPhXw, docPoolId=pNzRdT7DA1xYwYiCazPhXw, fileIdent=dcaa9ad0bfbf4e86526f6d91fe266700286d4791.jpg, storeId=2371dCvawdoVmfJ7dTYFAm-snapshots

2025-04-02 17:26:00.120 - debug: AttachmentFileManager fetching attachment from external storage docName=pNzRdT7DA1xYwYiCazPhXw, docPoolId=pNzRdT7DA1xYwYiCazPhXw, fileIdent=2ae294af329b836b5ccf203cb44bfe6fe4f7b046.jpg, storeId=2371dCvawdoVmfJ7dTYFAm-snapshots

2025-04-02 17:26:00.122 - info: ActiveDoc getAttachment: ae08e8bacc10c2b29ce1665b2ace77e6d18bdb03.jpg -> 1682516 bytes access=viewers, userId=1, email=anon@getgrist.com, org=tsagko, altSessionId=2eNfYVNZqmvM6J3CEnxK9u, clientId=f6e7ed83e8068e82, counter=2, docId=pNzRdT7DA1xYwYiCazPhXw

2025-04-02 17:26:00.128 - info: ActiveDoc getAttachment: 2ae294af329b836b5ccf203cb44bfe6fe4f7b046.jpg -> 907897 bytes access=viewers, userId=1, email=anon@getgrist.com, org=tsagko, altSessionId=2eNfYVNZqmvM6J3CEnxK9u, clientId=f6e7ed83e8068e82, counter=2, docId=pNzRdT7DA1xYwYiCazPhXw

2025-04-02 17:26:00.131 - debug: AttachmentFileManager fetching attachment from external storage docName=pNzRdT7DA1xYwYiCazPhXw, docPoolId=pNzRdT7DA1xYwYiCazPhXw, fileIdent=b38dcaed3f64f2a9782f356833d1cfaf7dd6f8c1.jpg, storeId=2371dCvawdoVmfJ7dTYFAm-snapshots

2025-04-02 17:26:00.135 - debug: AttachmentFileManager fetching attachment from external storage docName=pNzRdT7DA1xYwYiCazPhXw, docPoolId=pNzRdT7DA1xYwYiCazPhXw, fileIdent=13de697fd5f130f91333ea51a04ceeaa9ca044e0.jpg, storeId=2371dCvawdoVmfJ7dTYFAm-snapshots

2025-04-02 17:26:00.136 - info: ActiveDoc getAttachment: b38dcaed3f64f2a9782f356833d1cfaf7dd6f8c1.jpg -> 1443647 bytes access=viewers, userId=1, email=anon@getgrist.com, org=tsagko, altSessionId=2eNfYVNZqmvM6J3CEnxK9u, clientId=f6e7ed83e8068e82, counter=2, docId=pNzRdT7DA1xYwYiCazPhXw

2025-04-02 17:26:00.140 - debug: AttachmentFileManager fetching attachment from external storage docName=pNzRdT7DA1xYwYiCazPhXw, docPoolId=pNzRdT7DA1xYwYiCazPhXw, fileIdent=7435b64707c27fc539abda4eb4f10c0d92268b35.jpg, storeId=2371dCvawdoVmfJ7dTYFAm-snapshots

2025-04-02 17:26:00.141 - debug: AttachmentFileManager fetching attachment from external storage docName=pNzRdT7DA1xYwYiCazPhXw, docPoolId=pNzRdT7DA1xYwYiCazPhXw, fileIdent=1a8c755fa909d1b3bbcd3910348098cde2254086.jpg, storeId=2371dCvawdoVmfJ7dTYFAm-snapshots

2025-04-02 17:26:00.143 - debug: AttachmentFileManager fetching attachment from external storage docName=pNzRdT7DA1xYwYiCazPhXw, docPoolId=pNzRdT7DA1xYwYiCazPhXw, fileIdent=66a07ffd8a09e626b8689ac7625246931f0df4c1.jpg, storeId=2371dCvawdoVmfJ7dTYFAm-snapshots

2025-04-02 17:26:00.146 - debug: AttachmentFileManager fetching attachment from external storage docName=pNzRdT7DA1xYwYiCazPhXw, docPoolId=pNzRdT7DA1xYwYiCazPhXw, fileIdent=c912a2651f86c3dffc605513b3e4d707fb0f966d.jpg, storeId=2371dCvawdoVmfJ7dTYFAm-snapshots

2025-04-02 17:26:00.148 - debug: AttachmentFileManager fetching attachment from external storage docName=pNzRdT7DA1xYwYiCazPhXw, docPoolId=pNzRdT7DA1xYwYiCazPhXw, fileIdent=a18799053f876b70aa16ba6b642bebfc768406d3.jpg, storeId=2371dCvawdoVmfJ7dTYFAm-snapshots

2025-04-02 17:26:00.150 - info: ActiveDoc getAttachment: 1a8c755fa909d1b3bbcd3910348098cde2254086.jpg -> 1308928 bytes access=viewers, userId=1, email=anon@getgrist.com, org=tsagko, altSessionId=2eNfYVNZqmvM6J3CEnxK9u, clientId=f6e7ed83e8068e82, counter=2, docId=pNzRdT7DA1xYwYiCazPhXw

2025-04-02 17:26:00.156 - info: ActiveDoc getAttachment: c912a2651f86c3dffc605513b3e4d707fb0f966d.jpg -> 1415462 bytes access=viewers, userId=1, email=anon@getgrist.com, org=tsagko, altSessionId=2eNfYVNZqmvM6J3CEnxK9u, clientId=f6e7ed83e8068e82, counter=2, docId=pNzRdT7DA1xYwYiCazPhXw

2025-04-02 17:26:00.159 - debug: AttachmentFileManager fetching attachment from external storage docName=pNzRdT7DA1xYwYiCazPhXw, docPoolId=pNzRdT7DA1xYwYiCazPhXw, fileIdent=0276fa067de9cc4c503104f3196f68f3d634d2ff.jpg, storeId=2371dCvawdoVmfJ7dTYFAm-snapshots

2025-04-02 17:26:00.162 - debug: AttachmentFileManager fetching attachment from external storage docName=pNzRdT7DA1xYwYiCazPhXw, docPoolId=pNzRdT7DA1xYwYiCazPhXw, fileIdent=e39e1d8a3855afd9ac18679eddd4ea595e1cc857.jpg, storeId=2371dCvawdoVmfJ7dTYFAm-snapshots

2025-04-02 17:26:00.166 - info: ActiveDoc getAttachment: 0276fa067de9cc4c503104f3196f68f3d634d2ff.jpg -> 1660416 bytes access=viewers, userId=1, email=anon@getgrist.com, org=tsagko, altSessionId=2eNfYVNZqmvM6J3CEnxK9u, clientId=f6e7ed83e8068e82, counter=2, docId=pNzRdT7DA1xYwYiCazPhXw

2025-04-02 17:26:00.169 - debug: AttachmentFileManager fetching attachment from external storage docName=pNzRdT7DA1xYwYiCazPhXw, docPoolId=pNzRdT7DA1xYwYiCazPhXw, fileIdent=b167467826a65b3ef9d98ba50606dc37f2ef57b0.jpg, storeId=2371dCvawdoVmfJ7dTYFAm-snapshots

2025-04-02 17:26:00.182 - debug: AttachmentFileManager fetching attachment from external storage docName=pNzRdT7DA1xYwYiCazPhXw, docPoolId=pNzRdT7DA1xYwYiCazPhXw, fileIdent=3a86a0f28f4db756cc630e1f84e5cada507a1400.jpg, storeId=2371dCvawdoVmfJ7dTYFAm-snapshots

2025-04-02 17:26:00.186 - info: ActiveDoc getAttachment: b167467826a65b3ef9d98ba50606dc37f2ef57b0.jpg -> 1592690 bytes access=viewers, userId=1, email=anon@getgrist.com, org=tsagko, altSessionId=2eNfYVNZqmvM6J3CEnxK9u, clientId=f6e7ed83e8068e82, counter=2, docId=pNzRdT7DA1xYwYiCazPhXw

The minio log shows only the loaded images

2025-04-02T17:24:49.891 [200 OK] s3.GetObject minio:9000/grist-docs/docs/attachments/pNzRdT7DA1xYwYiCazPhXw/5268c90611664d44c07b7abdb69297ca991e14cc.jpg 172.18.0.6       4.985ms      ⇣  2.330079ms  ↑ 88 B ↓ 1.3 MiB
2025-04-02T17:24:49.892 [200 OK] s3.GetObject minio:9000/grist-docs/docs/attachments/pNzRdT7DA1xYwYiCazPhXw/e8d82d5de2a180a762715a84f6c69777d237bb8f.jpg 172.18.0.6       9.775ms      ⇣  2.695846ms  ↑ 88 B ↓ 1.3 MiB
2025-04-02T17:26:00.073 [200 OK] s3.GetObject minio:9000/grist-docs/docs/attachments/pNzRdT7DA1xYwYiCazPhXw/37c2a92c662cd92222050adf93ea9a1c957fee06.jpg 172.18.0.6       3.342ms      ⇣  1.494265ms  ↑ 88 B ↓ 1.3 MiB
2025-04-02T17:26:00.088 [200 OK] s3.GetObject minio:9000/grist-docs/docs/attachments/pNzRdT7DA1xYwYiCazPhXw/5268c90611664d44c07b7abdb69297ca991e14cc.jpg 172.18.0.6       8.505ms      ⇣  1.81931ms  ↑ 88 B ↓ 1.3 MiB
2025-04-02T17:26:00.093 [200 OK] s3.GetObject minio:9000/grist-docs/docs/attachments/pNzRdT7DA1xYwYiCazPhXw/831b2bea70ba67af312867464ab8e283cee483da.jpg 172.18.0.6       14.747ms     ⇣  3.232455ms  ↑ 88 B ↓ 1.5 MiB
2025-04-02T17:26:00.105 [200 OK] s3.GetObject minio:9000/grist-docs/docs/attachments/pNzRdT7DA1xYwYiCazPhXw/f021bd7a192203a82556ebd6cc839c8cb87b3dc9.jpg 172.18.0.6       7.692ms      ⇣  1.274741ms  ↑ 88 B ↓ 997 KiB
2025-04-02T17:26:00.117 [200 OK] s3.GetObject minio:9000/grist-docs/docs/attachments/pNzRdT7DA1xYwYiCazPhXw/ae08e8bacc10c2b29ce1665b2ace77e6d18bdb03.jpg 172.18.0.6       3.856ms      ⇣  1.396904ms  ↑ 88 B ↓ 1.6 MiB
2025-04-02T17:26:00.121 [200 OK] s3.GetObject minio:9000/grist-docs/docs/attachments/pNzRdT7DA1xYwYiCazPhXw/2ae294af329b836b5ccf203cb44bfe6fe4f7b046.jpg 172.18.0.6       1.905ms      ⇣  1.505586ms  ↑ 88 B ↓ 887 KiB
2025-04-02T17:26:00.132 [200 OK] s3.GetObject minio:9000/grist-docs/docs/attachments/pNzRdT7DA1xYwYiCazPhXw/b38dcaed3f64f2a9782f356833d1cfaf7dd6f8c1.jpg 172.18.0.6       3.013ms      ⇣  1.791751ms  ↑ 88 B ↓ 1.4 MiB
2025-04-02T17:26:00.143 [200 OK] s3.GetObject minio:9000/grist-docs/docs/attachments/pNzRdT7DA1xYwYiCazPhXw/1a8c755fa909d1b3bbcd3910348098cde2254086.jpg 172.18.0.6       5.755ms      ⇣  1.939073ms  ↑ 88 B ↓ 1.2 MiB
2025-04-02T17:26:00.147 [200 OK] s3.GetObject minio:9000/grist-docs/docs/attachments/pNzRdT7DA1xYwYiCazPhXw/c912a2651f86c3dffc605513b3e4d707fb0f966d.jpg 172.18.0.6       3.763ms      ⇣  2.603324ms  ↑ 88 B ↓ 1.3 MiB
2025-04-02T17:26:00.160 [200 OK] s3.GetObject minio:9000/grist-docs/docs/attachments/pNzRdT7DA1xYwYiCazPhXw/0276fa067de9cc4c503104f3196f68f3d634d2ff.jpg 172.18.0.6       4.36ms       ⇣  1.646548ms  ↑ 88 B ↓ 1.6 MiB
2025-04-02T17:26:00.170 [200 OK] s3.GetObject minio:9000/grist-docs/docs/attachments/pNzRdT7DA1xYwYiCazPhXw/b167467826a65b3ef9d98ba50606dc37f2ef57b0.jpg 172.18.0.6       14.636ms     ⇣  2.045994ms  ↑ 88 B ↓ 1.5 MiB

I solved this problem after several hours of debugging. Running locally the grist without docker everything was working fine. Running with Docker problem exists. Putting the local IP of minio container instead of the name solved the problem, but I cannot understand why.
I changed - GRIST_DOCS_MINIO_ENDPOINT=minio to - GRIST_DOCS_MINIO_ENDPOINT=172.18.0.5.