-
Notifications
You must be signed in to change notification settings - Fork 344
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
xhgui: document to insert contains invalid key: keys cannot contain "." #209
Comments
Same error on a debian server... |
Sounds like at some point mongo has changed what is valid in keys. I'm still using an old mongo (2.2.4). If |
Ran in same issue just now. Everywhere I search, only workaround is to modify keys before saving - in this specific case doesn't sound too possible. Using mongo 2.6.10 As far I have found there is no setting to turn this key check off. |
This is odd. I'm using MongoDB 3.0.14 and have no such issue. Do note that top-level keys probably cannot contain such a profile, this must be stored in a lower level key! e.g. you cannot have
but
is valid, at least from what I understand and what I see in my database. I encountered a similar error and it turned out I was creating the profile object wrong. |
Can you please post the full document at the time of insert (use debugger?) |
@lauripiisang do I understand correctly, you wish to see $data content just before Just as side-note - noticed that this exception happens only when I use auto_append in server (nginx) config. If I disable auto_append and try to encompass code with
|
That would do, but I'd prefer the document submitted to mongo (deeper down the call stack).
With header.php, you're supposed to be using Can I ask you to try out https://github.com/perftools/xhgui-collector in your project and see if you still encounter problems? I use the
I think what's different here is that you don't have the |
I think I can get the profiling library I developed open-sourced so you can have an easier time at using this. |
I have the same issue. This is the output for the $data variable that will be saved to Mongo:
Mongo version: v2.4.14 |
Had the issue, fixed it by encoding the stored profile. Current environment |
Thanks @samt2497 Closing as there is a pull request open now. |
Well, I found the reason why it worked for some and didn't work for others: https://jira.mongodb.org/browse/PHPC-712 seems to have been a bug in the adapters causing the ignorance of said dot-check. That is to say, the documents could still be inserted, just not updated afaik. While @samt2497 -s provided unicode-based encoding-decoding solution is a band-aid for now, I think a long term solution should include solving the problem by restructuring the data. I propose moving from {
"profiles": {
"main()==>load::shop/test.php" : {
"ct" : 1
}
} to {
"profiles": {
"some-uuid-here-1234" : {
"stackName" : "main()==>load::shop/test.php",
"ct" : 1
}
} This preserves the possibility to view a sub-key on its own and avoids the dots-in-keys problem. Suggestions welcome for |
Reopening issue to get some opinions on the data restructure solution. |
If we have to restructure the data should we also consider moving away from mongodb entirely? A few features like multi domain support and ad hoc queries are more complex because of mongo. Furthermore the awkward datetime handling and limited set of aggregation functions limit our ability to offer dashboards and summary data. |
@markstory The sysadmin finally managed to get around the bug and install xhgui, and it looks excellent. |
For what it's worth, I have a private fork of XHGUI that uses MySQL. I'm storing the data in MySQL in a separate project, and XHGUI is just reading off that table. To do this I tried to abstract the data storage away as much as possible, so one could "switch" to a different storage driver using the config file. Not everything is supported with this MySQL abstraction though, such as some of the aggregation, searching & filtering tools. But it works great to just load up individual profiles. Overall, I think having XHGUI be built in a way that developers can implement their own storage drivers (memcached, redis, S3, etc.) would be great. I also added an authentication system. That might be best kept as a separate PR though. If I get some time I can try to clean up & push my changes back to XHGUI. I would love for the project to be converted to full PSR-4 and PSR-2 coding standard as well just to keep consistent and have better class names. |
For anyone experiencing this issue, I was able to make it work by adding the following snippet of code to
|
@dhampik is your fix require some more manipulations? It showing all available profilings list as well, but when i click on some of them I'm getting error:
|
@bogdan-dubyk no, only the change that I wrote. |
@dhampik thank you. Worked for me. |
It worked for me, thank you. |
See perftools/xhgui#209 (comment) `invalid document for insert: keys cannot contain ".": "main()==>load::admin/index.php"`
this way is so cool |
Now Ive encountered this myself as well. with ZF1 the autoloader entries look like this:
|
For everybody there seems to be "load::" in call stack, I also have "run_init::" prefixes. I wonder it's xhprof quirk or something? My data is from PHP 5.3 and xhprof 0.9.4 |
indeed, it's present in xhprof 0.9.4 extension. these code paths add filenames to call tree, and filenames obviously can contain the dot:
later removed for 2.x (new maintainer): however "load::" is still present: |
Re: #209 (comment) @michaelbutler still there? have you considered sending PRs of your changes? over the time this project has got pdo support, but it's not complete either: |
@glensc I haven't updated the project in quite a while but if I get a chance I'll try the latest version with PDO and see if I have anything to add |
Hi there
I'm trying to install xhprof +xhgui, but something is not working with mongoDB. After a full setup, when I browse a page on my project, I'm getting errors in apache logs saying:
(I haven't been able to find any similar ticket issues for xhgui on this specific topic)
I'm using:
Is there something wrong with my setup?
Thanks!
The text was updated successfully, but these errors were encountered: