Project

General

Profile

Actions

Bug #47726

closed

EM: PHP Fatal error on trying to get extension list from TER

Added by Bernd Wilke almost 11 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Must have
Category:
Extension Manager
Target version:
-
Start date:
2013-04-30
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
6.1
PHP Version:
5.3
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

fresh blankpackage install (6.1.0rc1) -> Extension Manager -> switch to 'Get Extensions'.

inside TYPO3-BE: flash-msg:

Update Extension List
error(Internal Server Error):
(no more information)

in apache-Log:

PHP Fatal error:  Call to a member function format() on a non-object in /var/www/typo3_src-6.1.0rc1/typo3/sysext/extensionmanager/Classes/ViewHelpers/TimeSinceLastUpdateViewHelper.php on line 40, referer: .../typo3/mod.php?M=tools_ExtensionmanagerExtensionmanager&tx_extensionmanager_tools_extensionmanagerextensionmanager%5Baction%5D=ter&tx_extensionmanager_tools_extensionmanagerextensionmanager%5Bcontroller%5D=List


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #49131: If there was no update of repository yet, TimeSinceLastUpdateViewHelper will throw fatal errorClosedAlexander Opitz2013-06-14

Actions
Actions #1

Updated by Alexander Opitz almost 11 years ago

  • Status changed from New to Needs Feedback

Are there maybe log entries with "Warning"/"Notice" before this Fatal Error?

Actions #2

Updated by Sven Teuber almost 11 years ago

Strange. Tried again to get a fresh logfile output - works now without errors.

Was the TER down today? Could that throw the error Bernd posted here?

Actions #3

Updated by Bernd Wilke almost 11 years ago

after I wrote my ticket yesterday I got the 6.1.0 final (before announcement) and after installation I got the extension list (so I thought it had been fixed)
but today I try to install a 6.0 and a 6.1 on another server I get for both systems the error.
(and there are no warnings or notices)

after multiple retries the 6.1 installation got the list at the end, while the 6.0 still producing the error.

Actions #4

Updated by Peter Murray almost 11 years ago

Possibly related:

Trying to execute a scheduled task to update the extension list gives:
Execution of task "Update extension list (extensionmanager)" failed with the following message: Unable to open file resource compress.zlib:///.../typo3temp/1.mirrors.xml.gz.

Touching /.../typo3temp/1.mirrors.xml.gz (so it exists) and a retry of the scheduled task gives:
Execution of task "Update extension list (extensionmanager)" failed with the following message: Could not access remote resource http://extensions.xml.gz.

Actions #5

Updated by Philipp Gampe almost 11 years ago

try again with curlUse = 1

Actions #6

Updated by Andreas Becker (Andi) almost 11 years ago

Updating Extension List in Blank Package 6.1 - fresh Install:

In reports it says:
Update status of typo3.org main repository extension list
Error
The typo3.org extension repository was not found. Please import the main typo3.org extension repository in the install tool wizard.

But exactly this is not possible!

System Environment Check
everything is green!

Scheduler Task to update the extension list created and executed:
Result - it is running and running and running and does not seem to stop running!

Curl enabled/disabled both times networking

Updating from within Extension Manager does not work. Other sides on the same server have no problem to connect to the TER

Actions #7

Updated by Wouter Wolters almost 11 years ago

Please try the given solution. You need to insert the repository. This can be done in the Install Tool -> Database compare

Actions #8

Updated by Philipp Gampe almost 11 years ago

Actually it is DB Analyzer > Import > tx_extensionmanager_domain_model_repository

Actions #9

Updated by Charles Brunet almost 11 years ago

I have the same problem, except the flashmessage I get is:

Update Extension List
parsererror(SyntaxError: Unexpected token <):
Actions #10

Updated by Philipp Gampe almost 11 years ago

@Charles This must be another problem. Please reupload you source as you have a syntax error inside one PHP file.
The error might also be inside an extension. For further help, please consult our mailing lists (/newsgroups/forums).

Actions #11

Updated by Dirk Wenzel almost 11 years ago

Philipp Gampe wrote:

Actually it is DB Analyzer > Import > tx_extensionmanager_domain_model_repository

Hi Philipp,
I can confirm this issue after upgrading a 4.6 instance to 6.1

The DB table tx_extensionmanager_domain_model_repository did exist.
Its content was:

