Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uploaded images not found #230

Closed
tanc opened this issue May 21, 2021 · 15 comments
Closed

Uploaded images not found #230

tanc opened this issue May 21, 2021 · 15 comments
Labels
bug Something isn't working released on @beta

Comments

@tanc
Copy link
Contributor

tanc commented May 21, 2021

I wanted to modify the email environment variables passed into the docker images so I issued a docker-compose down and docker-compose up -d. Once it came up successfully I noticed the image I had uploaded for one site won't load. Are these stored somewhere in the docker image rather than in the database or a non-volatile volume or filesystem?

The server issues a 404 for that image:

https://meli.jampony.net/api/v1/sites/883e900d-eae1-42f2-9afa-3c84a270c6da/logo?id=bd9c3c27-f083-4aaa-ade9-1d6be2c17dca

Resulting in a broken image link and the alt text "bubble" being shown:

image

Might also be worth changing the alt text to an empty string to indicate the image is purely decorative.

@gempain
Copy link
Contributor

gempain commented May 21, 2021

Images are stored in MELI_STORAGE_DIR which defaults to /files. You should map this Docker volume. If you had not mapped it, you will lose those images when restarting the docker image. I just noticed our docs is missing this in the installation section. I'll update it right away.

gempain pushed a commit to getmeli/meli-docs that referenced this issue May 21, 2021
@tanc
Copy link
Contributor Author

tanc commented May 21, 2021

After mounting a local directory into the container (and before doing this) I can't delete or upload a new logo. If I try to delete the existing (broken) image I get a 500 error and this message:

Could not remove logo: Error: Request failed with status code 500

Trying to upload a new one also results in a similar 500 error with:

Could not upload logo: Error: Request failed with status code 500

@gempain
Copy link
Contributor

gempain commented May 21, 2021

I see the issue. It's because we're trying to delete the logo while it doesn't exist. Sorry for the inconvenience. Will com up with a fix.

@tanc
Copy link
Contributor Author

tanc commented May 21, 2021

No problem and thanks as always for your quick response!

@gempain gempain added the bug Something isn't working label May 21, 2021
gempain pushed a commit that referenced this issue May 21, 2021
# [1.0.0-beta.23](v1.0.0-beta.22...v1.0.0-beta.23) (2021-05-21)

### Bug Fixes

