joomla-extensions / weblinks

This repo is meant to hold the decoupled com_weblinks component and related code.
GNU General Public License v2.0
45 stars 88 forks source link

Installation failed #539

Closed AlexanderSupp closed 11 months ago

AlexanderSupp commented 11 months ago

Steps to reproduce the issue

Install the package. Directly or via download.

Expected result

Actual result

Warning Joomla\Filesystem\File::delete: Failed deleting inaccessible file weblinks.php Package Update: There was an error installing an extension: plg_finder_weblinks.zip danger Error installing package

System information (as much as possible)

joomla 4.4 and joomla 5.0 PHP Version | 8.1.24

Additional comments

Warning Joomla\Filesystem\File::delete: Failed deleting inaccessible file weblinks.php Package Update: There was an error installing an extension: plg_finder_weblinks.zip danger Error installing package

joomdonation commented 11 months ago

Hello

From my experience, there are permission issues with the file weblinks.php (the system tries to delete the file during update process because the file is not needed with new plugin structure)

You can send super user account of your site to my email tuanpn@joomdonation.com . I will try to to check and update the extension for you.

jojo12 commented 11 months ago

I think this must be repared in the package, not in the backend!

joomdonation commented 11 months ago

Honestly, I'm unsure. I tried to update from my local installation and it worked well. I remember there was an issue like that long time ago due to permission issue, see https://github.com/joomla/joomla-cms/issues/23504

Sometime, I also got the same problem with installing/updating my extensions on our website and I documented a temp solution https://membershipprodoc.joomservices.com/troubleshooting/fix-error-deleting-inaccessible-file

If you got that same issue, maybe try that solution to see if it addressed the issue.

dsimonse commented 11 months ago

Have the same issue with Joomla4.4.0 and PHP8.0.11 Where is this file weblinks.php located?

joomdonation commented 11 months ago

There are some files which needs to be deleted during update process

'/plugins/search/weblinks/weblinks.php', '/plugins/finder/weblinks/weblinks.php',
'/plugins/system/weblinks/weblinks.php',

However, if It is not permission issue with one of these files, I really don't know why the error happens.

joomdonation commented 11 months ago

I wonder if one of you here could give me access to the site so that I can run the update to see why the error happens? That would help us to find the root reasons of the error.

dsimonse commented 11 months ago

Hi Tuan,

It looks likt the first 2 is deleted, but the 3rd is there with 0644 permission.

/Dennis

