Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+5 votes
744 views
in Q2A Core by

Answering a question, and can no longer upload images, after upgrading to Version 1.8.6

When I select Image icon in answer banner:

Q2A works as expected and takes me to the Image upload dialog:

I then select the 'Upload' tab in the upper banner, and Q2A successfully updates the dialog, and I next select 'Choose File', i.e:

After navigating to the jpeg image I wish to upload and selecting it, and next selecting 'Open', i.e.:

Q2A then takes me back to the 'Image Properties' dialog, and I next select 'Send it to the Server', i.e.:

This is where Q2A fails, as compared to what it used to do. The dialog  changes back to the 'Image Info' banner tab (as expected) but the lower 'Preview' view does not show the image, it eventually displays a big red X, and the details of the image (Width, Height, Border,...) are all blank, i.e.:

Any pointers on how to debug what is wrong would be greatly appreciated.

Q2A version: 1.8.6
by
+1
1. What does the web browser's console log show?
2. What does the server's error log show?
by
Thank you for the reply, I checked those originally and didn't see anything that would give me a hint of what is the issue.

However, I forced the logs to switch and then reran the image upload as detailed.

No entries in error.log, i.e.:
-rw-r----- 1 root adm 0 Jun 20 10:18 apache2/error.log



Here are the contents of the apache2 access.log:
127.0.0.1 - - [20/Jun/2022:10:19:43 -0700] "POST /index.php?qa=wysiwyg-editor-upload&qa_only_image=1&CKEditor=a270_content&CKEditorFuncNum=0&langCode=en HTTP/1.1" 200 523 http://<redacted url>/index.php?qa=269&qa_1=test-question-1-please-stop&state=edit-270 "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.115 Safari/537.36"



Here are the time related entries in the /var/log/syslog (hostname redacted):
Jun 20 10:19:32 <redacted hostname> dbus-daemon[693]: [system] Activating via systemd: service name='org.freedesktop.hostname1' unit='dbus-org.freedesktop.hostname1.service' requested by ':1.999' (uid=1000 pid=1684 comm="/opt/brave.com/brave/brave --enable-crashpad ")
Jun 20 10:19:32 <redacted hostname> systemd[1]: Starting Hostname Service...
Jun 20 10:19:32 <redacted hostname> dbus-daemon[693]: [system] Successfully activated service 'org.freedesktop.hostname1'


Here are the time related entries in the /var/log/daemon.log (hostname redacted):
Jun 20 10:19:32 <redacted hostname> dbus-daemon[693]: [system] Activating via systemd: service name='org.freedesktop.hostname1' unit='dbus-org.freedesktop.hostname1.service' requested by ':1.999' (uid=1000 pid=1684 comm="/opt/brave.com/brave/brave --enable-crashpad ")
Jun 20 10:19:32 <redacted hostname> systemd[1]: Starting Hostname Service...
Jun 20 10:19:32 <redacted hostname> dbus-daemon[693]: [system] Successfully activated service 'org.freedesktop.hostname1'
Jun 20 10:19:32 <redacted hostname> systemd[1]: Started Hostname Service.
Jun 20 10:20:02 <redacted hostname> systemd[1]: systemd-hostnamed.service: Succeeded.

I hope you can see something I didn't.
-John
by
OK. What is the response you're getting? I mean, the "Response" tab if you're using Chrome and select the POST request in the "Network" tab.
by
Sorry, don't know what you mean. Can you elucidate?
by
In Chrome after you opened a page press <Ctrl>-<Alt>-<I> ("India," not "Lima"). In the web browser debugging tools window select the "Network" tab. Then select the request in question in the "Name" column (you may need to reload the page first) and select the the sub-tab "Response."

See here: https://www.grosseblondefrau.ch/screenshot/prtscr_2022-06-21_130415_707143096.png
by
Thank you for the instructions. Installed chromium and went through the same process again as outlined above, and if also failed with chromium just to confirm. The debugger showed that after 2.2 minutes the ckeditor.js had an issue. Status of (failed).  Love to upload a screen capture, but reply's on this site are limited to text only. I will work with the chromium debugger and see if I can get more information other than 'failed'.
by
I drilled down into the failing item, and selected the 'Initiator' tab. Grabbed a screen shot and uploaded to my Google drive, i.e.:

https://drive.google.com/file/d/1kVAlcTdf2Edjk-qGta5kPbXj_gzxgqSN/view?usp=sharing
by
1. Grab a screenshot of the Response and Headers tab (of the failing request, of course)
2. Are you managing files using QA_BLOBS_DIRECTORY in qa-config.php?
3. Are you using the WYSIWYG editor that comes with the Q2A release (without any change to its code)?
by
Hello,

Thank you for continued help.

The screen shots are,

Headers:
https://drive.google.com/file/d/1kVAlcTdf2Edjk-qGta5kPbXj_gzxgqSN/view?usp=sharing

Response:
https://drive.google.com/file/d/1e0w6_VKi8GUUo7q0VkOJt5VGwAQ3LQcL/view?usp=sharing

Here is the additional information you requested.

2. Are you managing file using QA_BLOBS_DIRECTORY in qa-config.php?

/var/www/html/<qa dir>/qa-config.php

3. Are you using the WYSIWYG editor that comes with the Q2A release (without any change to its code)?

Yes, I have made no code mods to the WYSIWYG editor.
by
1. You are missing the Headers one. You've linked the Initiator tab again.

2. I mean, in qa-config.php, do you see this:

define('QA_BLOBS_DIRECTORY', '/path/to/writable_blobs_directory/');

Or have you actually uncommented that code and set an actual value to that constant?

Note this defines if your blogs are saved to disk or to the database.
by
Sorry about the image url for the Headers, try this one:

