Custom Module Not Found

Wonder if somebody could help me. I am trying to use the Base64 to image custom module. It will work fine on my local docker test but on the Digital Ocean live site it will not work. I am using Trafefik and portainer (not sure if this has any bearing). I get the following error:

After looking on the forum this seems to be exactly the same problem.

When I look at my dockerfile-compose.yml none of the volume settings are there. I tried to add them in manually then redeployed. The web app ended up not working after this and I got a Bad Gateway error. Has this changed in recent versions of wappler or is there something else I need to do?

Any help would be brilliant.

1 Like

Sorry to pester but would have anybody have any ideas on this???

It’s my finial hurdle (I think) and then my mobile app will be able to work offline and sync back up with the main app.

@Teodor could you help I’m really stuck and it is blocking any progress I can make.

This is my development version local that custom extensions will work on. It has /extensions defined.

services:
  db:
    image: 'postgres:11.1'
    environment:
      POSTGRES_PASSWORD: 'aaaaaa'
      POSTGRES_USER: 'db_user'
      POSTGRES_DB: 'logsafev5'
    volumes:
      - './db_init:/docker-entrypoint-initdb.d'
      - '../../../logs:/custom_sql_log'
    ports:
      - '9906:5432'
    restart: 'always'
    command: 'postgres -c logging_collector=on -c log_directory=/custom_sql_log -c log_filename=postgres_query.log -c log_statement=all'
    logging:
      options:
        max-file: '5'
        max-size: '10m'
  web:
    depends_on:
      - 'db'
    volumes:
      - '../../../app:/opt/node_app/app'
      - '../../../lib:/opt/node_app/lib'
      - '../../../views:/opt/node_app/views'
      - '../../../public:/opt/node_app/public'
      - '../../../extensions:/opt/node_app/extensions'
      - '../../../db:/opt/node_app/db'
      - '../../../certs:/opt/node_app/certs'
    ports:
      - '8100:3000'
    restart: 'always'
    stdin_open: true
    tty: true
    build:
      context: '../../../'
      dockerfile: '.wappler/targets/test/web/Dockerfile'
    logging:
      options:
        max-file: '5'
        max-size: '10m'
  redis:
    image: 'redis:alpine'
    hostname: 'redis'
    volumes:
      - 'redis-volume:/data'
volumes:
  redis-volume: ~ 

This is then the web version on Digital Ocean. The docker-compose is completely different. I have not altered these in any way it is just what Wappler has made. If I try and add the volumes manually in the same position as they are above it breaks the app. I get a bad gateway.

services:
  db:
    environment:
      POSTGRES_PASSWORD: 'aaaaaaaaa'
      POSTGRES_USER: 'db_user'
      POSTGRES_DB: 'logsafev5'
    volumes:
      - 'db-volume:/var/lib/postgresql/data'
    ports:
      - '9906:5432'
    restart: 'always'
    logging:
      options:
        max-file: '5'
        max-size: '10m'
    build:
      context: '.'
      dockerfile: 'db/Dockerfile'
    networks:
      proxy: ~
  web:
    depends_on:
      - 'db'
    ports:
      - '3000'
    restart: 'always'
    stdin_open: true
    tty: true
    logging:
      options:
        max-file: '5'
        max-size: '10m'
    build:
      context: '../../../'
      dockerfile: '.wappler/targets/TestTwo061222/web/Dockerfile'
    labels:
      - 'traefik.enable=true'
      - 'traefik.http.routers.logsafev5__testtwo061222_web.entrypoints=web'
      - 'traefik.http.routers.logsafev5__testtwo061222_web.rule=Host(`logsafe.co.uk`)'
      - 'traefik.http.routers.logsafev5__testtwo061222_web-secure.entrypoints=websecure'
      - 'traefik.http.routers.logsafev5__testtwo061222_web-secure.rule=Host(`logsafe.co.uk`)'
      - 'traefik.http.routers.logsafev5__testtwo061222_web-secure.tls=true'
      - 'traefik.http.routers.logsafev5__testtwo061222_web-secure.tls.certresolver=leresolver'
      - 'traefik.http.services.logsafev5__testtwo061222_web.loadbalancer.server.port=3000'
      - 'traefik.docker.network=wappler-compose_proxy'
      - 'traefik.http.routers.logsafev5__testtwo061222_www_web-secure.entrypoints=websecure'
      - 'traefik.http.routers.logsafev5__testtwo061222_www_web-secure.rule=Host(`www.logsafe.co.uk`)'
      - 'traefik.http.routers.logsafev5__testtwo061222_www_web-secure.tls=true'
      - 'traefik.http.routers.logsafev5__testtwo061222_www_web-secure.tls.certresolver=leresolver'
      - 'traefik.http.middlewares.logsafev5__testtwo061222_www-redirect.redirectregex.regex=^https://www.logsafe.co.uk/(.*)'
      - 'traefik.http.middlewares.logsafev5__testtwo061222_www-redirect.redirectregex.replacement=https://logsafe.co.uk/$${1}'
      - 'traefik.http.middlewares.logsafev5__testtwo061222_www-redirect.redirectregex.permanent=true'
      - 'traefik.http.routers.logsafev5__testtwo061222_www_web-secure.middlewares=logsafev5__testtwo061222_www-redirect'
    networks:
      proxy: ~
  redis:
    image: 'redis:alpine'
    hostname: 'redis'
    volumes:
      - 'redis-volume:/data'
volumes:
  db-volume: ~
  redis-volume: ~
networks:
  proxy:
    name: 'wappler-compose_proxy'
    external: true

How do I add the extension folder or do you not think this is the issue?

Can anybody help please :slight_smile:

On my remote server this is the error I get on the web sever logs.

On the local server I get.

Will this be the issue in the custom module. On the remote docker files I can’t see this is defined.


Do I need to change this path to something else?

Well did you write it yourself and place it in the right folder as described in:

Thanks George. It’s the base64tofile extension. I didn’t write but seems to work perfectly for my need. This is to get dataurl from sqlite on capacitor (image) back onto the server as a file. This will mean it can all work offline and sync back when there is a internet connection. Then I can upload to s3. Is there any way to do this without a custom extension/ code?

It have placed the files in the extensions/server-connect/modules . I can pick it in the wappler ui and works great when on a local docker. When I try to use it on digital ocean though it doesn’t work and comes up with the error above. I just can’t figure out why.

If I go into the web server on the remote I can see the extension files and also the folder were I want to place the image. The required module fs-extra is listed to on the remote server.

Thanks,

Well if the extension files are also on the remote then it should be found… maybe something else is wrong.

Thanks George got it working now.

Turns out on Digital Ocean it is case sensitive but on local docker it is not. Why would this be aren’t Docker images supposed to be exactly the same. Changed the Base64ToFile to base64tofile (all lower case).
Screenshot 2023-03-02 at 13.27.30

1 Like

Thanks for coming back with your solution, @jmartland22! I was on holiday, hence of little help.