Från: Tuan Pham Ngoc Skickat: den 23 oktober 2023 16:00 Till: joomla-extensions/weblinks @.> Kopia: dsimonse @.>; Comment @.***> Ämne: Re: [joomla-extensions/weblinks] Installation failed (Issue #539)

There are some files which needs to be deleted during update process

'/plugins/search/weblinks/weblinks.php', '/plugins/finder/weblinks/weblinks.php', '/plugins/system/weblinks/weblinks.php',

However, if It is not permission issue with one of these files, I really don't know why the error happens.

— Reply to this email directly, view it on GitHub https://github.com/joomla-extensions/weblinks/issues/539#issuecomment-1775271556 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AEDPNYWFC7PAHIE7DJKZAVDYAZZ7BAVCNFSM6AAAAAA6L2MHXWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONZVGI3TCNJVGY . You are receiving this because you commented. https://github.com/notifications/beacon/AEDPNYXNGWSCXDDWT2AW5F3YAZZ7BA5CNFSM6AAAAAA6L2MHXWWGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTTJ2B7II.gif Message ID: @. @.> >

joomdonation commented 11 months ago

@dsimonse The last one was not deleted due to a typo in the code. Could you please try to install this updated package manually to see if the Failed deleting inaccessible file weblinks.php still happens ?

pkg-weblinks-4.3.0.zip

jochenpa commented 11 months ago

Does not work for me. I have a single file still there:

administrator/components/com_weblinks/helpers/weblinks.php
# ls -l administrator/components/com_weblinks/helpers/weblinks.php
-rw-r--r-- 1 fer fer 520 23. Okt 16:15 administrator/components/com_weblinks/helpers/weblinks.php
# ls -dl administrator/components/com_weblinks/helpers
drwxr-xr-x 2 fer fer 4096 26. Aug 11:38 administrator/components/com_weblinks/helpers/

The web server (apache2) runs as user "fer" and group "fer".

Jochen

jazzmang commented 11 months ago

I see the same issue on Joomla 4.4.0 and PHP 8.1.24, even with the new package.

The only weblinks.php left is the administrator/components/com_weblinks/helpers/weblinks.php; permissions are fine; there should be no reason it cannot delete it.

joomdonation commented 11 months ago

The file administrator/components/com_weblinks/helpers/weblinks.php does not need to be deleted. It must be there for backward compatible reasons.

So it is not clear to me why the error Failed deleting inaccessible file weblinks.php still happens unless someone gives me access to the site to check directly there.

jochenpa commented 11 months ago

Are you trying to delete a file which already is deleted?

joomdonation commented 11 months ago

@jochenpa No, I'm not that bad. The code checks to see if the file exists and if Yes, delete it. See https://github.com/joomla-extensions/weblinks/blob/4.0-dev/src/administrator/components/com_weblinks/script.php#L66-L70

Here are links to list of files need to be deleted during update process https://github.com/joomla-extensions/weblinks/blob/4.0-dev/src/administrator/components/com_weblinks/script.php#L41-L59

dsimonse commented 11 months ago

Hi,

Still got the error, but all weblink.php are gone.

Got a additional error: Paket update: An error occurred when plg_finder_weblinks.zip was installed (translation from swedish)

//Dennis

Från: Tuan Pham Ngoc Skickat: den 23 oktober 2023 16:15 Till: joomla-extensions/weblinks @.> Kopia: dsimonse @.>; Mention @.***> Ämne: Re: [joomla-extensions/weblinks] Installation failed (Issue #539)

@dsimonse https://github.com/dsimonse The last one was not deleted due to a typo in the code. Could you please try to install this updated package manually to see if the Failed deleting inaccessible file weblinks.php still happens ?

pkg-weblinks-4.3.0.zip https://github.com/joomla-extensions/weblinks/files/13071602/pkg-weblinks-4.3.0.zip

— Reply to this email directly, view it on GitHub https://github.com/joomla-extensions/weblinks/issues/539#issuecomment-1775302279 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AEDPNYWWCJSQR324NQELWFDYAZ3V5AVCNFSM6AAAAAA6L2MHXWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONZVGMYDEMRXHE . You are receiving this because you were mentioned. https://github.com/notifications/beacon/AEDPNYTMUWKQ4OZXEJETUI3YAZ3V5A5CNFSM6AAAAAA6L2MHXWWGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTTJ2D3IO.gif Message ID: @. @.> >

joomdonation commented 11 months ago

I tried to install/update both on my local Joomla installation and could not see the error myself. So I really do not have any clue why the error happens, sorry. I don't say that there is no error, but without seeing it myself, it's hard for me to know what's the reason and get it corrected.

alikon commented 11 months ago

dunno if it is the root cause but i've used in https://github.com/joomla/joomla-cms/pull/41865 and in https://github.com/joomla/joomla-cms/pull/42088 if (is_file(JPATH_ROOT . $file)) { instead of if (File::exists(JPATH_ROOT . $file)) {

jazzmang commented 11 months ago

For me, the Administrator Component and Site Module shows 4.3.0; everything else is still on 4.0.1.

I've run the Akeeba permission fix, and there's no difference. All the files in the https://github.com/joomla-extensions/weblinks/blob/4.0-dev/src/administrator/components/com_weblinks/script.php#L41-L59 are removed, but I still get the error if I try to install again.

dsimonse commented 11 months ago

Hi,

If I should give you access, I need your direct email.

/Dennis

Från: Tuan Pham Ngoc Skickat: den 23 oktober 2023 16:39 Till: joomla-extensions/weblinks @.> Kopia: dsimonse @.>; Mention @.***> Ämne: Re: [joomla-extensions/weblinks] Installation failed (Issue #539)

I tried to install/update both on my local Joomla installation and could not see the error myself. So I really do not have any clue why the error happens, sorry. I don't say that there is no error, but without seeing it myself, it's hard for me to know what's the reason and get it corrected.

— Reply to this email directly, view it on GitHub https://github.com/joomla-extensions/weblinks/issues/539#issuecomment-1775355085 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AEDPNYWA4TKIHDH7NNOZX2TYAZ6PVAVCNFSM6AAAAAA6L2MHXWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONZVGM2TKMBYGU . You are receiving this because you were mentioned.Message ID: @.***>

joomdonation commented 11 months ago

@dsimonse tuanpn@joomdonation.com is my email. Thanks for your help !

joomdonation commented 11 months ago

@alikon I looked at your PR, you added a is_file check before calling delete, so it is a different issue, I think

joomdonation commented 11 months ago

@dsimonse I received access to your site. Will take time for me to debug to figure out the reasons of the issue and get it sorted. As it is night time here now for me 10:30pm, I hope you can leave the access open for about 24 hours. Thanks !

joomdonation commented 11 months ago

Update: I think I figured out the reasons. During the update, Joomla installer track and delete the old files (from old plugin structure) itself. So the weblinks extension does not need to track and delete the old files itself.

As the files were deleted by weblinks and Joomla installer tries to delete the old files/folders without checking if these files/folders still exist, it causes the error which you reported

I will have to check it more, but the workaround for this problem could be:

pkg-weblinks-4.3.0.zip

@dsimonse : I updated your site to latest package of weblinks. So you can disable the account you created for me now.

dsimonse commented 11 months ago

Great!

Thanks! /Dennis

Från: Tuan Pham Ngoc Skickat: den 23 oktober 2023 17:53 Till: joomla-extensions/weblinks @.> Kopia: dsimonse @.>; Mention @.***> Ämne: Re: [joomla-extensions/weblinks] Installation failed (Issue #539)

Update: I think I figured out the reasons. During the update, Joomla installer track and delete the old files (from old plugin structure) itself. So the weblinks extension does not need to track and delete the old files itself.

As the files were deleted by weblinks and Joomla installer tries to delete the old files/folders without checking if these files/folders still exist, it causes the error which you reported

I will have to check it more, but the workaround for this problem could be:

pkg-weblinks-4.3.0.zip https://github.com/joomla-extensions/weblinks/files/13073037/pkg-weblinks-4.3.0.zip

@dsimonse https://github.com/dsimonse : I updated your site to latest package of weblinks. So you can disable the account you created for me now.

— Reply to this email directly, view it on GitHub https://github.com/joomla-extensions/weblinks/issues/539#issuecomment-1775507934 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AEDPNYSTSL6W4ZSFEJUAY4TYA2HGLAVCNFSM6AAAAAA6L2MHXWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONZVGUYDOOJTGQ . You are receiving this because you were mentioned.Message ID: @.***>

jazzmang commented 11 months ago

Update: I think I figured out the reasons. During the update, Joomla installer track and delete the old files (from old plugin structure) itself. So the weblinks extension does not need to track and delete the old files itself.

As the files were deleted by weblinks and Joomla installer tries to delete the old files/folders without checking if these files/folders still exist, it causes the error which you reported

I will have to check it more, but the workaround for this problem could be:

* Download and install old version of weblinks extension https://downloads.joomla.org/extensions/weblinks/4-0-1 (so that the old files are restored and we do not get error when Joomla tries to delete these old files)

* Then update to this updated package of weblinks 4.3.0

pkg-weblinks-4.3.0.zip

@dsimonse : I updated your site to latest package of weblinks. So you can disable the account you created for me now.

This worked for me, everything now shows version 4.3.0 and no error on the 4.30 update.

GASOLINE commented 11 months ago

Same here, can't install. Error message, see topicstarter.

gpraceman commented 11 months ago

The workaround did not work for me. The weblinks.php files are not restored with rolling back to 4.0.1 and I still get the same error with a 4.3.0 install.

fontanil commented 11 months ago

Hi, the last version works for me. (Joomla! 5.0.0) Thanks Tuan!

FrankReisenhofer commented 11 months ago

Same here: The workaround is not working for me. I got the error [1]

[1] Warnung Joomla\Filesystem\File::delete: Failed deleting inaccessible file weblinks.php Paket Update: Bei der Installation der Erweiterung trat ein Fehler auf: plg_finder_weblinks.zip

nickpsal commented 11 months ago

same problem here when i tried to install it manualy i get thiw error Joomla\Filesystem\File::delete: Failed deleting inaccessible file weblinks.php Package Update: There was an error installing an extension: plg_finder_weblinks.zip

suchymdt commented 11 months ago

Joomla 5.0.0, PHP 8.2.7

  1. Download old version of weblinks extension https://downloads.joomla.org/extensions/weblinks/4-0-1
  2. Unzip pkg-weblinks-4.0.1
  3. Unzip plg_finder_weblinks.zip and upload manually to plugins/finder/weblinks
  4. Unzip plg_search_weblinks.zip and upload manually to plugins/search/weblinks
  5. Unzip plg_system_weblinks.zip and upload manually to plugins/system/weblinks
  6. Unzip plg_editors-xtd_weblink.zip and upload manually to plugins/editors-xtd/weblink
  7. Download and install pkg-weblinks-4.3.0.zip
fontanil commented 11 months ago

You can simply reinstall version 4.0.1, then update to 4.3.0.

suchymdt commented 11 months ago

It didn't work for me, so I did as above

joomdonation commented 11 months ago

@FrankReisenhofer @nickpsal @suchymdt Normally, when upgrade failed, you should be able to reinstall @4.0.1 , then update to 4.3.0 as I mentioned in the earlier comment https://github.com/joomla-extensions/weblinks/issues/539#issuecomment-1775507934

If for some reasons it is not working for you, you can give me access to your site tuanpn@joomdonation.com so that I can help with the update

Regards,

Tuan

FrankReisenhofer commented 11 months ago

@joomdonation : Good news :-). I performed the suggested steps a second time and now it worked fine. Many thanks for your quick help!

joomdonation commented 11 months ago

Great. Thanks for confirming @FrankReisenhofer

nickpsal commented 11 months ago

it works fine now

woluweb commented 11 months ago

I have tried the workaround, namely installing version 4.0.1 (even several times in a row) and then reinstalling 4.3.0 but I still get

Joomla\Filesystem\File::delete: Failed deleting inaccessible file weblinks.php
Package Update: There was an error installing an extension: plg_finder_weblinks.zip

Edit: all J4.4.0 websites btw

joomdonation commented 11 months ago

@woluweb was the installation of 4.0.1 success? And could you please make sure you download the right 4.3.0 package from this link https://github.com/joomla-extensions/weblinks/files/13073037/pkg-weblinks-4.3.0.zip ?

woluweb commented 11 months ago

mmmh, tricky. I had tries many times

Now that I don't "update to 4.3.0" but "install 4.3.0" it seems to work... but on some sites I had to redo the whole process twice (reinstall 4.0.1 and then reinstall 4.3.0)

My 5 concerned sites are now updated

joomdonation commented 11 months ago

@woluweb It's because when you use Joomla updater, it is still using the old weblinks package, sorry. I'm still waiting for help to update the new package to offical download server.

jochenpa commented 11 months ago

Hello

It worked for me.

Reinstalling 4.0.1 Installing changed 4.3.0 No more error messages.

Thanks.

GASOLINE commented 11 months ago

Hello

It worked for me.

Reinstalling 4.0.1 Installing changed 4.3.0 No more error messages.

Thanks.

That is not a solution for the avarage user that does not even know that github exists.

joomdonation commented 11 months ago

@GASOLINE I'm sorry but part of this process is controlled by Joomla core installer process (which weblinks has no control to). So if you face this issue, re-installing 4.0.1 before updating to latest package would be the required steps. Sadly there is no simpler option.

joomdonation commented 11 months ago

So we made a new release 4.3.1 which fixes the errors with the update. If anyone updated from older version to 4.3.0 and got error, please use the solution below :

If anyone has difficulty with the update, feel free to send an email to tuanpn@joomdonation.com and I will be happy to assist. Apologize for my mistake with 4.3.0 release and sorry for the inconvenience.

dsimonse commented 11 months ago

Hi Tuan,

Get the error that downgrade is not allowed.

//Dennis

Från: Tuan Pham Ngoc Skickat: den 24 oktober 2023 12:06 Till: joomla-extensions/weblinks @.> Kopia: dsimonse @.>; Mention @.***> Ämne: Re: [joomla-extensions/weblinks] Installation failed (Issue #539)

So we made a new release 4.3.1 which fixes the errors with the update. If anyone updated from older version to 4.3.0 and got error, please use the solution below :

If anyone has difficulty with the update, feel free to send an email to @. @.> and I will be happy to assist. Apologize for my mistake with 4.3.0 release and sorry for the inconvenience.

— Reply to this email directly, view it on GitHub https://github.com/joomla-extensions/weblinks/issues/539#issuecomment-1776908394 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AEDPNYQAIVH7I5FVVDXEWPLYA6HHHAVCNFSM6AAAAAA6L2MHXWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONZWHEYDQMZZGQ . You are receiving this because you were mentioned. https://github.com/notifications/beacon/AEDPNYQ6HI2FVGKDF2X2MPDYA6HHHA5CNFSM6AAAAAA6L2MHXWWGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTTJ5F4GU.gif Message ID: @. @.> >

dsimonse commented 11 months ago

Hi Tuan, Get the error that downgrade is not allowed. //Dennis Från: Tuan Pham Ngoc Skickat: den 24 oktober 2023 12:06 Till: joomla-extensions/weblinks @.> Kopia: dsimonse @.>; Mention @.> Ämne: Re: [joomla-extensions/weblinks] Installation failed (Issue #539) So we made a new release 4.3.1 which fixes the errors with the update. If anyone updated from older version to 4.3.0 and got error, please use the solution below : Download weblinks 4.0.1 at https://downloads.joomla.org/extensions/weblinks/4-0-1 and re-install it Then you can update to latest release 4.3.1 from administrator area of your site using Joomla! updater If anyone has difficulty with the update, feel free to send an email to @. @.> and I will be happy to assist. Apologize for my mistake with 4.3.0 release and sorry for the inconvenience. — Reply to this email directly, view it on GitHub <#539 (comment)> , or unsubscribe https://github.com/notifications/unsubscribe-auth/AEDPNYQAIVH7I5FVVDXEWPLYA6HHHAVCNFSM6AAAAAA6L2MHXWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONZWHEYDQMZZGQ . You are receiving this because you were mentioned. https://github.com/notifications/beacon/AEDPNYQ6HI2FVGKDF2X2MPDYA6HHHA5CNFSM6AAAAAA6L2MHXWWGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTTJ5F4GU.gif Message ID: @. @.***> >

But a standard joomla-update went well!

Memotas commented 11 months ago

Hello,

After reinstalling Weblinks 4.0.1, the problem of updating and/or installing version 4.3.1 is resolved.

Joomla: 4.4.0 PHP: 8.2.11

joomdonation commented 11 months ago

@dsimonse Usually, when upgrade to 4.3.0 fail, you should be allowed to re-install 4.0.1. If that's not allowed, you can give me access to your site and I will be happy to assist to get the issue sorted.

dsimonse commented 11 months ago

As I saidin the comment, the normal Joomla update worked.Den 24 okt. 2023 14:13 skrev Tuan Pham Ngoc @.***>: @dsimonse Usually, when upgrade to 4.3.0 fail, you should be allowed to re-install 4.0.1. If that's not allowed, you can give me access to your site and I will be happy to assist to get the issue sorted.

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: @.***>

joomdonation commented 11 months ago

@dsimonse OK. So do you need assist? Or everything is OK for you now ?