Upgrading 17.0.0 to 18.0.4 Reports "cgi-bin" as an unexpected extra file

Support intro

Sorry to hear you’re facing problems :slightly_frowning_face:

help.nextcloud.com is for home/non-enterprise users. If you’re running a business, paid support can be accessed via portal.nextcloud.com where we can ensure your business keeps running smoothly.

In order to help you as quickly as possible, before clicking Create Topic please provide as much of the below as you can. Feel free to use a pastebin service for logs, otherwise either indent short log examples with four spaces:

example

Or for longer, use three backticks above and below the code snippet:

longer
example
here

Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can :heart:

Nextcloud version (eg, 18.0.2): 17.0.0
Operating system and version (eg, Ubuntu 20.04): Unknown - ISP OS running kernel 2.6.32-954.3.5.lve1.4.66.el6.x86_64
Apache or nginx version (eg, Apache 2.4.25): 2.4.43
PHP version (eg, 7.1): 7.2.30

The issue you are facing:
Returning to an old NC instance after a bit of a gap and wanting to perform a software update from 17.0.0 to 18.0.4. Have to use web-based updated due to ISP/Host limitations. Updater launches successfully and then reports a couple of unexpected files: “php.ini” and “cgi-bin”…

I am pretty sure I added the php.ini because NC wants non-default resource allocations, so I’ve temporarily downloaded that to my workstation and removed from the server. However, there is no “cgi-bin” file in the NC directory and I’m not sure why the installer thinks it is there!

Is this the first time you’ve seen this error? (Y/N): Y

Steps to replicate it:

  1. Go to web-based Updater
  2. Click “Update”
  3. Witness error in the first “Check for expected files” part of the process

The output of your Nextcloud log in Admin > Logging:

PASTE HERE
	cron	Run OCA\UpdateNotification\Notification\BackgroundJob job with ID 13	