"uid","pid","title","description","wsdl_url","mirror_list_url","last_update","extension_count"
"1","0","TYPO3.org Main Repository","Main repository on typo3.org. This repository has some mirrors configured which are available with the mirror url.","http://typo3.org/wsdl/tx_ter_wsdl.php","http://repositories.typo3.org/mirrors.xml.gz","1346191200","0"

Files typo3temp/1.extensions.xml.gz and typo3temp/1.mirrors.xml.gz did also exist.
After removing the EM did load with correct values for last update (in the past) and was able fetch a current extension list.

Actions #12

Updated by Alexander Opitz almost 11 years ago

Can someone with that problem upload his typo3temp/1.extensions.xml.gz and typo3temp/1.mirrors.xml.gz to take a look into it?

Actions #13

Updated by Bernd Wilke almost 11 years ago

some solution:
1. tx_extensionmanager_domain_model_repository had no records.
there should be a better error-message which gives hints to the real problem.

2.curlUse = 1 does not change anything (probably not possible)

3. after an import into the table the flash-message changed to:

Update Extension List
Could not access remote resource http://repositories.typo3.org/mirrors.xml.gz

4. there are no *.gz files in typo3temp

(all CMS v6.05)

Actions #14

Updated by Alexander Opitz almost 11 years ago

So we have different problems:

1.) Missing DB Entry

2.) Not downloadable (please try to download the file via command line ... does the system needs proxy settings?)

3.) Downloaded file corrupted (here I need someone who uploads such a corrupted file).

Actions #15

Updated by Alban Cousinie almost 11 years ago

Same issue here on a fresh Typo3 6.0 installation on hosting with php 5.3. I just updated to 6.1 and it did not solve the issue.

1) The table tx_extensionmanager_domain_model_repository is empty on my installation (I did compare databases with the install tool). Should there be any base entry in it ?

2) The files Files typo3temp/1.extensions.xml.gz and typo3temp/1.mirrors.xml.gz do not exist on my installation.

3) I could download file 1.mirrors.xml.gz from the url http://repositories.typo3.org/mirrors.xml.gz but could not get http://repositories.typo3.org/extensions.xml.gz as it returns a 404 error. This should not be the good URL.

4) Switching to Curl does not fixe the problem.

Actions #16

Updated by Alban Cousinie almost 11 years ago

OK, I created the base entry in tx_extensionmanager_domain_model_repository and it fixed the problem :

insert into `tx_extensionmanager_domain_model_repository` (`uid`, `pid`, `title`, `description`, `wsdl_url`, `mirror_list_url`, `last_update`, `extension_count`) values('1','0','TYPO3.org Main Repository','Main repository on typo3.org. This repository has some mirrors configured which are available with the mirror url.','http://typo3.org/wsdl/tx_ter_wsdl.php','http://repositories.typo3.org/mirrors.xml.gz','1368607680','5992');

So the problem is that the base entry is not created automatically in table tx_extensionmanager_domain_model_repository at installation time.

Actions #17

Updated by Alexander Opitz almost 11 years ago

@Alban Cousinie

Which TYPO3 6.0 did you install?

The line won't be added by updating, but you can import it via "DB Analyzer > Import > tx_extensionmanager_domain_model_repository" but that issue isn't the problem which is discussed here.

Actions #18

Updated by Kai-Uwe Schilling almost 11 years ago

Today I did a fresh install of TYPO3 v6.1.1 source & dummy. After installation finished I logged into backend and checked the installed extension.

After selecting "Get extensions" from the drop down list an error message popped up:

parsererror(SyntaxError: JSON.parse: unexpected character):
Fatal error: Call to a member function format() on a non-object in 
[…]/typo3/sysext/extensionmanager/Classes/ViewHelpers/TimeSinceLastUpdateViewHelper.php on line 40

I first imported tx_extensionmanager_domain_model_repository as Philipp Gampe wrote in Upd #8. That didn't change anything.

Next thing was to manually download http://repositories.typo3.org/mirrors.xml.gz to /typo3temp and voilá: finally it works.

Actions #19

Updated by Alexander Opitz almost 11 years ago

This error is a follow up, when downloading the mirrors.xml failed, but it doesn't help, to find the problem downloading that file. Will create a new issue for this.

Actions #20

Updated by Gerrit Code Review almost 11 years ago

  • Status changed from Needs Feedback to Under Review

Patch set 2 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/21427

Actions #21

Updated by Alexander Opitz almost 11 years ago

Excuse this was the problem of this issue and not another problem. All the other issues mentioned in this issue are other effects.

Summary:

If the repository was never updated (or the update failed) last_update have the value of zero in the database.

The function \TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapper:mapDateTime() will return NULL for 0 (instead of a DateTime object for 1.1.1970 00:00:00 which is buggy IMHO). So we try NULL->format in the TimeSinceLastUpdateViewHelper and this leads to the Fatal Error:

PHP Fatal error:  Call to a member function format() on a non-object in /typo3/sysext/extensionmanager/Classes/ViewHelpers/TimeSinceLastUpdateViewHelper.php on line 40
Actions #22

Updated by Alexander Opitz almost 11 years ago

  • Assignee set to Alexander Opitz
  • Target version deleted (6.1.0)
Actions #23

Updated by Gerrit Code Review almost 11 years ago

Patch set 3 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/21427

Actions #24

Updated by Charles Brunet almost 11 years ago

Not sure if it is related or not, but each time I setup a new installation (src+dummy), I have this error when I try to update extension list for the first time. Clearing all caches solve the problem.

Actions #25

Updated by Gerrit Code Review over 10 years ago

Patch set 1 for branch TYPO3_6-1 has been pushed to the review server.
It is available at https://review.typo3.org/21745

Actions #26

Updated by Gerrit Code Review over 10 years ago

Patch set 1 for branch TYPO3_6-0 has been pushed to the review server.
It is available at https://review.typo3.org/21746

Actions #27

Updated by Alexander Opitz over 10 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #28

Updated by David Bruchmann about 10 years ago

I still have the same fault but don't know about the reason.

Console-log in Chrome:

GET http://www.dakaraaircraftservices.com/typo3/mod.php?M=tools_Extensionmanage…tensionmanager_tools_extensionmanagerextensionmanager%5Bcontroller%5D=List 500 (Internal Server Error) mod.php?M=tools_ExtensionmanagerExtensionmanager:171
jumpToUrl mod.php?M=tools_ExtensionmanagerExtensionmanager:171
onchange mod.php?M=tools_ExtensionmanagerExtensionmanager:183

Apache-log about this error is empty or I haven't enough access.

I tried with and without the (mirrors.xml.gz or 1.mirrors.xml.gz) and 1.extensions.xml.gz

Don't know how to track it down.
I checked my source and the patch was already applied.

Actions #29

Updated by Alexander Opitz about 10 years ago

  • Is Regression set to No

@David

Can you post the content of your table: "tx_extensionmanager_domain_model_repository" please?

Actions #30

Updated by David Bruchmann about 10 years ago

Alexander Opitz wrote:

@David

Can you post the content of your table: "tx_extensionmanager_domain_model_repository" please?

Sure, here it is as SQL:

INSERT INTO `tx_extensionmanager_domain_model_repository` (`uid`, `pid`, `title`, `description`, `wsdl_url`, `mirror_list_url`, `last_update`, `extension_count`) VALUES
(1, 0, 'TYPO3.org Main Repository', 'Main repository on typo3.org. This repository has some mirrors configured which are available with the mirror url.', 'http://typo3.org/wsdl/tx_ter_wsdl.php', 'http://repositories.typo3.org/mirrors.xml.gz', 1346191200, 0);

Actions #31

Updated by Alexander Opitz about 10 years ago

This looks ok for me, and deleting the mirrors.xml.gz and extensions.xml.gz do not help to get a new one downloaded?

But I don't get an error on my instances, so I can't reproduce (and so can't help with) the problem.

Actions #32

Updated by David Bruchmann about 10 years ago

Thanks for trying to help but I get a blank screen shown and in the browser-console the errormessage

GET http://www.dakaraaircraftservices.com/typo3/mod.php?M=tools_Extensionmanage…tensionmanager_tools_extensionmanagerextensionmanager%5Bcontroller%5D=List 500 (Internal Server Error)
jumpToUrl mod.php?M=tools_ExtensionmanagerExtensionmanager:171 mod.php?M=tools_ExtensionmanagerExtensionmanager:171
onchange  mod.php?M=tools_ExtensionmanagerExtensionmanager:183

the file-reference after jumpToUrl is shown twice.

Actions #33

Updated by Philipp Gampe about 10 years ago

Please check with the 6.2 release and see if it is working there. If not, please enable the Development Preset in install tool and check the error message with your browser dev tools.

Actions #34

Updated by Benni Mack over 5 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF