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

GeorgRinger\News\Domain\Model\News::isEvent could not be identified #102

Open
Zillion01 opened this issue Jul 31, 2020 · 21 comments
Open

GeorgRinger\News\Domain\Model\News::isEvent could not be identified #102

Zillion01 opened this issue Jul 31, 2020 · 21 comments

Comments

@Zillion01
Copy link

The type of property GeorgRinger\News\Domain\Model\News::isEvent could not be identified, as property isEvent is unknown to the TYPO3\CMS\Extbase\Reflection\ClassSchema instance of class GeorgRinger\News\Domain\Model\News. Please make sure said property exists and that you cleared all caches to trigger a new build of said TYPO3\CMS\Extbase\Reflection\ClassSchema instance.

This error occurs every couple of page loads..

TYPO3 10.4.6
News 8.3.0
Eventnews 4.0.0

@Zillion01 Zillion01 changed the title The type of property GeorgRinger\News\Domain\Model\News::isEvent could not be identified, as property isEvent is unknown to the TYPO3\CMS\Extbase\Reflection\ClassSchema instance of class GeorgRinger\News\Domain\Model\News GeorgRinger\News\Domain\Model\News::isEvent could not be identified Jul 31, 2020
@kazsats
Copy link

kazsats commented Aug 4, 2020

Got the same error randomly.

Core: Exception handler (WEB): Uncaught TYPO3 Exception: #1580056272: The type of property GeorgRinger\News\Domain\Model\News::isEvent could not be identified, as property isEvent is unknown to the TYPO3\CMS\Extbase\Reflection\ClassSchema instance of class GeorgRinger\News\Domain\Model\News. Please make sure said property exists and that you cleared all caches to trigger a new build of said TYPO3\CMS\Extbase\Reflection\ClassSchema instance. | TYPO3\CMS\Extbase\Persistence\Generic\Mapper\Exception\NonExistentPropertyException thrown in file /html/typo3/typo3_src-10.4.6/typo3/sysext/extbase/Classes/Persistence/Generic/Mapper/DataMapper.php in line 256.

Clearing cache let it work just a while

Typo3 10.4.6
PHP 7.2
News 8.3.0
Eventnews 4.0.0

@Zillion01
Copy link
Author

Clearing cache let it work just a while

Indeed. Anyone an idea? Really irritating crash bug.

@rasgor
Copy link

rasgor commented Sep 11, 2020

Same here,

TYPO3 10.4.8
PHP 7.3
News 8.4.0
Eventnews 4.0.0

After composer dump-autoload I can exactly display the news records for 1 time. After another reload it crashes.

@bribbelbum
Copy link

Hi,

Did you make update from TYPO3 8 or 9 to 10? If you load the following typoscript code anymore it could throw this error. This code musst be remove. If this code be loaded, you can easily watch with the typoscript object browser of the template module.

config.tx_extbase { objects { GeorgRinger\News\Domain\Model\Tag { className = Clickstorm\CsNewsExtend\Domain\Model\Tag } } persistence { classes { Clickstorm\CsNewsExtend\Domain\Model\Tag { mapping { tableName = tx_news_domain_model_tag } } } } }

Hope this helps.
Björn

@rasgor
Copy link

rasgor commented Sep 11, 2020

In my case it is a freshly installed TYPO3 10 without old stuff. Currently I fixed it doing a downgrade of EXT:news from 8.4 to 8.3 and I'am not getting this error anymore.

@kazsats
Copy link

kazsats commented Sep 14, 2020

Also a fresh Typo3 10 without this typoscript snippet @bribbelbum

@bitmotionAE
Copy link

Has anyone found a solution yet? I get the same error randomly a while after having cleared the cache.

@flolanger
Copy link

I can confirm this issue is still present. For me, it only occurs so far when I clear the cache via TYPO3 Console (cli user). Can anyone help?

@krausandre
Copy link

Same here, got that error on two different systems.

@georgringer
Copy link
Owner

can you test this patch of news which would fix it? https://github.com/georgringer/news/compare/feature/cacherebuilding?expand=1 thx for feedback

@flolanger
Copy link

@georgringer I've tested the changes above, but sadly that didn't fix the problem. Same behavior as before (tested on same instance).

@georgringer
Copy link
Owner

The system cache needs to be cleared at least once before this should work

@flolanger
Copy link

@georgringer Yes, I did that. Also multiple times including normal backend cache clear and install-tool cache clear.

@kazsats
Copy link