https://drive.google.com/file/d/1QzgyiSZ8PeVZmNx5lBZxPT4bEBmu1v7j/view?usp=sharing

And the parameter QA_BLOBS_DIRECTORY is still the default, like what you have above, and is commented out.
by
Interesting. I wanted to see the status code and it is not there. If you click on the "X" next to the Headers tab you will see the list of columns. I'm sure there is one for Status.

1. What is that status?

I get the impression something is blocking those requests.

2. Also, can you share the Headers and Response tabs of the POST request immediately before the one you have selected in the image? (the one that starts with index.php?wysiw...). For the response, please, just remove the domain as precisely as you can, I'd like to see every other character.

3. Make sure you have properly configured your site URL in admin/general. For example, for this site, it would be: https://www.question2answer.org/qa (note it should be HTTPS, rather than HTTP)

4. Can you replicate this issue with different URL structures in admin/general?

5. a. What image type are you uploading? I can confirm the image in your last post is a JPG image created with GIMP.
b. Do you get the same error when trying to upload THAT image?

6. Is there any reason why you are not using HTTPS?

7. In php.ini are you logging ALL errors? error_reporting = E_ALL

8. a. Do you have the GD extension of PHP?
b. Is it compiled with JPEG support?
c. What is your PHP version?

9. Are you able to upload the "Default avatar" image in admin/users? If not, what is the error you're getting?

BTW, check the "Disable cache" checkbox in the last image.
by
Hello,

Thanks again for all your assistance.

Lots of information requested, I will do the best I can.

1. Status, below is the captured image, and yes it is a network timeout:

https://drive.google.com/file/d/1pZAsRQMCO3KcOE9GE3DRWj2l5nm1mvW_/view?usp=sharing

2. The Headers data was over 1 page in size so captured in two separate screen grabs:

WYSIWYG Header 1:
https://drive.google.com/file/d/1hEcFtn_Ir4mdtdLzw0tUWGkyH78rtWwN/view?usp=sharing

WYSIWYG Header 2:
https://drive.google.com/file/d/1fpzZvooHcieJHGoey1AO7P3Z6coHAkSU/view?usp=sharing

3. Changed to https from http for site URL in admin/general; then retested image upload.
Unfortunately no difference.

4. I presume you mean try the upload again after changing from http to https.
I did and no difference.

5. The image is jus a screen capture from GIMP, and I uploaded it to my 1.8.1 Q2A version instance at home no issue.

6. No reason, just using default out of the box Q2A install.

7. Yes, i.e.:
$ php --info | grep errordisplay_errors => STDERR => STDERR
display_startup_errors => On => On
error_append_string => no value => no value
error_log => syslog => syslog
error_prepend_string => no value => no value
error_reporting => 32767 => 32767
html_errors => Off => Off
ignore_repeated_errors => Off => Off
log_errors => On => On
log_errors_max_len => 0 => 0
track_errors => Off => Off
xmlrpc_error_number => 0 => 0
xmlrpc_errors => Off => Off
intl.error_level => 0 => 0
opcache.error_log => no value => no value

8a. I am not familiar with GD extension, so my guess is NO.
8b. Unsure
8c $ php -v
PHP 7.3.31-1~deb10u1 (cli) (built: Oct 24 2021 15:18:08) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.31, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.3.31-1~deb10u1, Copyright (c) 1999-2018, by Zend Technologies

9. Yes, uploaded my avatar (jpeg) as default image, no issues.

On the 'Disable cache', I presume you want me to select that before attempting any future debugging.

Thanks again,
-John
by
You mentioned things were properly configured in admin/general. However, I'm a bit confused based on this image: https://lh4.googleusercontent.com/eFPeDrA49qZDC9PZV9WKRzaR9JvzDtcaf-7a3zNVYgIxDzA9S2hHHG8r_prPG0igvfXPJlRlZoo70JOHvN0D=w1920-h963-rw

It seems the failing request is trying to reach http://somesite.net/aixqa

But the WYSIWYG editor is being loaded from http://somesite.net/qa-plugin/wysiwyg-editor (note there is no "aixqa" there)

Why is that happening?
by
Hello,

Sorry can't open the URL for the image you reference, I get permission denied, i.e.:

https://drive.google.com/file/d/12BBjXLIlEPqzKdEn6p9jNG5imB5I6o76/view?usp=sharing

Unsure why there is no 'aixqa' in the load path for the wysiwyg editor. I have tar'ed up the entire q2a site, and am comparing to the 1.8.1 files on my working system to see if there is any misconfig that may be causing this.
by
Sorry, I've linked to some GDrive cache, I guess. This was the image I was referring to.

https://drive.google.com/file/d/1kVAlcTdf2Edjk-qGta5kPbXj_gzxgqSN/view

Without taking into consideration the existence of any plugin that might be changing stuff, the site URL in admin/general should be the only setting that would involve a URL.

Also don't forget maybe there is some web server setting (e.g. a reverse proxy, maybe?) or DNS configuration that might be generating unexpected results
by
+1
Thank you for all of your insight and help. Unable to find what is wrong with 1.8.6, so rolled back to 1.8.1 and all is working now.

I will try a fresh install of 1.8.6 later, with a new MySQL DB, and see if it goes better. I believe there is something embedded in the DB after the upgrade that is causing the issue.

Thanks again.
by
Probably you can try 1.8.6 with "qa-plugin/wysiwyg-editor" folder from 1.8.1. I believe they should be compatible.
by
+1
Actually I did try that before rolling back. Didn't work either unfortunately, but thanks for the suggestion.
by
Oh. It's puzzling then

Please log in or register to answer this question.

...