optimus_buffer() error

Started by Sir Osis of Liver, December 16, 2018, 11:39:47 PM

Previous topic - Next topic

Sir Osis of Liver

Server crashed, forum restored to different server from backup by host.  Getting a ton of these errors, all guests/users, all links -



2: Parameter 1 to optimus_buffer() expected to be a reference, value given



optimus_buffer() is not in core code, don't recognize it as mod code.  Forum appears to be working.

Version Information:
Forum version: SMF 2.0.15 (more detailed)
Current SMF version: SMF 2.0.15
GD version: bundled (2.1.0 compatible)
Database Server: MySQL
MySQL version: 5.7.24
PHP: 7.1.25
Server version: Apache

Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

br360

I haven't used it so not 100%, but it looks like this is the mod that could be causing the issue- https://custom.simplemachines.org/mods/index.php?mod=2659

Arantor

If you look at the function definition, the first variable in it will have a & before the $, remove it.

Sir Osis of Liver

Optimus mod is not installed.   

Which function definition?
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Arantor

Well, it sure looks like it. As for the function definition, how about searching the code for "optimus_buffer", the function it is complaining about which is clearly available even if the mod claims to not be installed.

Sir Osis of Liver

Haven't been able to reestablish ftp access, so am limited to file manager.  Search for "optimus" returns .css file only.  /Packages contains Optimus Brave dated Feb 2014, and there's a PM backup for the mod same date.  It's not currently listed in PM.  This forum is a mess, some mods were installed over a dozen times.  Host migrated it to "upgraded server" couple weeks ago, caused all kinds of problems.  Cleaned it up, "upgraded server" crashed over weekend, host installed backup to yet another server, that's when this error showed up.  Owner does not want to do clean install, but that's obviously what's needed.  Forum is running, but it's logged 36,000 errors since last night.
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Arantor

Well, if you don't have FTP access, there's not really a fat lot you can do. You can try looking in the Sources folder and likely candidates are QueryString.php, Subs.php, Load.php for the function you need to fix.

Sir Osis of Liver

Searched /public_html in file manager, nothing for 'optimus_buffer', only one .css file for 'optimus'.  Server errorlog is 2.3 mb, almost all of which was logged Dec 15/16.  Will see if I can convince owner to do clean install.  Don't know what's wrong with ftp, login successful, but can't retrieve directory.  Methinks it's time for a new host. :P
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Arantor

Well, the code does exist, it is clearly being called according to the error message. If it were trying to call a function that does not exist, the error would be different. I cannot tell you why the file manager can't find it.

Kindred

looks at the mod...

      add_integration_function('integrate_buffer', 'Optimus::buffer', false);

Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Arantor

That's a current version but I suspect the older version as mentioned might not...

Kindred

Ah. yes. you are correct.

Looks at older package on test server

Subs-Optimus.php
function optimus_buffer(&$buffer)


In the install.php for the mod package

   'integrate_pre_include' => '$sourcedir/Subs-Optimus.php',
and
   'integrate_buffer' => 'optimus_buffer'
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Arantor


Sir Osis of Liver

I'm beginning to suspect I'm in the wrong place.  The cpanel and ftp login credentials I'm using may be showing me old server, with different creds for new server.  Stranger things have happened.  But the forum is running, and Optimus mod is not listed in PM.
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

drewactual

is that forum running OPCache or akin that may require an invalidation of altered files?

Sir Osis of Liver

Don't think so.  It's on third server since end of Nov, I'm not even sure at this point if I'm accessing the current one.  Waiting for owner to get back with confirmed login creds.  Once I have ftp access again I can check the code directly, what I'm seeing in file manager can't be correct. 
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Arantor

Just because Optimus is not in the package manager does not mean it is not installed. The error message clearly shows that it is.

Sir Osis of Liver

I know, but the cpanel code search doesn't find it, and that's all I have to work with until I can get back in via ftp.
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Bob Perry of Web Presence Consulting

Quote from: Sir Osis of Liver on December 18, 2018, 03:38:51 PM
I know, but the cpanel code search doesn't find it, and that's all I have to work with until I can get back in via ftp.


Correct me if wrong, you have cpanel access but not ftp?
Best Regards,
Bob Perry



"The world is moving so fast these days that the man who says it can't be done is generally interrupted by someone doing it." Elbert Hubbard

Arantor

If you have cPanel,, why not make a new FTP account?

Sir Osis of Liver

<sigh> Done that several times, to three different directory levels.  Login is successful, cannot retrieve directory listing.  I've run into this before, believe it's caused by latest server move.  Login works because old server is still running, but account is no longer there.  Soon as I get a minute, will try to confirm if I'm logging into old cpanel as well.  Not getting any response from forum owner, it's running ok except for these errors (170,000 now).
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Arantor

It needs to be fixed because it will break in future.

Sir Osis of Liver

Yeah, I know, but some of these guys are off to the next thing soon as the forum is up & running again.  Will see if he gets back to me.
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Sir Osis of Liver

Ok, I've regained ftp access (had to change encryption type in FZ), d/l'd and searched /Sources, /Themes/default/, and /root files.  In addition to a half dozen language files and a couple of css files, optimus code shows up in these -

/Themes/default/Optimus.template.php
/Sources/Admin-Optimus.php
/Sources/Subs-Optimus.php

If I rename the files to .phX, errors stop.  I don't see how the code is being called.
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Bob Perry of Web Presence Consulting

What I would do is get a fresh copy of the optimus app, upload it to the package manager, then attempt to install, but instead of following through with it, look to see which Source files it modifies and go to each in your PC side copy and look for the call to optimus...
Best Regards,
Bob Perry



"The world is moving so fast these days that the man who says it can't be done is generally interrupted by someone doing it." Elbert Hubbard

Arantor

The code is being called through the integrate_buffer hook.

Shambles

Quote from: Bob Perry of Web Presence Consulting
What I would do is get a fresh copy of the optimus app, ... see which Source files it modifies ...

I don't believe the version currently available makes a call to optimus_buffer()

Arantor

It also presumes that mods have to do edits to achieve things, which hasn't been true for some years now, integration hooks have been in SMF since 1.1 although they were significantly improved in 2.0.

Sir Osis of Liver

Found the hook, thanks Arantor.  The code appears to be a leftover from earlier Optimus Brave mod, not current version.  There's a modSetting that's enabling the call, will see if I can find it in database when I get a minute.

Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Arantor

Look under 'integrate_buffer'... but note that removing that hook will stop the mod working (and the issue is that you just need to remove one & rather than hack the mod changes out)

Kindred

Quote from: Kindred on December 17, 2018, 12:37:38 PM
Looks at older package on test server

Subs-Optimus.php
function optimus_buffer(&$buffer)


In the install.php for the mod package

   'integrate_pre_include' => '$sourcedir/Subs-Optimus.php',
and
   'integrate_buffer' => 'optimus_buffer'

Yes, this is what I said....

You will probably have to remove the other hooks for this mod as well....    I believe that it added 4 hooks
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Advertisement: