backdrop-contrib / bulk_media_upload

Bulk Media Upload creates nodes for uploaded files.
GNU General Public License v2.0
0 stars 2 forks source link

AJAX HTTP error when attempting upload, .tmp file could not be moved/copied #15

Open Lais-here opened 5 months ago

Lais-here commented 5 months ago

Attempting to add these 5 image files via Bulk_media_upload. The input page works fine, lets me add all the details needed. However, it does not actually upload any files.

Files I'm trying to add: 2024-03-30-rm_203043.jpeg 2024-03-30-rm_213527.jpg 2024-03-30-rm_213735.jpg 2024-03-30-rm-6.jpg 2024-03-30-rm-7.jpg

bulk-media-upload-files

Gives errors, and is attempting to upload a file I don't recognize. It gives a different .tmp filename each time I attempt the upload.

The specified file p1hsg63f0n76he21tej6u015cb4.tmp could not be moved/copied because no file by that name exists. Please check that you supplied the correct filename.

The specified file p1hsg8rj5d1ik8gmf1m9a1sc911on4.tmp could not be moved/copied because no file by that name exists. Please check that you supplied the correct filename.

bulk-media-upload-errorsApr27

bulk-media-upload-errorsApr27-bad-filename

Lais-here commented 5 months ago

Wanted to add I'm using this module on a production Drupal 7 site and though it actually creates the images and appears to work in the end, at one point it hangs up and stops processing. When I check the error log, it's giving a lot of warning messages about pagers, such as: Warning: Undefined property: stdClass::$nid in custom_pagers_plugin_style_php_array->render() (line 18 of /home/bpsal/public_html/sites/all/modules/custom_pagers/views/custom_pagers_plugin_style_php_array.inc).

Warning: Undefined array key -1 in pager_entries_by_key() (line 286 of /home/bpsal/public_html/sites/all/modules/custom_pagers/custom_pagers.module)

And even though I'm doing this as admin, some of the messages are showing up as if I'm Visitor:

Warning: Cannot modify header information - headers already sent by (output started at /home/bpsal/public_html/includes/common.inc:2861) in drupal_goto() (line 709 of /home/bpsal/public_html/includes/common.inc).

argiepiano commented 5 months ago

Hi @Lais-here. I'm not the maintainer of this module - the module hasn't been updated in almost 5 years and the listed maintainer is no longer active in the community AFAIK.

So, first, the file names such as p1hsg63f0n76he21tej6u015cb4.tmp are normal. When you upload a file to your site, it's first put in a temporary folder with a temporary name, which is changed once moved to the permanent location.

Now, why is this failing, I don't know. It's working fine for me. What you need to do is to check again, and this time, after the failure, go to your site's recent log messages page admin/reports/dblog and copy all the error messages there. Then come back and paste those here.

argiepiano commented 5 months ago

Also, check where the temporary directlory is for your site, by going to admin/config/media/file-system. Then check that directory and be sure your user has writing permissions there.

Lais-here commented 5 months ago

@argiepiano Thanks for looking at this. I'm using this module on both the D7 and Backdrop site as admin2, with all access. There are a lot of temp files in the cPanel tmp folder which appear to be images that were uploaded to the D7 site. Could there be a conflict?

recent-log-msg-bulk-upload recent-log-msg-bulk-upload-1 recent-log-msg-bulk-upload-2 recent-log-msg-bulk-upload-3 cpanel-tmp-bulk-upload cpanel-tmp-permissions

argiepiano commented 5 months ago

Is there any other error in the log before the file entry in your photo? (the one about the file that could not be moved). The two other errors shown in your photo (PDO exception) are to be expected since the file was not available.

Lais-here commented 5 months ago

No, I checked the log before running the bulk upload. Here is another screenshot taken a few minutes ago with some items before and after the attempt.

Update: I checked the error logs in cPanel and there are several, but the ones related to this upload attempt have already aged off. I'll do another attempt and try to capture the cPanel errors in a few minutes.

recent-log-messages-may5

Lais-here commented 5 months ago

cPanel errors list immediately after attempting the bulk upload.