* cannot upload or delete logo (closes [#230](#230)) ([970e1f4](970e1f4))
* incorrect description and missing info in package.json ([#227](#227)) ([290de80](290de80))
* wrong site / branch url in ui ([d33f03f](d33f03f))

### Features

* allow deleting branches with site token ([b107ed7](b107ed7))
* update DomainForm with private key help text ([#231](#231)) ([da4562d](da4562d))
* upload release with api token ([#216](#216)) ([#225](#225)) ([1d5ceb6](1d5ceb6))
@meli-release-bot
Copy link
Collaborator

🎉 This issue has been resolved in version 1.0.0-beta.23 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@tanc
Copy link
Contributor Author

tanc commented May 21, 2021

Thanks! Although for some reason I can't upload images on this new release. Deleting the broken image worked fine though. Uploading throws a 500 error.

I've got a mount in my docker-compose file:

 volumes:
      - /meli/sites:/sites
      - /meli/caddy/data:/data
      - /meli/caddy/config:/config
      - /meli/files:/files

I can touch a file in /meli/files and confirm it is in /files in the meli container.

Do want a new issue for this?

@gempain
Copy link
Contributor

gempain commented May 21, 2021

Are you sure you're using the latest version ? I just tried on our environment and it seems to work fine. Did you docker-compose pull before docker-compose up -d ?

@gempain gempain reopened this May 21, 2021
@tanc
Copy link
Contributor Author

tanc commented May 21, 2021

I did yes, but I was on the getmeli/meli:next tag. I swapped to getmeli/meli:beta as it seems slightly newer and brought the containers up but I'm still seeing the same problem, 500 error when uploading image.

@tanc
Copy link
Contributor Author

tanc commented May 21, 2021

Meli is showing 1.0.0-beta.23 in the bottom right corner:

{
  "ui": {
    "version": "1.0.0-beta.13",
    "commitHash": "2021-05-21T12:41:58.366Z",
    "buildDate": "2021-05-21T12:41:58.366Z"
  },
  "api": {
    "version": "1.0.0-beta.23",
    "buildDate": "2021-05-21T12:41:44.941Z",
    "commitHash": "970e1f4d5fda64545a95b36028f11c35be90bf7a"
  }
}

I've tried making the /files directory permissions 777 inside the container to eliminate any potential permissions problems but that didn't help.

@tanc
Copy link
Contributor Author

tanc commented May 21, 2021

I just disabled the files volume mount and re-upped the containers and the uploading of images works. So something isn't good with my mount

@tanc
Copy link
Contributor Author

tanc commented May 21, 2021

The docker logs show this when trying to upload a file with a volume mount:

Error: EXDEV: cross-device link not permitted, rename '/tmp/f0ed6fec087fa9b0ebb98f661d77dd7c' -> '/files/1e5e38c2-dd69-4c8a-a054-8e0c8cf3cb1e'

@tanc
Copy link
Contributor Author

tanc commented May 21, 2021

Looks like a limit of rename, suggestions I've read are to copy the file into place first and then delete the version in /tmp

@gempain
Copy link
Contributor

gempain commented May 21, 2021

Ohhhh yes, I see, we've had this problem before for uploading sites and fixed it by copying. It's a problem related to how Docker works. We're first uploading the image into a temporary directory which isn't mapped, and then moving it to /files and that causes the issue.

gempain pushed a commit that referenced this issue May 25, 2021
@gempain
Copy link
Contributor

gempain commented May 25, 2021

@tanc this was an easy fix, sorry for the delay 😄 I'll release on beta soon.

gempain pushed a commit that referenced this issue May 25, 2021
# [1.0.0-beta.24](v1.0.0-beta.23...v1.0.0-beta.24) (2021-05-25)

### Bug Fixes

* cannot upload logo [#230](#230) ([3181cab](3181cab))
* **security:** update lodash ([12e4dc3](12e4dc3))
@gempain
Copy link
Contributor

gempain commented May 25, 2021

@tanc this should be fixed in beta 24. I'll close, but we can reopen if needed.

@gempain gempain closed this as completed May 25, 2021
cooldev330 added a commit to cooldev330/Deploy-app that referenced this issue Aug 4, 2024
# [1.0.0-beta.23](getmeli/meli@v1.0.0-beta.22...v1.0.0-beta.23) (2021-05-21)

### Bug Fixes

* cannot upload or delete logo (closes [#230](getmeli/meli#230)) ([970e1f4](getmeli/meli@970e1f4))
* incorrect description and missing info in package.json ([#227](getmeli/meli#227)) ([290de80](getmeli/meli@290de80))
* wrong site / branch url in ui ([d33f03f](getmeli/meli@d33f03f))

### Features

* allow deleting branches with site token ([b107ed7](getmeli/meli@b107ed7))
* update DomainForm with private key help text ([#231](getmeli/meli#231)) ([da4562d](getmeli/meli@da4562d))
* upload release with api token ([#216](getmeli/meli#216)) ([#225](getmeli/meli#225)) ([1d5ceb6](getmeli/meli@1d5ceb6))
cooldev330 added a commit to cooldev330/Deploy-app that referenced this issue Aug 4, 2024
# [1.0.0-beta.24](getmeli/meli@v1.0.0-beta.23...v1.0.0-beta.24) (2021-05-25)

### Bug Fixes

* cannot upload logo [#230](getmeli/meli#230) ([3181cab](getmeli/meli@3181cab))
* **security:** update lodash ([12e4dc3](getmeli/meli@12e4dc3))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working released on @beta
Projects
None yet
Development

No branches or pull requests

3 participants