Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.


    Cloudron Forum

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular

    [Solved]Unexpected error (Bad Gateway) when uploading image to template with Mosaico or GrapheJS

    Mailtrain
    2
    7
    218
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • C
      Camille last edited by Camille

      Hi,
      Since a few days (and it doesn't seem related to the last update : Mailtrain Package v1.7.0 App v1.24.1), I get this error "Unexpected error (Bad Gateway)" whenever I try to upload an image with Mosaico or GrapeJS.

      With both editors, the logs tell me

      Mar 17 14:47:53 fs.js:168
      Mar 17 14:47:53 throw new ERR_INVALID_CALLBACK(cb);
      Mar 17 14:47:53 ^
      Mar 17 14:47:53
      Mar 17 14:47:53 TypeError [ERR_INVALID_CALLBACK]: Callback must be a function. Received undefined
      Mar 17 14:47:53 at makeCallback (fs.js:168:11)
      Mar 17 14:47:53 at Object.unlink (fs.js:1199:14)
      Mar 17 14:47:53 at ReadStream.<anonymous> (/app/code/node_modules/jquery-file-upload-middleware/lib/uploadhandler.js:149:48)
      Mar 17 14:47:53 at ReadStream.emit (events.js:327:22)
      Mar 17 14:47:53 at ReadStream.EventEmitter.emit (domain.js:467:12)
      Mar 17 14:47:53 at endReadableNT (internal/streams/readable.js:1327:12)
      Mar 17 14:47:53 at processTicksAndRejections (internal/process/task_queues.js:80:21) {
      Mar 17 14:47:53 code: 'ERR_INVALID_CALLBACK'
      Mar 17 14:47:53 }
      Mar 17 14:47:53 npm ERR! code ELIFECYCLE
      Mar 17 14:47:53 npm ERR! errno 1
      Mar 17 14:47:53 npm ERR! mailtrain@1.24.0 start: `node index.js`
      Mar 17 14:47:53 npm ERR! Exit status 1
      Mar 17 14:47:53 npm ERR!
      

      The images actually get uploaded to /tmp.
      Anyone having the same problem or any idea on what to investigate ?

      Thanks !

      1 Reply Last reply Reply Quote 0
      • C
        Camille last edited by

        Actually, I get the same problem with a fresh install of the app (Package v1.7.0
        App v1.24.1).
        Has anyone a working instance of this version?

        girish 1 Reply Last reply Reply Quote 0
        • girish
          girish Staff @Camille last edited by

          @camille Sorry for the delay, but I can reproduce the issue. Are you able to report the issue upstream at https://github.com/Mailtrain-org/mailtrain ? Mailtrain has not made a release in quite a while now (almost 2.5 years), so I am not sure what the development status of the project is.

          FWIW, we still we use mailtrain but we just don't use that email builder. Instead, I have a template that I made from https://beefree.io/bee-free/ and then I pasted that html into the newsletter.

          1 Reply Last reply Reply Quote 0
          • girish
            girish Staff last edited by

            The root cause of the issue is https://github.com/aguidrevitch/jquery-file-upload-middleware/issues/85

            1 Reply Last reply Reply Quote 0
            • girish
              girish Staff last edited by

              I ended up deprecating nodejs version and it works after that.

              1caf21a7-252b-419e-8e2c-e768a78f4e65-image.png

              1 Reply Last reply Reply Quote 0
              • C
                Camille last edited by

                Thanks @girish for the fix. I have reported the problem upstream : https://github.com/Mailtrain-org/mailtrain/issues/1030

                girish 1 Reply Last reply Reply Quote 0
                • girish
                  girish Staff @Camille last edited by

                  @camille thanks, I have left a note there. We can help them fix/update it if they have interest in keeping mailtrain 1 updated.

                  1 Reply Last reply Reply Quote 0
                  • First post
                    Last post
                  Powered by NodeBB