kazsats commented Mar 16, 2021

Unfortunately i get also still the exception:

  • updated news to 8.5.2,
  • included the fix,
  • cleaned/flushed/rebuild cache/autoload etc
    but nah.

@machwert
Copy link

machwert commented Apr 23, 2021

Does a workaround exist? Downgrading news to 8.3.0 (suggested by @rasgor) does not help in my case.

I use TYPO3 10, news 8.3.0 and eventnews 4.0.0.

@georgringer
Copy link
Owner

yes use master of ext:news

@machwert
Copy link

Thanks georgringer.

Unfortunately it didn't help. I updated news to 8.5.2 from master.

I still get the isEvent-Errors (every couple of hours) and this new error:
Core: Exception handler (WEB): Uncaught TYPO3 Exception: #1334756737: The temporary cache file "/typo3temp/var/cache/code/di/608a6f7fa1897579682971.temp" could not be written. | TYPO3\CMS\Core\Cache\Exception thrown in file /typo3cms/typo3_src-10.4.12/typo3/sysext/core/Classes/Cache/Backend/SimpleFileBackend.php in line 232. Requested URL: https://www.test.de/autodiscover/autodiscover.xml

The isEvent error looks like this:
The type of property GeorgRinger\News\Domain\Model\NewsDefault::isEvent could not be identified, as property isEvent is unknown to the TYPO3\CMS\Extbase\Reflection\ClassSchema instance of class GeorgRinger\News\Domain\Model\NewsDefault.

@Zillion01
Copy link
Author

Might be connected to https://forge.typo3.org/issues/75399 , sometimes the mapping is not available.

Maybe just avoid using the model in the code and use QueryBuilder with a viewHelper to fix this problem quickly.

Anyways I don't use this extension anymore and made some own code on top of EXT:News

@vertexvaar
Copy link

vertexvaar commented May 5, 2021

Current investigation progress (Anatomy of a page request):

  • Clearing the cache with typo3_console removes the DI Container
  • Reloading any TYPO3 FE/BE page will recreate the DI Container and therefore scan all directories in all Services.yml.
  • The DI Container resource scanning will trigger autoloading of classes, including \GeorgRinger\News\Domain\Model\News.
  • EXT:news/ext_localconf.php was not included at this point, so the ClassCacheManager::reBuild could not have been triggered.
  • If the reloaded page contains any Extbase Plugin TYPO3 will execute that Plugin, which interacts with Extbase
  • Extbase misses the ClassSchema and attempts to rebuild it.
  • Since the News class was already loaded during DI Container rebuild it will not be loaded anymore and ClassCacheManager::reBuild will not be called. The ClassSchema will be built with the original News class.

Clearing the Cache in the Backend will not remove the DI Container. The next time any EXT:news class will be loaded the News autoloader will be already available and generate the "proxy class".

Solution proposal:

  • I'm working on it.

@vertexvaar
Copy link

So here's my proposal for a quick fix:

Exclude the models from the DI Container in EXT:news' Services.yaml.

  GeorgRinger\News\:
    resource: '../Classes/*'
    exclude: '../Classes/Domain/Model/*'

Impact on this issue:
The News class will not get autoloaded during Container building/dumping. The first autoload attempt of this class will occurr after the News ClassLoader was registered.

Side effects: Well,... probably none. I haven't found any other bugs since but didn't test in depth, but it is bad practice to include Models in the DI Container anyway (I am aware that the TYPO3 documentation does not reflect this).
The equivalent of Domain/Model in Symfony is Entity and that folder is excluded by default.

@georgringer Can you please confirm that this change does not break anything?

@machwert
Copy link

Thanks a lot @vertexvaar!
The error is gone with your proposed changes in EXT:news' Services.yaml.

vertexvaar added a commit to vertexvaar/news that referenced this issue May 17, 2021
Domain models should not be scanned during DI Container building, since
entities are not meant to be services. The actual bug that results of
this missing configuration line is an exception which ocurrs when
the extbase ClassSchema is built in the same request as the DI Container
scanned all classes.
The issue this PR targets is georgringer/eventnews#102
georgringer pushed a commit to georgringer/news that referenced this issue May 20, 2021
Domain models should not be scanned during DI Container building, since
entities are not meant to be services. The actual bug that results of
this missing configuration line is an exception which ocurrs when
the extbase ClassSchema is built in the same request as the DI Container
scanned all classes.
The issue this PR targets is georgringer/eventnews#102
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

10 participants