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

Aggregation runs successfully but not results returned #1098

Closed
LeeSingFanda opened this Issue May 24, 2016 · 9 comments

Comments

Projects
None yet
5 participants
@LeeSingFanda

LeeSingFanda commented May 24, 2016

I was tuning a slow aggregation pipeline scanning a big collection and run the pipeline in Robomongo. Robomongo, after a while, displayed a message stating "Script executed successfully, but there are no results to show.". The same query returns result correctly when I run directly from Mongo shell.

The behavior seems to be random and normally occurs when the script takes more than 30 seconds (not 100% sure) to return.

On small suggestion on this matter too. Upon completion of the execution, Robomongo doesn't display the execution time as normally when it returns data. I think you should still display such info if it's available.

@myaskevich

This comment has been minimized.

Show comment
Hide comment
@myaskevich

myaskevich May 24, 2016

Collaborator

Hi @LeeSingFanda

Thanks for reaching out to us, we appreciate it ❤️

I get the same problem as well when I run my script having some of the code selected like so:

screen shot 2016-05-24 at 11 22 31 am

Once I remove the selection, the issue goes away and results pop out below.

screen shot 2016-05-24 at 11 23 20 am

Could you please confirm if you're experiencing the same thing?

Max

Collaborator

myaskevich commented May 24, 2016

Hi @LeeSingFanda

Thanks for reaching out to us, we appreciate it ❤️

I get the same problem as well when I run my script having some of the code selected like so:

screen shot 2016-05-24 at 11 22 31 am

Once I remove the selection, the issue goes away and results pop out below.

screen shot 2016-05-24 at 11 23 20 am

Could you please confirm if you're experiencing the same thing?

Max

@LeeSingFanda

This comment has been minimized.

Show comment
Hide comment
@LeeSingFanda

LeeSingFanda May 25, 2016

@myaskevich,

Thanks for your response. This is certainly not the case. In your example, you were selecting only some comments, which logically shouldn't return anything if you run it. In my case, I'm running a real script, regardless it's selected or not, and the behavior is random.

I can give you an example query where you can probably re-produce from your end.

  1. Create a large system.profile capped collection.
    db.system.profile.drop();
    db.createCollection( "system.profile", { capped: true, size: 1024 * 1024 * 1024 } );
    db.setProfilingLevel(2);
  2. Aggregate against the collection.
    db.system.profile.aggregate([
    {$group:{
    _id:{ns:'$ns', op:'$op'},
    millis:{$sum:{$ifNull:['$millis', 0]}},
    keyUpdates:{$sum:{$ifNull:['$keyUpdates', 0]}},
    writeConflicts:{$sum:{$ifNull:['$writeConflicts', 0]}},
    numYield:{$sum:{$ifNull:['$numYield', 0]}},
    responseLength:{$sum:{$ifNull:['$responseLength', 0]}},
    keysExamined:{$sum:{$ifNull:['$keysExamined', 0]}},
    docsExamined:{$sum:{$ifNull:['$docsExamined', 0]}},
    nreturned:{$sum:{$ifNull:['$nreturned', 0]}},
    nMatched:{$sum:{$ifNull:['$nMatched', 0]}},
    nModified:{$sum:{$ifNull:['$nModified', 0]}},
    total:{$sum:1},
    avg_millis:{$avg:'$millis'},
    max_millis:{$max:'$millis'},
    }},
    {$project:{_id:0, ns:'$_id.ns', op:'$_id.op', keyUpdates:1, writeConflicts:1, numYield:1, responseLength:1,
    keysExamined:1, docsExamined:1, nreturned:1, nMatched:1, nModified:1, millis:1, total:1, avg_millis:1, max_millis:1
    }},
    {$sort:{avg_millis:-1}}
    ]);

LeeSingFanda commented May 25, 2016

@myaskevich,

Thanks for your response. This is certainly not the case. In your example, you were selecting only some comments, which logically shouldn't return anything if you run it. In my case, I'm running a real script, regardless it's selected or not, and the behavior is random.

I can give you an example query where you can probably re-produce from your end.

  1. Create a large system.profile capped collection.
    db.system.profile.drop();
    db.createCollection( "system.profile", { capped: true, size: 1024 * 1024 * 1024 } );
    db.setProfilingLevel(2);
  2. Aggregate against the collection.
    db.system.profile.aggregate([
    {$group:{
    _id:{ns:'$ns', op:'$op'},
    millis:{$sum:{$ifNull:['$millis', 0]}},
    keyUpdates:{$sum:{$ifNull:['$keyUpdates', 0]}},
    writeConflicts:{$sum:{$ifNull:['$writeConflicts', 0]}},
    numYield:{$sum:{$ifNull:['$numYield', 0]}},
    responseLength:{$sum:{$ifNull:['$responseLength', 0]}},
    keysExamined:{$sum:{$ifNull:['$keysExamined', 0]}},
    docsExamined:{$sum:{$ifNull:['$docsExamined', 0]}},
    nreturned:{$sum:{$ifNull:['$nreturned', 0]}},
    nMatched:{$sum:{$ifNull:['$nMatched', 0]}},
    nModified:{$sum:{$ifNull:['$nModified', 0]}},
    total:{$sum:1},
    avg_millis:{$avg:'$millis'},
    max_millis:{$max:'$millis'},
    }},
    {$project:{_id:0, ns:'$_id.ns', op:'$_id.op', keyUpdates:1, writeConflicts:1, numYield:1, responseLength:1,
    keysExamined:1, docsExamined:1, nreturned:1, nMatched:1, nModified:1, millis:1, total:1, avg_millis:1, max_millis:1
    }},
    {$sort:{avg_millis:-1}}
    ]);