error-list-cpanel-after-bulk-upload-attempt

Lais-here commented 5 months ago

Noticed that there are errors given by index.php. There are two of these files. Some of the errors seem triggered by the Drupal index.php, others by the Backdrop index.php.

Directory structure: public_html there is an index.php file set up by Drupal directly in public_html backdrop.bps-al.org - this folder has ALL the backdrop files/modules, including an index.php created by backdrop All these folders are Drupal folders: files includes modules profiles scripts sites themes tmp

Backdrop files are totally contained in its folder. Drupal files/folders are scattered all over public_html.

Could the Drupal index.php file be blocking the Backdrop index.php and creating this error?

error-list-cpanel-after-bulk-upload-attempt-more cpanel-file-manager

argiepiano commented 5 months ago

Is your Backdrop site working OK otherwise? Are you able to manually upload single files at /file/add?

There may be an issue with the htacces files. In that client denied list, do you recognize the IP number? Is that yours or an external ip?

Lais-here commented 5 months ago

As far as I know, the Backdrop site is working mostly. I did notice this past week that my view and edit tabs have disappeared from the top of my content pages. keiserjb has been working to get Hierarchical Select working, and that may have affected it. I'll have to check into that. Also, some of my views don't work/are broken, and he discovered that some views appeared to be interfering with

Correction/edit here>>> another view. The Hierarchical Select was affected by some themes, so I need to disable some of mine to see if that changes anything.

Yes, I can manually add single image files and it seems to work well from /node/add/image. Don't know that I ever use the /file/add method for images - maybe rarely when I need an image within the content body for events or exhibits. The bulk of the site images are to attach to the bottom of field trip reports, and show in an image gallery. When I try with the bulk_media_upload, it errors out whether I use 1 image file or 30.

I have also uploaded images for the site banner using the options in the Scenery Theme, and those worked properly.

After talking with my hosting company, I believe the errors on the server error log messages are from bots or bad actors trying to break directly into the server. Those are not my IP addresses, and appear to be hackers. I realized this when one of the attempted hacks was for a wp known vulnerability.

argiepiano commented 5 months ago

One more check. Can you change the private file system path of your Backdrop site (only - not your Drupal site) to a brand new directory (be sure you have writing permission) admin/config/media/file-system?

Lais-here commented 5 months ago

I've set up a new folder on cPanel called files_test. Has the same permissions as the current files and the sites/default/files, which is 0755. Changed the path at admin/config/media/file-system to files_test. I'll run a test and report back.

Lais-here commented 5 months ago

No luck, same error.

error-after-set-up-files_test-tmp

Lais-here commented 5 months ago

Something (Backdrop or Apache) created an .htaccess file in the new files_test folder, but there is nothing else in the folder.

argiepiano commented 5 months ago

Well, I'm stumped. Without access to the site or DB is hard to debug. One more attempt - can you paste a photo of the configuration page at admin/config/media/bulk_media_upload and the upload page at admin/content/file/bulk_upload?

Lais-here commented 5 months ago

I can give you access to the site, but don't want to put credentials on here. I will hopefully be at Office Hours tomorrow/ Wednesday and you could look at my screens. Only possible glitch is the thrift store is coming between 8-5 tomorrow and won't give me an exact time, will have to be away for 30-45 minutes for that. Keeping fingers crossed they come early morning.

Give me a few minutes and I'll post the requested pages.

Lais-here commented 5 months ago

Here are the pages. On the bulk upload page, I only complete a few items: I drag/drop images to the bulk media upload section, then click Start upload. Privacy is usually left as none. Weight is usually 5 Image galleries is usually: Image Galleries -- Field Trip Photos --- 2024-05-03 (date is the actual field trip date) I'll choose a state and county choose an Era Then Generate Content entities.

bulk-media-upload-settings-1

bulk-media-upload-settings-2

bulk-media-upload-settings-3

content-file-bulk-upload.pdf

argiepiano commented 5 months ago

And no content is created after the failure?

Lais-here commented 5 months ago

Correct. Look at the pdf that I attached, easy to miss at the bottom of my last post.