citizenos / ep_image_upload

Add images to etherpad and upload them to Amazon S3
Other
9 stars 16 forks source link

Invalid URL TypeError #33

Closed rasos closed 3 years ago

rasos commented 3 years ago

Since a plugin update today to ep_image_upload@1.0.32 and ep_image_upload@1.0.33 we get on a EP 1.8.7 at each upload:

[2021-02-14 23:19:48.971] [ERROR] console - TypeError [ERR_INVALID_URL]: Invalid URL: testing1/ba1e83de-1b80-427a-9ce8-2c6780076.jpeg
    at new NodeError (node:internal/errors:329:5)
    at onParseError (node:internal/url:282:9)
    at new URL (node:internal/url:358:5)
    at new URL (node:internal/url:355:22)
    at Busboy.<anonymous> (/opt/etherpad-lite/node_modules/ep_image_upload/index.js:132:24)
    at Busboy.emit (node:events:378:20)
    at Busboy.EventEmitter.emit (node:domain:470:12)
    at Busboy.emit (/opt/etherpad-lite/node_modules/busboy/lib/main.js:38:33)
    at PartStream.<anonymous> (/opt/etherpad-lite/node_modules/busboy/lib/types/multipart.js:213:13)
    at PartStream.emit (node:events:378:20)
    at PartStream.EventEmitter.emit (node:domain:470:12)
    at HeaderParser.<anonymous> (/opt/etherpad-lite/node_modules/dicer/lib/Dicer.js:51:16)
    at HeaderParser.emit (node:events:378:20)
    at HeaderParser.EventEmitter.emit (node:domain:470:12)
    at HeaderParser._finish (/opt/etherpad-lite/node_modules/dicer/lib/HeaderParser.js:68:8)
    at SBMH.<anonymous> (/opt/etherpad-lite/node_modules/dicer/lib/HeaderParser.js:40:12)
[2021-02-14 23:19:48.971] [INFO] console - Stopping Etherpad...

settings.json includes:

"ep_image_upload": {
    "storage": {
      "type": "local",
      "baseFolder": "/mnt/data/etherpad-lite/upload",
      "baseURL": "https://ourpad.net/up/"
    },
    "fileTypes": ["jpeg","jpg","bmp","gif","png"],
    "maxFileSize": 5000000
},

This has worked fine before. Uninstalling the plugin for now, as it causes exceptions.

JohnMcLear commented 3 years ago

Today I only introduced logic for increasing socketio max message size through plugin afaik.

Do you get this issue on develop? Either way I will fix but it's weird you get this issue since it's not related to socketio.

JohnMcLear commented 3 years ago

Oh I see this issue. It's not related to today's work. The issue is 5 or so days old. I will fix ASAP.

JohnMcLear commented 3 years ago

Oh, I just spotted that you serve files through nginx/apache or something and not from Etherpad. Which is fine, it means I need to mess w/ my config a bit more but no big deal :)

JohnMcLear commented 3 years ago

I pushed a blind fix, feel free to test.

JohnMcLear commented 3 years ago

I think having test coverage for actually uploaded files would be handy, but it's beyond the scope of my time atm

JohnMcLear commented 3 years ago

If this is still an issue in latest release please comment

rasos commented 3 years ago

Fix tested on EP 1.8.7. Works here, thanks for the quick response.

JohnMcLear commented 3 years ago

Yw plz update to 1.8.8 :) tbx