-
Notifications
You must be signed in to change notification settings - Fork 80
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
"Server sent add for existing id" error #80
Comments
This could be a fast-render issue. You can use following techniques to debug this:
If possible, try to create a sample repo and send it to me. Then I can work on the issue, very quickly. |
But that author suggests that you already worked around this at least to some extent, @arunoda? |
@arunoda could this be happening if we (I work with @bradvogel) subscribe to a particular collection in This Gist contains code excerpts from the relevant files. I see two potential problems there:
Either/both of the above sound problematic @arunoda? I'm also happy to get you the debug logs you asked for, just thought you might immediately see one or both of these as the cause of the issue. |
I found out what the issue was. I was updating a collection inside the rendered callback. For others who might come across this issue, here's a (simplified) example that will trigger the exception: router.js
message.js:
The fix is to not touch the collection inside the |
Reopening since this still looks like a fastrender bug. @arunoda ? |
This is interesting. Seems like something wrong going here. I will try to reproduce and try to find a cure.
|
Yes. I can reproduce this. I can't think of a direct fix to Fast Render right now. |
hey @arunoda I am getting this after switching to Cloudflare. I've had to remove fast-render for the time being. Without Cloudflare I don't run into this with fast-render installed. Just thought I would provide this extra information in case that helps. |
@arunoda Any tips on working around this? I'm seeing intermittently, even when the database update happens asynchronously after the template renders. |
@arunoda I'd like to help with a fix for this. Would you mind quickly giving me a braindump of what the timing issue might be? |
Hey. Thanks for that. What do you mean by the timing issue. This happens when you are doing a insert operation before the DDP connection comes live. FastRender adds data to those collection when the page loads. That's the root cause for this issue. As a quick fix, you can do these write ops using a method. But don't implement that method on the client. Define it only in the server. |
I get this error in a different use case, but it seems strange. If I have fast-render installed but I am not using it, meaning I do not have This is only after I switched to Cloudflare, enabled ssl and disabled websockets, and put the app behind a nginx load balancer. Even when I pause Cloudflare the issue persists. I also do not update any collections in Template rendered callbacks, but do subscribe to collections using a |
Not sure, how it relates to CF. I will look for proper fix. But I can't figure out the root cause exactly.
|
Thanks for the workaround @arunoda ! |
You're right, @arunoda. I was updating Meteor.users and that was causing the issue. Interesting how this wasn't happening without SSL/disabling websockets. The workaround of updating via server side method works. Thanks man! |
Just wanted to say I also run into this in Telescope from time to time. |
We are facing same issue on Telescope App. The content is loading to long, it's take few minutes to showup/render. Do u have solutions for @arunoda , cause right now all things we did on Telescope drop in water. |
This happens when we receive a document from server which already exists. On Mon, Apr 20, 2015 at 5:40 PM Stefan Smiljkovic [email protected]
|
@arunoda I'm calling method after content loaded. So it's takes so long time. If I disable fast-render it works fine. |
@delgermurun which method? I'd love to see a local re-production. Is this with telescope? |
Yes, on Telescope Meta with the latest Telescope master, I sometimes get this when submitting a comment. The comment goes through eventually, but it takes ~1 minute. |
Here is the code to call the comment submission method by the way: https://github.com/TelescopeJS/Telescope/blob/master/client/views/comments/comment_form.js And the submitComment method: https://github.com/TelescopeJS/Telescope/blob/master/collections/comments.js#L206-L259 |
@arunoda it's on my private package and it's very simple method. Just check time and return instantly. I guess maybe, it's taking long time to connect server. |
Okay. May be some regression with some new changes in the core. I'll have a look at this. |
Tnx God I am not the only one getting this. My app become very slow and its take to much to load, same as above mention. If i remove fastrender app become like 5-10 slower. So really waiting for solution. |
@arunoda I'm playing around this issue. I don't know how I reproduced on latest I opened same post on 2 different tabs and refreshes them. So sometimes one works fine, other one raises error. Sometimes both fails or both works. How amazing is that. I enabled log, here is some logs. Log when throws error: https://gist.github.com/delgermurun/b96b9df994beae64b1d5 As you see, on those logs there is a lot difference. How that can be happen? I'm refreshing same browser's (chrome/firefox) 2 tabs (next to each other :) ). Seems like, if it is occurs first time, happens fairly often. What I mean is if you can produce error, it happens fairly consistent on this tab. If isn't it works fine consistently. |
Interesting, I also get this error. I'm not sure if this fine to keep fast render and just ignore the error? |
@arunoda Is there any news about this bug ? |
I was receiving the same error, and confirmed at least in my testing that it's only happening with https://github.com/GroundMeteor/db EDIT: never mind my stupidity, this was due to a circular ref |
Could the error be related to very large documents? I'm getting it a lot when posting on http://meta.telescopeapp.org, and I'm wondering if it's because my user object contains over 700 entries for its |
Hmm. I'll try to replicate with that. On Fri, Jul 10, 2015 at 6:57 AM Sacha Greif [email protected]
|
Thanks sacha for giving me access to the telescope meta db. I found out the problem. Actually, there are a lot of stuff is happening. But the root problem is, when there is a method call while fast-render doing it's stuff. So, the fix is to defer all Method calls until fast-render do it's job. |
@arunoda any updates here? I'm running into this issue as well on production. |
Any update on this, by any chance? |
@SachaG once I updated Telescope version this issue solved by itself 👌 |
(Sorry I know my comment will be too specific to Telescope but...) @shtefcs what version do you use for your Telescope website. Do you still see it? @artiparty, really? it's actually the opposite. I wonder how can this be fixed. |
@raduchiriac I deleted that website and telescope installation. I was bit customized. |
Apparently this only happens when logged in. I'll have to dig deeper to isolate it, but maybe I'll disable FR in the meantime. |
@SachaG - could it be cause of telescopejs/telescope@452e521 Based on the above comments and comparing the commits I see that's the only change in the route.js that can impact it.. @arunoda - This is happening consistently with telescope 0.25.7 |
@SachaG and @arunoda - Confirmed, If i comment this line, we are no longer getting the error. - I have another collection which has that line and when i access that detail page.. i get the exception. https://github.com/TelescopeJS/Telescope/blob/452e521ee90e2eef68e37c4829500cd2979c92fb/packages/telescope-posts/lib/routes.js#L18 |
This is happens when trying to use a method when FastRendering mostly. May be you can defer it a bit. We can fix this from the FastRender side as well? For now I hope you can do this. |
@abhaytalreja oh, good find. I don't mind delaying it, how would we do that? Or would |
@SachaG - Sorry for getting a little late.. i moved this increment to onRendered call of the last blaze component. |
@abhaytalreja... thanks for the fix. This problem has been dogging us. Where is this fixed (branch, pr, sha)? We are using 0.25.7 |
@tdarci - This issue is not resolved, i have just given the pointer and i fixed it on my local copy! |
@abhaytalreja ... thanks for the reply. |
@abhaytalreja Would love to see your solution as well. Thanks in advance! |
@abhaytalreja Thanks. Works with me with |
Ever since introducing fastrender to my app, I'm getting "Server sent add for existing id". Any guidance on what might be the cause or how I might track it down?
The text was updated successfully, but these errors were encountered: