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

DDPRateLimiter method _FilesCollectionWrite_* throws an error on uploading images (jpg) #890

Open
sebastianspiller opened this issue Aug 15, 2024 · 1 comment

Comments

@sebastianspiller
Copy link

I'm having an issue:

  • We use the [email protected] package
  • We use the rate limiter on every method, but have exceptions / relaxed rules for some methods.
  • When inserting some images (jpg) (with a big blob size) with Photos.insert({file, chunkSize: 'dynamic', onUploaded() {...}}) the rate limiter gets triggered and we get the following stack trace: see below
  • When excluding method _FilesCollectionWrite_photos from rate-limiter, we do not get this and everything works fine.
  • Finally, we want to continue using the rate limiter, can you help us?

Error during upload: Error: Error, too many requests. Please slow down. You must wait 10 seconds before trying again. [too-many-requests] takeBroadcastPhoto.js:124:44 onUploaded http://localhost:3000/app/app.js?hash=38540d7b6e590fef098e65663ced20934fa2a833:85178 end http://localhost:3000/packages/ostrio_files.js?hash=efe89c177540b4455d26027114d042828849a9ed:1605 emit http://localhost:3000/packages/ostrio_files.js?hash=efe89c177540b4455d26027114d042828849a9ed:2188 sendChunk http://localhost:3000/packages/ostrio_files.js?hash=efe89c177540b4455d26027114d042828849a9ed:1653 bindEnvironment http://localhost:3000/packages/meteor.js?hash=7dd187e6c4c7dc8731ddaf9d1d993d3c3ba5a732:1343 _maybeInvokeCallback http://localhost:3000/packages/ddp-client.js?hash=12df120d82048869c74b009c3544bf96a2f333dc:174 receiveResult http://localhost:3000/packages/ddp-client.js?hash=12df120d82048869c74b009c3544bf96a2f333dc:192 _livedata_result http://localhost:3000/packages/ddp-client.js?hash=12df120d82048869c74b009c3544bf96a2f333dc:1812 onMessage http://localhost:3000/packages/ddp-client.js?hash=12df120d82048869c74b009c3544bf96a2f333dc:1961 onmessage http://localhost:3000/packages/socket-stream-client.js?hash=bd9a828c69309b508bc48e64db859bbf2d49f942:198 forEachCallback http://localhost:3000/packages/socket-stream-client.js?hash=bd9a828c69309b508bc48e64db859bbf2d49f942:267 onmessage http://localhost:3000/packages/socket-stream-client.js?hash=bd9a828c69309b508bc48e64db859bbf2d49f942:197 dispatchEvent http://localhost:3000/packages/socket-stream-client.js?hash=bd9a828c69309b508bc48e64db859bbf2d49f942:517 _transportMessage http://localhost:3000/packages/socket-stream-client.js?hash=bd9a828c69309b508bc48e64db859bbf2d49f942:889 _transportMessage http://localhost:3000/packages/socket-stream-client.js?hash=bd9a828c69309b508bc48e64db859bbf2d49f942:888 emit http://localhost:3000/packages/socket-stream-client.js?hash=bd9a828c69309b508bc48e64db859bbf2d49f942:480 onmessage http://localhost:3000/packages/socket-stream-client.js?hash=bd9a828c69309b508bc48e64db859bbf2d49f942:1853 (Async: EventHandlerNonNull) c http://localhost:3000/packages/socket-stream-client.js?hash=bd9a828c69309b508bc48e64db859bbf2d49f942:1852 _connect http://localhost:3000/packages/socket-stream-client.js?hash=bd9a828c69309b508bc48e64db859bbf2d49f942:863 _receiveInfo http://localhost:3000/packages/socket-stream-client.js?hash=bd9a828c69309b508bc48e64db859bbf2d49f942:853 e http://localhost:3000/packages/socket-stream-client.js?hash=bd9a828c69309b508bc48e64db859bbf2d49f942:473 emit http://localhost:3000/packages/socket-stream-client.js?hash=bd9a828c69309b508bc48e64db859bbf2d49f942:480 doXhr http://localhost:3000/packages/socket-stream-client.js?hash=bd9a828c69309b508bc48e64db859bbf2d49f942:747 e http://localhost:3000/packages/socket-stream-client.js?hash=bd9a828c69309b508bc48e64db859bbf2d49f942:473 emit http://localhost:3000/packages/socket-stream-client.js?hash=bd9a828c69309b508bc48e64db859bbf2d49f942:480 i http://localhost:3000/packages/socket-stream-client.js?hash=bd9a828c69309b508bc48e64db859bbf2d49f942:635 e http://localhost:3000/packages/socket-stream-client.js?hash=bd9a828c69309b508bc48e64db859bbf2d49f942:473 emit http://localhost:3000/packages/socket-stream-client.js?hash=bd9a828c69309b508bc48e64db859bbf2d49f942:480 onreadystatechange http://localhost:3000/packages/socket-stream-client.js?hash=bd9a828c69309b508bc48e64db859bbf2d49f942:1127 (Async: EventHandlerNonNull) _start http://localhost:3000/packages/socket-stream-client.js?hash=bd9a828c69309b508bc48e64db859bbf2d49f942:1114 c http://localhost:3000/packages/socket-stream-client.js?hash=bd9a828c69309b508bc48e64db859bbf2d49f942:1094 (Async: setTimeout handler) c http://localhost:3000/packages/socket-stream-client.js?hash=bd9a828c69309b508bc48e64db859bbf2d49f942:1093 i http://localhost:3000/packages/socket-stream-client.js?hash=bd9a828c69309b508bc48e64db859bbf2d49f942:1829 i http://localhost:3000/packages/socket-stream-client.js?hash=bd9a828c69309b508bc48e64db859bbf2d49f942:625 _getReceiver http://localhost:3000/packages/socket-stream-client.js?hash=bd9a828c69309b508bc48e64db859bbf2d49f942:740 doXhr http://localhost:3000/packages/socket-stream-client.js?hash=bd9a828c69309b508bc48e64db859bbf2d49f942:744 d http://localhost:3000/packages/socket-stream-client.js?hash=bd9a828c69309b508bc48e64db859bbf2d49f942:736 (Async: setTimeout handler) d http://localhost:3000/packages/socket-stream-client.js?hash=bd9a828c69309b508bc48e64db859bbf2d49f942:735 y http://localhost:3000/packages/socket-stream-client.js?hash=bd9a828c69309b508bc48e64db859bbf2d49f942:835 _launchConnection http://localhost:3000/packages/socket-stream-client.js?hash=bd9a828c69309b508bc48e64db859bbf2d49f942:188 ClientStream http://localhost:3000/packages/socket-stream-client.js?hash=bd9a828c69309b508bc48e64db859bbf2d49f942:91 Connection http://localhost:3000/packages/ddp-client.js?hash=12df120d82048869c74b009c3544bf96a2f333dc:374 connect http://localhost:3000/packages/ddp-client.js?hash=12df120d82048869c74b009c3544bf96a2f333dc:2131 module http://localhost:3000/packages/ddp-client.js?hash=12df120d82048869c74b009c3544bf96a2f333dc:109 fileEvaluate http://localhost:3000/packages/modules-runtime-hot.js?hash=0990604f99408d08cb3a9ff8e3bbfa6692eb6570:388 require http://localhost:3000/packages/modules-runtime-hot.js?hash=0990604f99408d08cb3a9ff8e3bbfa6692eb6570:270 moduleLink http://localhost:3000/packages/modules.js?hash=dcfa470ceabab8b56deb1697c155e694b036f335:398 module http://localhost:3000/packages/ddp-client.js?hash=12df120d82048869c74b009c3544bf96a2f333dc:48 fileEvaluate http://localhost:3000/packages/modules-runtime-hot.js?hash=0990604f99408d08cb3a9ff8e3bbfa6692eb6570:388 require http://localhost:3000/packages/modules-runtime-hot.js?hash=0990604f99408d08cb3a9ff8e3bbfa6692eb6570:270 require http://localhost:3000/packages/modules-runtime-hot.js?hash=0990604f99408d08cb3a9ff8e3bbfa6692eb6570:310 <anonymous> http://localhost:3000/packages/ddp-client.js?hash=12df120d82048869c74b009c3544bf96a2f333dc:2163 <anonymous> http://localhost:3000/packages/ddp-client.js?hash=12df120d82048869c74b009c3544bf96a2f333dc:2170

@sebastianspiller sebastianspiller changed the title DDPRateLimiter method _FilesCollectionWrite_* DDPRateLimiter method _FilesCollectionWrite_* throws an error on uploading images (jpg) Aug 15, 2024
@dr-dimitru
Copy link
Member

@sebastianspiller hello, would you consider using http as upload transport to avoid all issues related to methods? The other option is only to exclude each method from limiter or to find suitable configuration

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants