Coder Social home page Coder Social logo

Comments (10)

gevorgmansuryan avatar gevorgmansuryan commented on September 2, 2024 1

@luke- will try to reproduce/understand

from custom-pages.

marc-farre avatar marc-farre commented on September 2, 2024 1

@luke- will try to reproduce/understand

Thanks @gevorgmansuryan ! Don't hesitate if I can help.

from custom-pages.

marc-farre avatar marc-farre commented on September 2, 2024 1

@gevorgmansuryan It works with these changes (the bug is gone)!

I tested 3 cache types:

  • No caching: no bug
  • File: the bug occurs
  • APCu: no bug (but cannot be used when more than 1 Humhub instance is installed on the same server)

The bug occurs only on this server, for all Humhub instances installed on it.
So it's a problem of cache with this server (but that occurs on other servers too as we have this bug mentionned on #86 and #74).

I've checked all server settings with the doc, and "Administration" -> "Information" -> "Prerequisites". Everything seems ok.
Config: Ubuntu 20.04 / PHP 7.4 / mod_php

I've done the folowing test in command line (Controller extending yii\console\Controller):

        echo Yii::$app->cache->get('test_key');
        Yii::$app->cache->set('test_key', 'test value');

At the second execution, the "test value" is shown. So caching works.

Thanks for your investigation!

from custom-pages.

marc-farre avatar marc-farre commented on September 2, 2024 1

@gevorgmansuryan have you got an idea how to fix this problem without having to add code in the core ModuleAutoLoader class or to enable debug? Thanks!

If it can help, we can have a video call with screen sharing.

from custom-pages.

luke- avatar luke- commented on September 2, 2024

@gevorgmansuryan Any idea?

from custom-pages.

gevorgmansuryan avatar gevorgmansuryan commented on September 2, 2024

@funkycram thank you. Can you please try to reproduce, and see what jobs are executing. It will help me to find job that using cache incorrectly (uses yii\WEB\UrlRule from cli). 99% it is related to UrlRules caching.

from custom-pages.

marc-farre avatar marc-farre commented on September 2, 2024

@gevorgmansuryan the bug doesn't occurs with jobs, but when executing a command line with SSH, e.g. php yii queue/run -v, but it occurs with any command, except php yii cache/flush-all

I can reproduce only on Humhub instances on production (where many people are using the platform during my tests). If I clone the humhub to have a dev instance, I cannot reproduce the bug, and the only difference I can see is that nobody is using the dev instance.

I have 2 ways to solve the bug:

  • waiting for the next cron job (the queue/run every minute)
  • flushing the cache by executing the php yii cache/flush-all command

In the settings, "Cache Backend" is set to "File".

from custom-pages.

gevorgmansuryan avatar gevorgmansuryan commented on September 2, 2024

@funkycram yeah, i know that it's doesn't occurs with jobs. There is some job or command that calls/uses Web/UrlManager and stores incorrect cache of Rules. Since i can not reproduce it anyway, there is no other chance to reproduce it and find the problem.
We can try to:

  • move urlManager config keys from common.php to web.php and try to run commands/queue and see what will happen. Most probably we'll see the error in file which uses UrlManager
  • try the same with enabled debug mode

from custom-pages.

marc-farre avatar marc-farre commented on September 2, 2024

@gevorgmansuryan thanks for you suggestions.
In the 'components` section, I moved

        'urlManager' => [
            'showScriptName' => false,
            'enablePrettyUrl' => true,
        ],

from common.php to web.php.

The problem is still there.

Then, in /index.php, I uncommented defined('YII_DEBUG') or define('YII_DEBUG', true); (only this line, not the YII_ENV one).
This solves the problem.

I tried commenting it and uncommenting it again, and this is really what makes the difference systematically.

from custom-pages.

gevorgmansuryan avatar gevorgmansuryan commented on September 2, 2024

@funkycram interesting :) Can you please comment back YII_DEBUG line, change line 47 from protected/humhub/components/bootstrap/ModuleAutoLoader.php to if (true || $modules === false || YII_DEBUG) { and try again?

from custom-pages.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.