@juliashibalko

This comment has been minimized.

Show comment
Hide comment
@juliashibalko

juliashibalko Jul 4, 2016

Collaborator

@LeeSingFanda We have just added comment with workaround description for #1106 ticket. So please take a look if you have some free minutes. It should help to solve the problem you wrote about.

Collaborator

juliashibalko commented Jul 4, 2016

@LeeSingFanda We have just added comment with workaround description for #1106 ticket. So please take a look if you have some free minutes. It should help to solve the problem you wrote about.

@juliashibalko juliashibalko added bug and removed needs repro labels Jul 4, 2016

@LeeSingFanda

This comment has been minimized.

Show comment
Hide comment
@LeeSingFanda

LeeSingFanda Jul 6, 2016

@juliashibalko Yes, it works for me! Thanks!

LeeSingFanda commented Jul 6, 2016

@juliashibalko Yes, it works for me! Thanks!

@teliatko

This comment has been minimized.

Show comment
Hide comment
@teliatko

teliatko Jul 12, 2016

Same issue here while running:

db.getCollection('oplog.rs').aggregate([
    { $match: 
        {
            ts: { $gt: Timestamp(1468227600, 000) }, 
            "o.@type": "n4.model.command.CommandStoreEntry",
            "o.command.@type": "n4.metacompany.jobs.orders.commands.CreateOrderAndLineItemsCommand"
        }
    },
    { $project: 
        { noOfLineItems: { $size: "$o.command.lineItems" }, item: { $trunc: 1 } }
    },
    { $group: 
        {
            _id: "total",
            noOfItems: { $sum: "$item" },
            noOfLineItems: { $sum: "$noOfLineItems" }
        }
    }       
], { explain: false 

> })

Workaround works well, but ... what I still do not understand why when there is any timeout present and it kicks on the message is "Script executed successfully, but there are no results to show".

Script is not successful neither failed, Robomongo simply didn't know. Why not to just say "Script run out of timeout, result is unclear"?

teliatko commented Jul 12, 2016

Same issue here while running:

db.getCollection('oplog.rs').aggregate([
    { $match: 
        {
            ts: { $gt: Timestamp(1468227600, 000) }, 
            "o.@type": "n4.model.command.CommandStoreEntry",
            "o.command.@type": "n4.metacompany.jobs.orders.commands.CreateOrderAndLineItemsCommand"
        }
    },
    { $project: 
        { noOfLineItems: { $size: "$o.command.lineItems" }, item: { $trunc: 1 } }
    },
    { $group: 
        {
            _id: "total",
            noOfItems: { $sum: "$item" },
            noOfLineItems: { $sum: "$noOfLineItems" }
        }
    }       
], { explain: false 

> })

Workaround works well, but ... what I still do not understand why when there is any timeout present and it kicks on the message is "Script executed successfully, but there are no results to show".

Script is not successful neither failed, Robomongo simply didn't know. Why not to just say "Script run out of timeout, result is unclear"?

@juliashibalko

This comment has been minimized.

Show comment
Hide comment
@juliashibalko

juliashibalko Jul 12, 2016

Collaborator

@teliatko thanks for details! You're absolutely right - Robomongo does not always show error messages correctly. We are sorry for that! I'll add details about this case to the open ticket #1108 Show detailed and proper error message and you can track progress within this card.
Glad to hear that workaround works!

Collaborator

juliashibalko commented Jul 12, 2016

@teliatko thanks for details! You're absolutely right - Robomongo does not always show error messages correctly. We are sorry for that! I'll add details about this case to the open ticket #1108 Show detailed and proper error message and you can track progress within this card.
Glad to hear that workaround works!

@ghost

This comment has been minimized.

Show comment
Hide comment
@ghost

ghost Aug 2, 2016

Hi @myaskevich, I have the same problem as you described:
screen shot 2016-08-02 at 16 07 31
screen shot 2016-08-02 at 16 10 03

Is there a fix for this? MongoDB 2.6.3, Robomongo 0.9.0-RC9 on OS X 10.11.6

ghost commented Aug 2, 2016

Hi @myaskevich, I have the same problem as you described:
screen shot 2016-08-02 at 16 07 31
screen shot 2016-08-02 at 16 10 03

Is there a fix for this? MongoDB 2.6.3, Robomongo 0.9.0-RC9 on OS X 10.11.6

@juliashibalko

This comment has been minimized.

Show comment
Hide comment
@juliashibalko

juliashibalko Aug 26, 2016

Collaborator

@collateraldamadge Could you please check solution described in the next comment #1106 (comment) if you have some free minutes? Does it work for you and solve the problem? Thanks in advance!

Collaborator

juliashibalko commented Aug 26, 2016

@collateraldamadge Could you please check solution described in the next comment #1106 (comment) if you have some free minutes? Does it work for you and solve the problem? Thanks in advance!

@juliashibalko

This comment has been minimized.

Show comment
Hide comment
@juliashibalko

juliashibalko Jun 26, 2017

Collaborator

Checked in Robo3T 1.1 under Mac OS X 10.12 and Windows 10. Closing this issue as can't reproduce. Feel free to re-open the ticket in case.

Collaborator

juliashibalko commented Jun 26, 2017

Checked in Robo3T 1.1 under Mac OS X 10.12 and Windows 10. Closing this issue as can't reproduce. Feel free to re-open the ticket in case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment