adrian

Tracy Debugger

Recommended Posts

Hi @breezer - this is a good explanation of the problem: https://stackoverflow.com/questions/13734224/exception-serialization-of-closure-is-not-allowe

That link shows up as visited by me in google, so apparently I have come across this before but I don't remember the circumstances.

I actually just removed two serialize() calls from Tracy. There is one remaining in the core Tracy package that is used when logging an exception. I am not sure if this is the reason you are seeing it or not though.

Is this a new issue for you in 4.16.8?

Do you have any serialize() calls in your code anywhere? 

Could you check in the Tracy logs directory (site/assets/logs/tracy) to see if there are exceptions logged. 

Does it help if you modify the getExceptionFile() method where the serialize call is made: https://github.com/adrianbj/TracyDebugger/blob/b195d6ac40e146891151ac7b56590ba34eb03f7b/tracy-master/src/Tracy/Logger.php#L136 - you could empty out all this method and just return true or something like that to help narrow it down.

Let me know about these things and we'll go from there.

 

Share this post


Link to post
Share on other sites
Posted (edited)

EDIT: This has nothing to do with Tracy, I'm getting the same message with PW debug enabled so the issue is elsewhere. Thanks for your time.

Is this a new issue for you in 4.16.8?

To be honest I'm not sure, I didn't have it turned on lately and I upgraded this morning and noticed the message.

Do you have any serialize() calls in your code anywhere?

No I can't think of any but I'm going through all the files to check.

Could you check in the Tracy logs directory:

No files at all in the Tracy log directory.

I also made the getExceptionFile()  method only return true ( in module file and also checked filecompiler ) and still the message shows, so please don't waste any time on this as I have to assume it's something in my code somewhere. I'll look in all the files and see if I can figure it out.

Again Happy New Year and thanks for a super tool 🙂

Edited by breezer
After further investigation Tracy isn't involved
  • Like 1

Share this post


Link to post
Share on other sites

Just committed a nice little enhancement to the Adminer panel - it now loads the panel with the relevant table or row based on the current context. So if you are editing a page, it will load the row for that page. If you are editing a file, template, or viewing a module's config settings, it will do the same. If you viewing the main page list tree or the main templates/files/modules pages, these tables will be opened in browse mode.

Probably not something you'll use that often, but because the Adminer panel doesn't load anything until you open it, I like leaving it activated as one of my default panels so I always have really quick access to view whatever is in the DB for what I am currently working on.

Anyway, hope you all find it useful on occasion.

 

  • Like 5

Share this post


Link to post
Share on other sites

On a fresh PW 3.0.123 setup with a new Tracy v4.16.12 install, it look like `ApiExplorerIncludeInheritedMethods` is not defined in the array of the getDefaultData() method and this notice popup :

 

Quote

PHP Notice: Undefined index: apiExplorerIncludeInheritedMethods in .../modules/TracyDebugger/TracyDebugger.module.php:3801

  • Like 1

Share this post


Link to post
Share on other sites

I'm attempting to upgrade a site from 2.7.x to 3x, and one of the modules that i'm upgrading also is Tracy.

One major issue that anyone doing this upgrade will encounter is the legacy setting for coreBranch – if that is set on your initial install, then it will be stuck in 'stable' and cause require_once failed to open stream errors on tracy-stable/src.tracy.php;

the 2 ways to fix this are to either first just completely uninstall Tracy before upgrading, or to manually change that value in the database.

  • Like 1

Share this post


Link to post
Share on other sites

Thanks for the heads up on that @Macrura - it shouldn't be an issue in the latest version just committed.

  • Like 2

Share this post


Link to post
Share on other sites

Just got this error message:

Fatal Error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 25956352 bytes) (line 27 of M:\xampp\apps\processwire\htdocs\site-ncog\modules\TracyDebugger\tracy-master\src\Tracy\assets\Bar\panels.phtml)

Any idea what might have caused it or how to fix it?

I uninstalled the module and the error went away. After re-installing it, the error came back. The message at the bottom of the screen reads:

Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 10563584 bytes) in Unknown on line 0

Share this post


Link to post
Share on other sites

Hi @MarkE - can you please try to narrow it down to a specific panel using the panel selector to disable/enable until you figure it out. I expect it's probably the RequestInfo panel so I would start there. If it is the culprit, is it only on certain pages? You can adjust its settings to turn off some of the more intensive sections.

Share this post


Link to post
Share on other sites
1 hour ago, adrian said:

can you please try to narrow it down to a specific panel using the panel selector to disable/enable until you figure it out.

It seems to make no difference which panels are enabled (or even none). However, unchecking the "Show debug bar"  removes the error  from the front end or back end accordingly.

Share this post


Link to post
Share on other sites

That is weird - my local dev setup has 128MB memory limit for PHP and I don't have this issue. I guess your only solution would be to increase the limit in your php settings.

Share this post


Link to post
Share on other sites

I've just updated the PW search function in the PW Info panel to use the new website's search functionality for all sections, except the forum (where I still use Google) and of course the Github repo.

Hopefully you'll find this is nice shortcut to the new PW site search which is really great!

  • Like 3

Share this post


Link to post
Share on other sites
17 hours ago, adrian said:

I guess your only solution would be to increase the limit in your php settings.

Thanks, but as you say - it ought not to be necessary. Anyway, today it is working 🙂

  • Like 1

Share this post


Link to post
Share on other sites
2 hours ago, MarkE said:

Thanks, but as you say - it ought not to be necessary. Anyway, today it is working 🙂

Let me know if you notice issue again and can narrow it down to something that I can investigate.

Share this post


Link to post
Share on other sites
22 hours ago, adrian said:

Let me know if you notice issue again

Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 33764184 bytes) in M:\xampp\apps\processwire\htdocs\site-ncog\modules\TracyDebugger\tracy-master\src\Tracy\Helpers.php on line 133 Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 10530816 bytes) in Unknown on line 0

Share this post


Link to post
Share on other sites

@MarkE - is it all pages on the site, or just some?

Anyone else out there using xampp had any memory issues with Tracy? Did you have to bump up the PHP memory limit?

Share this post


Link to post
Share on other sites
2 hours ago, adrian said:

is it all pages on the site, or just some?

It seems to be all pages. It was fixed after a reboot last time. I'm inclined to blame windoze - that's the usual source of my problems. Meanwhile, I'll turn Tracy off until I need it then reboot again...

Share this post


Link to post
Share on other sites

... just having a root around - I seem to have 12mb session file - is that normal?

Share this post


Link to post
Share on other sites
4 hours ago, MarkE said:

... just having a root around - I seem to have 12mb session file - is that normal?

Where are you seeing this session file? In /site/assets/sessions? Is it related to Tracy somehow? Or are you referring to something else?

Share this post


Link to post
Share on other sites
10 hours ago, adrian said:

In /site/assets/sessions? Is it related to Tracy somehow?

Yes. I just mentioned it because it is very big and full of things like 

<span class="tracy-dump-indent">   |  |  </span><span class="tracy-dump-key">fuel</span> <span class="tracy-dump-visibility">protected</span> => <span class="tracy-dump-object" ...

I have no idea what it does.

Share this post


Link to post
Share on other sites

Tracy session data shouldn't stick around there - maybe there is a cleanup issue on windows/xammp. I actually think that given the errors you are seeing are in core Tracy files it might make sense for you to file a Github issue here: https://github.com/nette/tracy to see if they know what's going on.

Share this post


Link to post
Share on other sites

Just added a new Admin Actions panel - the available actions are context sensitive so you only get actions that are relevant to where you are in the admin (or frontend in some cases).

This is just a first version, but so far we have:

Delete field
If you're on the edit interface for a field, this action will let you delete a field even if it is already added to templates, so you don't have to deal with the "This field may not be deleted because it is in use by one or more templates." notice you get when trying to delete the field.

Change field type
Again, if you're on the edit interface for a field, this lets you change the field to any installed field type. This ignores the compatible field type check that you are normally subject to. This is probably not good to use if you already have page data in this field, but it's really handy when you have already set up a field and added it to templates but decide you want to change its type to a non-compatible type.

image.png.de23870903442f4a86d4f6fccae35d87.png

Delete template
Like the delete field, this bypasses the "This template may not be deleted" because there are pages already using it. This takes care of deleting any pages using the template and then deletes the template, all with one click.

image.png.8ebd2736a2f13773f07c23c644ea295d.png

Delete all children
This lets you delete all children of the current page without deleting the page itself which can be very helpful when you're testing API creation of page and you have forgotten to enable Tracy's Page Recorder panel.

image.png.0acbf048360cd9d7853911c9c6748086.png

Hopefully it goes without saying that these can be extremely destructive and bypass core protections against data loss so use with extreme caution. Each action has a confirmation dialog that you must confirm to reduce any accidental clicks and the entire panel is restricted to superusers only, but you must still use with extreme caution.

I'll add other actions as ideas come to me, but if you have any requests, please let me know.

  • Like 4

Share this post


Link to post
Share on other sites
3 hours ago, adrian said:

a new Admin Actions panel

Thanks as always, the new panel does sound useful indeed. However, you already have a module called Admin Actions. It might be confusing in some circumstances that these share the same name, don't you think?

Edited by szabesz
typo
  • Like 1

Share this post


Link to post
Share on other sites
3 minutes ago, szabesz said:

Thanks as always, the new panel does sound useful indeed. However, you already have a module called Admin Actions. It might be confusing in some circumstances that these share the same name, don't you think?

