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

infinite loading #33

Closed
MayhemBill opened this issue May 21, 2020 · 37 comments
Closed

infinite loading #33

MayhemBill opened this issue May 21, 2020 · 37 comments
Assignees

Comments

@MayhemBill
Copy link

MayhemBill commented May 21, 2020

hosting my own instance, for some reason when I open a new page, it seems to load indefinitely, followed install instructions, and if I refresh the page, the loading circle goes away, and I can use the site normally, but I can't seem to recreate this on the demo site.

EDIT: I cannot use the site normally on some pages, such as the goals page, I cannot add a new goal.

is there a difference between using a release and using a standard git clone?

@Volmarg
Copy link
Owner

Volmarg commented May 22, 2020

Hello,

So this EDIT: is this case also happening on demo or only on Your instance?

Are you using it on chrome?
Can You check if there are some errors in Your browser console?

There might be few differences and things to check:

  • I generaly have the main (master) branch state on demo (but maybe 15 commits behind), so maybe there is something that works on my dev but will crash on demo,
  • I would suggest You to turn the APP_DEBUG = true and then keep an eye for errors in requests in console.

@Volmarg Volmarg self-assigned this May 22, 2020
@Volmarg
Copy link
Owner

Volmarg commented May 22, 2020

I've just cloned the main branch, ran composer install, created user, logged in and added goal so I wonder what errors You got.

In case of no errors in chrome dev tool - please check also the backend logs.

@MayhemBill
Copy link
Author

okay so I am running it on Chrome, I cannot reproduce these issues on the demo, I tried creating a goal after restarting the server and making a goal works, the site seems to work fine except I have to reload it constantly from browser, I'll try the app_debug = true and see if I can find the issue.

@MayhemBill
Copy link
Author

prod.deprecations.log
prod.log
prod.security.log
dev.log

I've provided logs here, I don't really understand whats going on too much, but it doesn't look great.

@Volmarg
Copy link
Owner

Volmarg commented May 22, 2020

Ok so, You have at least one problem to fix on Your side.

[2020-05-21 22:37:30] request.CRITICAL: Uncaught PHP Exception Twig\Error\RuntimeError: "An exception has been thrown during the rendering of a template ("An exception occurred while executing '           SELECT              mnc.name AS category,             mnc.icon AS icon,             mnc.color AS color,             mnc.id AS category_id,             mnc.parent_id AS parent_id,              ( -- get children categories                SELECT GROUP_CONCAT(DISTINCT mnc_.id)                FROM my_note_category mnc_                WHERE mnc_.parent_id = mnc.id                AND mnc_.parent_id IS NOT NULL               ) AS childrens_id           FROM my_note mn           JOIN my_note_category mnc                         WHERE mn.deleted  = 0             AND mnc.deleted = 0            GROUP BY mnc.name         ':  SQLSTATE[42000]: Syntax error or access violation: 1055 Expression #2 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'management.mnc.icon' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by")." at /var/www/personal-management-system/templates/page-elements/components/sidebar/menu-nodes/notes.twig line 31 {"exception":"[object] (Twig\\Error\\RuntimeError(code: 0): An exception has been thrown during the rendering of a template (\"An exception occurred while executing '\n          SELECT \n            mnc.name AS category,\n            mnc.icon AS icon,\n            mnc.color AS color,\n            mnc.id AS category_id,\n            mnc.parent_id AS parent_id,\n             ( -- get children categories\n               SELECT GROUP_CONCAT(DISTINCT mnc_.id)\n               FROM my_note_category mnc_\n               WHERE mnc_.parent_id = mnc.id\n               AND mnc_.parent_id IS NOT NULL\n              ) AS childrens_id\n          FROM my_note mn\n          JOIN my_note_category mnc\n            \n\n          WHERE mn.deleted  = 0\n            AND mnc.deleted = 0\n\n          GROUP BY mnc.name\n        ':\n\nSQLSTATE[42000]: Syntax error or access violation: 1055 Expression #2 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'management.mnc.icon' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by\"). at /var/www/personal-management-system/templates/page-elements/components/sidebar/menu-nodes/notes.twig:31, Doctrine\\DBAL\\Exception\\DriverException(code: 0): An exception occurred while executing '\n          SELECT \n            mnc.name AS category,\n            mnc.icon AS icon,\n            mnc.color AS color,\n            mnc.id AS category_id,\n            mnc.parent_id AS parent_id,\n             ( -- get children categories\n               SELECT GROUP_CONCAT(DISTINCT mnc_.id)\n               FROM my_note_category mnc_\n               WHERE mnc_.parent_id = mnc.id\n               AND mnc_.parent_id IS NOT NULL\n              )

Exactly here

GROUP BY clause and contains nonaggregated column 'management.mnc.icon' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by\")

Please follow this point in my documentation:

@Volmarg
Copy link
Owner

Volmarg commented May 22, 2020

With APP_ENV set to dev You should be able to generate another log
image
If this fix with mysql wont work then please turn Dev env and recreate that issue on Your self hosted instance.

Warning do not instert any personal data with this as log will contain all the inserts etc, exceptions on mysql side etc.

@Volmarg
Copy link
Owner

Volmarg commented May 22, 2020

Also please check if You have some 400+/500 error codes when creating the goal as this is happening via ajax. If You will see some error (red) then click on it, also try preview and send me the results.

  • Chrome dev tool:
    image
    image

also in other tab check for some js errors (red)
image

@MayhemBill
Copy link
Author

Fixed the issue with mysql, didn't help.

I have no new logs and no errors in CDT

@MayhemBill
Copy link
Author

you can test out my instance here: division25.xyz with admin/admin

maybe you can figure out what I can't.

@Volmarg
Copy link
Owner

Volmarg commented May 22, 2020

It wont let me in with admin/admin
Invalid credentials.

Also please make sure that You got dev dependencies also installed, just make sure You got profiler package in the vendor and u got ENV dev with Debug on, this will help me.

@MayhemBill
Copy link
Author

ah you are correct, it's mayhem/admin

also as far as I can tell I do have profiler installed and debug on

@Volmarg
Copy link
Owner

Volmarg commented May 22, 2020

lI just created

  • goal visible on dashboard,
    • subgoal to this
  • goal not visible on dashboard,
  • note category,
    • with note in that category

Had no errors.

My tests were ran in:
Chrome 72.0.3626.119 Incognito mode

Can You check that in Incognito mode then as well? Maybe You got some plugin which breaks something.

@MayhemBill
Copy link
Author

okay, so from what I can tell, it seems to have something to do with going to goals, or dashboard, and them not loading correctly, looking in Doctrine

App\Entity\Modules\Goals\MyGoals | The mappings App\Entity\Modules\Goals\MyGoals#mySubgoal and App\Entity\Modules\Goals\MyGoalsSubgoals#myGoal are inconsistent with each other.
-- | --
App\Entity\Modules\Goals\MyGoalsSubgoals | The association App\Entity\Modules\Goals\MyGoalsSubgoals#myGoal refers to the inverse side field App\Entity\Modules\Goals\MyGoals#myGoal which does not exist.

I see this, if I avoid goals/list and dashboard, the site works fine otherwise.

@Volmarg
Copy link
Owner

Volmarg commented May 22, 2020

Yeah that's what there is in the profiler but i also got this in my dev. This cannot be the issue as Your instance, my dev, my prod work fine for me.

I thinks this has something to do with Your environment.

Can You check it on other browsers but all in incognito/private?

@MayhemBill
Copy link
Author

the same thing happens in incognito in Chrome.

@Volmarg
Copy link
Owner

Volmarg commented May 22, 2020

What version of chrome are You using?

@MayhemBill
Copy link
Author

Version 83.0.4103.61

@Volmarg
Copy link
Owner

Volmarg commented May 22, 2020

Ok, so I will check that out tommorow on windows. I have older version on Linux

@Volmarg
Copy link
Owner

Volmarg commented May 22, 2020

But now that i think. It still makes no sense.

You are playing with demo with the same browser and there are no such problems.

Anyway will think tommorow. This is interesting case.

@Volmarg
Copy link
Owner

Volmarg commented May 23, 2020

Like i thought - no sense as with latest chrome version works also fine on windows.

I have actually other idea.
While keeping the Dev Tool open, go to some page which is loading endlesly and check the tab Network. Watch if there is some endleslly running request, i used to have such problem on my dev instance when i keept debugger on and this slowed down each ajax call badly.

@MayhemBill
Copy link
Author

No long running requests, but it seems like the requests get cut short, as if they don't load at all

@Volmarg
Copy link
Owner

Volmarg commented May 23, 2020

I assume that You still got 200 for that requests.

  • I can't even consider chown/chmod as these would return 400+/500.
  • It cannot be cache as data is cached in one dir and then served for You and for me.
  • No network issues, no js issues, no browser based issue.
  • No frontend issues/no backend issues, no exceptions.

I got 3 more idea, - let's go with the most simple one:

  • if the spinner won't dissapper,
  • open the browser console, type that in:
    ui.widgets.loader.hideLoader();

there is also method responsible for showing it:
ui.widgets.loader.showLoader();

Check if after hiding loader - it works correctly.
I mean the point is if the loader is the only problem, if the page in browser finish loading (X near search bar) and the spinner is there then this is a bit other issue.

Now if this will work, with hiding spinner manually then it will give me some hint.

@Volmarg
Copy link
Owner

Volmarg commented May 23, 2020

I mean, i had a one case... very rare thing where 1st ajax calls interfered and spiner was never shown for next call. Maybe this is case the other way around.

@MayhemBill
Copy link
Author

it hides the loader and I can continue on normally.

@Volmarg
Copy link
Owner

Volmarg commented May 23, 2020

Ok so i will take a look in free time if I maybe have some case with showLoader() without hide but i doubt it as it works fine on demo/dev/prod. Eventually You can zoom the network tab loading graph and see if there are some 2 interfering ajax calls - i wonder how is this possible but it might be the case.

Or there is indeed bug which returns 200, yet falls into some js if which has no hide. Also possible.

@MayhemBill
Copy link
Author

is there something I can do in the meantime other than having to manually open console and send that command everytime?

I plan on putting this on a touch screened pi that won't have a keyboard so it'll make it a bit difficult to paste it all the time

@Volmarg
Copy link
Owner

Volmarg commented May 23, 2020

Well there is a dirty temporary workaround solution for this, but You need to make sure if all works fine after that, cuz in worst case js might scream that dom element was not found and will break all front logic.

Open file:

templates/base.html.twig

Go to line:
102-104

Remove:

<div id='loader'>
    <div class="spinner"></div>
</div>

go to CLI and run:
sudo -u www-data bin/console cache:clear
and
sudo -u www-data bin/console cache:warmup

You can do this after turning env back to prod to hide the dev profiler.

It might just work.

@MayhemBill
Copy link
Author

MayhemBill commented May 23, 2020

that didn't fix the issue either. now the spinner is just stuck on the screen, but doesn't seem to do anything. I can still work around normally.

@Volmarg
Copy link
Owner

Volmarg commented May 23, 2020

This is really something, i just removed loader from dom on demo in dev tool and then opened some pages alongside with calling the hide/show and spinner is no more there.

You are sure that cache clearing went fine?

@MayhemBill
Copy link
Author

yes it did, I got no errors on my end

@MayhemBill
Copy link
Author

just to compare, what version of node and npm are you using?

@Volmarg
Copy link
Owner

Volmarg commented May 23, 2020

Can't answer that question now as I'm on windows now and my dev is on linux - ain't going on linux today anymore.

But node/npm should've nothing to do with this unless... You called --watch, production with webpack then it might've broken the output files, otherwise there is just one big output compiled bundle.

@MayhemBill
Copy link
Author

there were some errors with nodesass, I was just curios if maybe that had something to do with it, it fell back to a binary and claimed all was okay, but I wasn't sure if that had maybe caused an issue. if you manage to figure out which node you are using let me know so I can double check against what I am using.

@Volmarg
Copy link
Owner

Volmarg commented May 23, 2020

Check this: https://volmarg.github.io/developer-mode/

NodeJS - on disco dingo installing NodeJS via package manager didn't worked well. Generally it's recommended to use NodeJS 9, but this solution also worked:

good luck - im out for today. I wonder what's going on anyway.

@MayhemBill
Copy link
Author

I have fixed the issue, it's node 12. I downgraded back to node 10, rebuilt PMS and the infinite loading is gone.

@Volmarg
Copy link
Owner

Volmarg commented May 24, 2020

Oh, so You did compiled the Output js/css anew with webpack. This makes sense now as i Also provide both bundles for production.

@MayhemBill
Copy link
Author

Well if I compiled with node 12 it errors out, I did this several time just confirm, then switched to node 10 and did it a few more times and it work every single time I tried it.

It seems a couple packages either aren't compatible with node 12, or it's just one that messes up the rest of the build.

Either way I'm closing this issue, and I'd like to thank you for taking so much time to try to help me figure it out.

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