Docker: Local upload files not loading (404 error)

Wappler Version : 3.0.1
Operating System : MacOS Catalina 10.15.5

Expected behavior

What do you think should happen?
I’ve created a “upload” folder and set it as user upload folder on project settings. My app and browser should be able to open the files inside this folder.

Actual behavior

What actually happens?
Neither my app or browser open files inside of this folder. Images on “asset” folder opens normally.

How to reproduce

  1. Create a docker + PHP + MySQL project
  2. Upload the files to “upload” folder, inside the project’s folder.
  3. Records on database only the filename, using: {guid}{ext}
  4. Try to open the file on browser using: http://localhost:8100/upload/filename
  5. on web app, create a server connect calling an action where the files name are retrieved and on dynamic attributes “image source”, set: /upload/logos/field_from_server_connect_action

Project Settings:

Local folder structure

Browser “404” error

Web app

Local docker file sharing settings:

I tried to restart Docker and Wappler and still not working.

Anyone? :frowning:

Are you sure the files are actually uploaded to your server?

@Teodor thanks for your reply! I’m sure they are on the correct folder…take a look:

Guys, @Teodor and @George!
Just found the problem with a big help from my brazilian wappler ambassador @AdrianoLuiz!

I think it’s all related to a docker compose update when you save the configuration on the target session.

After that, Docker was not able to reset, with this error:

ERROR: The Compose file './docker-compose.yml' is invalid because:
services.web.volumes value ['../../../:/var/www/html/', 'user_uploads:/var/www/html/upload:rw', 'user_uploads:/var/www/html/upload:rw'] has non-unique elements
Error Stopping Services!

Then I removed the extra line on docker compose and the services started again… Maybe, in these docker compose updates, some problem that I’m unaware happened and crashed the container(??).

Well, to solve, we just selected another folder on project settings and then, upload a file and then changed again to the desired folder, changed the docker compose (removing the extra line) and all worked.

Best

1 Like

Thanks I suspected there must be something wrong with that line.

The user_uploads mapping should be added only for remote docker containers while for local it should be just a mapping to your uploads folders, just as the other mappings.

Will improve that after our summer break.

Good finding!

2 Likes

Sorry to bother you on your summer break, George and Teodor! I forgot that! :smiley:

Thanks for your reply!

This has been fixed in Wappler 3.0.3

This topic was automatically closed after 47 hours. New replies are no longer allowed.