Skip to main content
Topic: Errors when installing and removing a package (Read 5473 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Errors when installing and removing a package

I get lots of errors in the log when I install and uninstall a package I'm working on.  Since it's my first package hopefully it's my problem.  Can someone point me to a package that sets hooks, installs files and does a code edit that is known good?

Then I can see if it's my package (and how to fix it) or the install system.

Example Uninstall Errors:
Type of error: Undefined
8: Undefined variable: integration_call
index.php?action=admin;area=packages;sa=uninstall2;package=mypackage.tgz;pid=20
File: elkarte/sources/Subs.php
Line: 3931
      
Type of error: Undefined
8: Undefined variable: integration_call
elkarte/index.php?action=admin;area=packages;sa=uninstall2;package=mypackage.tgz;pid=20
File: elkarte/sources/Subs.php
Line: 3923
      
Type of error: Undefined
index.php?action=admin;area=packages;sa=uninstall2;package=mypackage.tgz;pid=20
File: elkarte/sources/Subs.php
Line: 3912

And these errors on install and uninstall

Type of error: General
2: is_dir() expects parameter 1 to be a valid path, string given
elkarte/index.php?action=admin;area=packages;sa=uninstall2;package=mypackage.tgz;pid=20
File: elkarte/sources/subs/Package.subs.php
Line: 1792
      
Type of error: General
2: file_exists() expects parameter 1 to be a valid path, string given
/elkarte/index.php?action=admin;area=packages;sa=uninstall2;package=mypackage.tgz;pid=20
File: elkarte/sources/subs/Package.subs.php
Line: 216

Re: Errors when installing and removing a package

Reply #1

There was a bug that was fixed just recently here https://github.com/Spuds/Elkarte/commit/18254a539d11f3ea7d9dd3a5f8032e8e761217c4  That affected uninstall though.

You can see some of my addons here: https://bitbucket.org/spuds_  look at the more recent ones, although they are all work in progress so they may or may not work


Re: Errors when installing and removing a package

Reply #2

I grabbed your hideusernames package just a few minutes ago (it was updated today) and installed it.  No errors on install but errors on uninstall.  One is what your github link fixes.  Here's the other.

Type of error: Undefined
8: Undefined variable: integration_call
.../index.php?action=admin;area=packages;sa=uninstall2;package=spuds_-elk_hideusernames-3bbba4f9bd00.zip;pid=39
File: /var/www/elkarte/sources/Subs.php
Line: 3923

Re: Errors when installing and removing a package

Reply #3

Ok, I found the difference between my package and yours in terms of install errors.  I am using gzipped tar files (.tgz extension) and you are using zip files.  I zipped mine instead and it installed without all the errors.

Not sure why gzipped tar files throw so many errors.

Re: Errors when installing and removing a package

Reply #4

Not sure either, something else for me to check  :D

Re: Errors when installing and removing a package

Reply #5

I can see why you could get Undefined variable: integration_call and made a simple fix for now ( https://github.com/Spuds/Elkarte/commit/c3933023e8bba9d02638ed1ff61233923d45d13a ).  I tried some tar.gz files as well but did not get any errors.  If you would attach an example tar.gz package that is creating errors then I can check in to this a bit more.

Re: Errors when installing and removing a package

Reply #6

Here is your hideusernames package unzipped and then tar gzipped (hope you don't mind it as the example).  When I install it using the package manager in .tgz format I get four errors.  Two each of

Type of error: General
2: is_dir() expects parameter 1 to be a valid path, string given
.../elkarte/index.php?action=admin;area=packages;sa=install2;package=spuds_-elk_hideusernames-3bbba4f9bd00.tgz;pid=0
File: .../elkarte/sources/subs/Package.subs.php
Line: 1792

Type of error: General
2: file_exists() expects parameter 1 to be a valid path, string given
.../elkarte/index.php?action=admin;area=packages;sa=install2;package=spuds_-elk_hideusernames-3bbba4f9bd00.tgz;pid=0
.../elkarte/sources/subs/Package.subs.php
Line: 216

Note:  Renamed to tar.gz as the forum wouldn't let me attach a file in .tgz format.  I've not tried installing it as tar.gz.

Re: Errors when installing and removing a package

Reply #7

renamed it back to tgz and it installed w/o errors on my system. 

Since is_dir is throwing an E_WARNING i would think its a permissions issue, but I'm not sure why you are only seeing that with a tgz but not a zip?  Are you having to use FTP to install the file or does the system think it has permissions? 

Re: Errors when installing and removing a package

Reply #8

The system thinks it has permissions.

Re: Errors when installing and removing a package

Reply #9

Than ATM, I'm stumped !  Maybe someone else has some ideas on this one.

Re: Errors when installing and removing a package

Reply #10

Just confirmed that not owning the .tgz file itself wasn't the problem.  Actually you don't even have to install the package to make it happen.  Just clicking on install and seeing the test page generates the errors even if you cancel after the tests without actually installing the mod.

Not sure what's different on my box.   Probably the same thing that gives me a failure on install (themes point to localhost instead of the https url of the forum and I get the host "" errors all the time in the web error log.

Re: Errors when installing and removing a package

Reply #11

Line 1792 debug output, printing $strPath

.tar.gz file
.../elkarte/packages/temp
.../elkarte/packages
.../elkarte/packages/temp/sources//
.../elkarte/packages/temp/sources
.../elkarte/packages/temp
.../elkarte/packages/temp/sources
.../elkarte/sources/subs

.zip file
.../elkarte/packages/temp
.../elkarte/packages
.../elkarte/packages/temp/spuds_-elk_hideusernames-3bbba4f9bd00/
.../elkarte/packages/temp
.../elkarte/packages/temp/spuds_-elk_hideusernames-3bbba4f9bd00
.../elkarte/packages/temp/spuds_-elk_hideusernames-3bbba4f9bd00
.../elkarte/packages/temp/spuds_-elk_hideusernames-3bbba4f9bd00
.../elkarte/packages/temp/spuds_-elk_hideusernames-3bbba4f9bd00
.../elkarte/packages/temp/spuds_-elk_hideusernames-3bbba4f9bd00
.../elkarte/packages/temp/spuds_-elk_hideusernames-3bbba4f9bd00
.../elkarte/packages/temp/spuds_-elk_hideusernames-3bbba4f9bd00
.../elkarte/packages/temp/spuds_-elk_hideusernames-3bbba4f9bd00/sources/
.../elkarte/packages/temp/spuds_-elk_hideusernames-3bbba4f9bd00
.../elkarte/packages/temp/spuds_-elk_hideusernames-3bbba4f9bd00/sources
.../elkarte/packages/temp/spuds_-elk_hideusernames-3bbba4f9bd00
.../elkarte/sources/subs

The ... expand to the same correct path to the forum root on my host.  This is using the hide... I attached and the .zip downloaded from your site.

Re: Errors when installing and removing a package

Reply #12

Not sure ... the double errors is due to the way the pacakge manager works, it does a test install where its checking permissions etc so it can determine if you will need or not to enter some FTP credentials to actually install.

the error is in the function mktree in the Package.subs.php file.  Its as you log says at line 1792 if (is_dir($strPath)) ... you could add var_dump($strPath); before that line to see what its being passed, maybe that will give us more to work on.

Never mind, you beat me to it  :D

Re: Errors when installing and removing a package

Reply #13

And at line 216, no output at all in the zip version and in the .tar.gz I get

$destination = ...elkarte/packages/temp
$current['filename'] = sources//

And possible unrelated bug, when I went to the post screen the it warned me you had posted while I was posting the subject line go deleted as it complained when I went to post.

Re: Errors when installing and removing a package

Reply #14

Quote from: scripple – And at line 216, no output at all in the zip version and in the .tar.gz I get

$destination = ...elkarte/packages/temp
$current['filename'] = sources//
destination looks fine, need to figure out why you are getting a // on the filename, that is not correct (should just be sources/).  I've tried this now on 3 systems with no problems so something odd is going on for sure.
Quote from: scripple – And possible unrelated bug, when I went to the post screen the it warned me you had posted while I was posting the subject line go deleted as it complained when I went to post.
I've seen this one before as well :(