2020-05-06T11:08:33+0100
Debug	cron	Finished OC\Command\CommandJob job with ID 167 in 0 seconds	
2020-05-06T11:08:25+0100
Debug	cron	Run OC\Command\CommandJob job with ID 167	
2020-05-06T11:08:25+0100
Debug	cron	Finished OC\Command\CommandJob job with ID 166 in 0 seconds	
2020-05-06T11:02:13+0100
Debug	cron	Run OC\Command\CommandJob job with ID 166	
2020-05-06T11:02:13+0100
Debug	cron	Finished OC\Command\CommandJob job with ID 165 in 1 seconds	
2020-05-06T10:58:33+0100
Debug	cron	Run OC\Command\CommandJob job with ID 165	
2020-05-06T10:58:32+0100
Debug	cron	Finished OC\Command\CommandJob job with ID 164 in 0 seconds	
2020-05-06T10:53:53+0100
Debug	cron	Run OC\Command\CommandJob job with ID 164	
2020-05-06T10:53:53+0100
Error	PHP	shell_exec() has been disabled for security reasons at /home/sauriano/public_html/saurian/nc/apps/serverinfo/lib/OperatingSystems/DefaultOs.php#96	
2020-05-06T10:53:31+0100
Error	PHP	shell_exec() has been disabled for security reasons at /home/sauriano/public_html/saurian/nc/apps/serverinfo/lib/OperatingSystems/DefaultOs.php#95	
2020-05-06T10:53:31+0100
Error	PHP	shell_exec() has been disabled for security reasons at /home/sauriano/public_html/saurian/nc/apps/serverinfo/lib/OperatingSystems/DefaultOs.php#87	
2020-05-06T10:53:31+0100
Error	PHP	shell_exec() has been disabled for security reasons at /home/sauriano/public_html/saurian/nc/apps/serverinfo/lib/OperatingSystems/DefaultOs.php#79	
2020-05-06T10:53:31+0100
Error	PHP	Invalid argument supplied for foreach() at /home/sauriano/public_html/saurian/nc/apps/serverinfo/lib/Os.php#155	
2020-05-06T10:53:28+0100
Error	PHP	Undefined variable: result at /home/sauriano/public_html/saurian/nc/apps/serverinfo/lib/OperatingSystems/DefaultOs.php#173	
2020-05-06T10:53:28+0100
Error	PHP	shell_exec() has been disabled for security reasons at /home/sauriano/public_html/saurian/nc/apps/serverinfo/lib/OperatingSystems/DefaultOs.php#157	
2020-05-06T10:53:28+0100
Debug	cron	Finished OCA\UpdateNotification\ResetTokenBackgroundJob job with ID 163 in 0 seconds	
2020-05-06T10:53:28+0100
Debug	cron	Run OCA\UpdateNotification\ResetTokenBackgroundJob job with ID 163	
2020-05-06T10:53:28+0100
Error	PHP	Invalid argument supplied for foreach() at /home/sauriano/public_html/saurian/nc/apps/serverinfo/templates/settings-admin.php#101	
2020-05-06T10:53:25+0100
Error	PHP	Undefined variable: result at /home/sauriano/public_html/saurian/nc/apps/serverinfo/lib/OperatingSystems/DefaultOs.php#173	
2020-05-06T10:53:20+0100
Debug	cron	Finished OCA\Files_Trashbin\BackgroundJob\ExpireTrash job with ID 12 in 0 seconds	
2020-05-06T10:53:09+0100
Debug	cron	Run OCA\Files_Trashbin\BackgroundJob\ExpireTrash job with ID 12	
2020-05-06T10:53:09+0100
Debug	core	OC_Image->fixOrientation() Orientation: 6	
2020-05-06T10:51:52+0100
Debug	cron	Finished OCA\DAV\BackgroundJob\EventReminderJob job with ID 11 in 0 seconds	
2020-05-06T10:51:44+0100
Debug	cron	Run OCA\DAV\BackgroundJob\EventReminderJob job with ID 11	
2020-05-06T10:51:44+0100
Debug	cron	Finished OCA\DAV\BackgroundJob\CleanupInvitationTokenJob job with ID 10 in 0 seconds	
2020-05-06T10:51:26+0100
Debug	cron	Run OCA\DAV\BackgroundJob\CleanupInvitationTokenJob job with ID 10	
2020-05-06T10:51:26+0100
Debug	cron	Finished OCA\DAV\BackgroundJob\UpdateCalendarResourcesRoomsBackgroundJob job with ID 9 in 0 seconds	
2020-05-06T10:49:15+0100
Debug	cron	Run OCA\DAV\BackgroundJob\UpdateCalendarResourcesRoomsBackgroundJob job with ID 9	
2020-05-06T10:49:15+0100
Debug	cron	Finished OCA\DAV\BackgroundJob\CleanupDirectLinksJob job with ID 8 in 0 seconds	
2020-05-06T10:48:55+0100
Debug	cron	Run OCA\DAV\BackgroundJob\CleanupDirectLinksJob job with ID 8	
2020-05-06T10:48:55+0100
Debug	core	OC\AppFramework\Middleware\Security\Exceptions\NotLoggedInException: Current user is not logged in	
2020-05-06T10:48:51+0100
Debug	cron	Finished OC\Settings\BackgroundJobs\VerifyUserData job with ID 162 in 3 seconds	
2020-05-06T10:48:46+0100
Debug	cron	Run OC\Settings\BackgroundJobs\VerifyUserData job with ID 162	
2020-05-06T10:48:43+0100

The output of your config.php file in `/path/to/nextcloud` (make sure you remove any identifiable information!):

PASTE HERE


The output of your Apache/nginx/system log in `/var/log/____`:

PASTE HERE


I'd be very grateful for any advice as to how I can resolve this issue and perform the upgrade. 

Thanks in advance!!

If you would have used the search function of this forum first, you had found the general recommendation to move the files away from the Nextcloud document root directory to get rid of the message.

j-ed, thanks for responding. I actually tried at least half-a-dozen different search parameters as well as searching the site from Google rather than use the internal search feature. I found multiple postings from people with similar but subtly different issues and whilst I did try out the various options, none worked for me.

I did, however, find the error.

The original error message reported multiple files being in the way, and included in that list examples such as “php.ini” and “cgi-bin”.

I was able to find and remove the “php.ini” file without difficulty, but it turns out that the “cgi-bin” error was being caused not by a file of that name, but a folder. I checked the folder and, on finding it empty, figured I could re-create it if I hit problems. I deleted the folder and was able to proceed past that point.

It might be a minor thing, but given that there were other files present that the error message listed, I took the error message at literal face value. If the message had been written to say that there were inappropriate “files and/or folders” present, then I have trusted myself to crack on. However, when you’re trying to diagnose something with which you’re not familiar, deleting random objects - at least without first seeking guidance - seemed unwise.

Hopefully if anyone else sees a similar error, this update will help them get past it.

2 Likes