I'm not too worried about it, but I do see your point. I wasn't sure what else to call it at the moment. If you have a better idea, please let me know. Obviously this panel has has a few limited/restricted actions, so it's not meant to be a replacement for the Admin Actions module - just some quick shortcuts to a few things that I come across semi-regularly.

  • Like 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By anderson
      Hi all,
      I'm a new to website building. Learned some CRASH course of js,jquery,php. Then I found CMS. Still learning around forum, youtube....
      Anyway, please help me with some beginer questions:
      1, About template - please correct me if I understand wrong : every page should be (or recommended) built on a template. So if in total I'll have 10 pages, 2 of them have same layout, I'll need 9 templates.  And, what fields a page includes, is not defined in page, but defined in the template that page uses. 
      2,  Where to see what modules I've installed? is it in "Modules - Site"? 
      3, I installed "PageTable Extended", then what?  As in a youtube tutorial, it should appear in Setup tab, but it doesn't.  What's in there: templates,fields,logs,comments. (I installed "Uikit 3 site_blog profile".)
      4, I did a search in Processwire website for the famous "repeater matrix" module, and can not find it, there's a Repeater, as well as a Matrix. Is it not a module?
      5, I watched this youtube tuts: https://www.youtube.com/watch?v=IHqnLQy9R1A
      Anybody familiar with this tuts please help: 
      After he analysed a target webpage layout he wanted to mimic, he created some fields, some template, then based on those he created a page and input some "content" in there, then clicked "view", it's just some text. So, here comes my question, he copied a folder "assets" (subfolders are: css,fonts,js,img) over, then the page have the appearance/layout he wanted to mimic. Where does that assets folder come from?
      Appreciate any help.
    • By mtwebit
      I've created a set of modules for importing (manipulating and displaying) data from external resources. A key requirement was to handle large (100k+) number of pages easily.
      Main features
      import data from CSV and XML sources in the background (using Tasker) purge, update or overwrite existing pages using selectors user configurable input <-> field mappings on-the-fly data conversion and composition (e.g. joining CSV columns into a single field) download external resources (files, images) during import handle page references by any (even numeric) fields How it works
      You can upload CSV or XML files to DataSet pages and specify import rules in their description.
      The module imports the content of the file and creates/updates child pages automatically.
      How to use it
      Create a DataSet page that stores the source file. The file's description field specifies how the import should be done:
      After saving the DataSet page an import button should appear below the file description.

      When you start the import the DataSet module creates a task (executed by Tasker) that will import the data in the background.
      You can monitor its execution and check its logs for errors.

      See the module's wiki for more details.
      The module was already used in three projects to import and handle large XML and CSV datasets. It has some rough edges and I'm sure it needs improvement so comments are welcome.
    • By dreerr
      TemplateEnginePug (formally TemplateEngineJade)
       
      This module adds Pug templates to the TemplateEngineFactory. It uses https://github.com/pug-php/pug to render templates.
      doctype html html(lang='en') head meta(http-equiv='content-type', content='text/html; charset=utf-8') title= $page->title link(rel='stylesheet', type='text/css', href=$config->urls->templates . 'styles/main.css') body include header.pug h1= $page->title if $page->editable() p: a(href=$page->editURL) Edit Project on GitHub: github.com/dreerr/TemplateEnginePug
      Project in modules directory: modules.processwire.com/modules/template-engine-pug/
       
      For common problems/features/questions about the Factory, use the TemplateEngineFactory thread.
       
    • By Robin S
      Pages At Bottom
      Keeps selected pages at the bottom of their siblings.
      A "bottom page" will stay at the bottom even if it is drag-sorted to a different location or another page is drag-sorted below it (after Page List is refreshed the bottom page will still be at the bottom).
      Newly added sibling pages will not appear below a bottom page.
      The module also prevents the API methods $pages->sort() and $pages->insertAfter() from affecting the position of bottom pages.
      Note: the module only works when the sort setting for children on the parent page/template is "Manual drag-n-drop".
      Why?
      Because you want some pages to always be at the bottom of their siblings for one reason or another. And someone requested it. 🙂
      Usage
      Install the Pages At Bottom module.
      Select one or more pages to keep at the bottom of their siblings. If you select more than one bottom page per parent then their sort order in the page list will be the same as the sort order in the module config.

       
      https://github.com/Toutouwai/PagesAtBottom
      https://modules.processwire.com/modules/pages-at-bottom/
    • By Robin S
      Another little admin helper module...
      Template Field Widths
      Adds a "Field widths" field to Edit Template that allows you to quickly set the widths of inputfields in the template.

      Why?
      When setting up a new template or trying out different field layouts I find it a bit slow and tedious to have to open each field individually in a modal just to set the width. This module speeds up the process.
      Installation
      Install the Template Field Widths module.
      Config options
      You can set the default presentation of the "Field widths" field to collapsed or open. You can choose Name or Label as the primary identifier shown for the field. The unchosen alternative will become the title attribute shown on hover. You can choose to show the original field width next to the template context field width.  
      https://github.com/Toutouwai/TemplateFieldWidths
      https://modules.processwire.com/modules/template-field-widths/