Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with exporting using Firefox or Safari (or PHP8.1.4 issue) - file is not saved because of issue with reading source file #17445

Closed
Draghmar opened this issue Mar 18, 2022 · 27 comments · Fixed by #17447
Assignees
Labels
Bug A problem or regression with an existing feature has-pr An issue that has a pull request pending that may fix this issue. The pull request may be incomplete
Projects
Milestone

Comments

@Draghmar
Copy link

Draghmar commented Mar 18, 2022

Describe the bug

Not sure if it's FF or phpMyAdmin or something completely different but recently whenever I want to export anything (doesn't matter if it's sql or csv and if it's compressed or not) I'm getting weird message about FF not being able to read source file, which results in file not being downloaded/saved. The file placeholder is created at the destination but it's removed right after hitting confirmation on the window:
obraz
The message in the window can be translated as:

Downloading ...
File ... can not be saved because source file is not readable.
You should try later or contact server administrator.

I also tried that on older FF version (98dev) and there was no message but the file was empty.
Using View output as file works properly.

Also affects Safari: hestiacp/hestiacp#2529 (comment)

To Reproduce

Steps to reproduce the behavior:

  1. Go to any table.
  2. Click on Export.
  3. Choose to save as file.
  4. See error.

Server configuration

  • Operating system: ArchLinux
  • Web server: Apache/2.4.52
  • Database version: doesn't matter, tried this on few
  • PHP version: 8.1.4
  • phpMyAdmin version: 5.1.3

Client configuration

  • Browser: Firefox 99.0b5
  • Operating system: Win10
@kamil-tekiela
Copy link
Contributor

Do you encounter this issue in Firefox Safe mode as well? It sounds more like a client issue. Have you tried reinstalling and resetting all Firefox settings?
Would you be able to tell us what you see in the Network tab? Press F12 and monitor the Network tab when trying the export. Take some screenshots of the response headers if possible.

@Draghmar
Copy link
Author

Draghmar commented Mar 18, 2022

I've made additional tests from different server with the same phpMyAdmin version but it had PHP 8.1.3. It worked there. But after updating to 8.1.4 the same issue showed up. After seeing that I also checked this on Chrome and there's the same result, which is empty file because of the "network issue". That would suggest it's related to PHP 8.1.4 somehow...

As for the headers, this is when trying to export as sql:

HTTP/2 200 OK
x-powered-by: PHP/8.1.4
x-ob_mode: 1
content-encoding: gzip
vary: Accept-Encoding
expires: Fri, 18 Mar 2022 14:44:04 +0000
cache-control: no-store, no-cache, must-revalidate,  pre-check=0, post-check=0, max-age=0
pragma: no-cache
content-description: File Transfer
content-disposition: attachment; filename="REMOVED.sql"
content-transfer-encoding: binary
set-cookie: REMOVED; path=/; secure; HttpOnly; SameSite=Strict
set-cookie: REMOVED path=/; secure; HttpOnly; SameSite=Strict
last-modified: Fri, 18 Mar 2022 14:44:04 GMT
content-type: text/x-sql;charset=utf-8
date: Fri, 18 Mar 2022 14:44:03 GMT
server: Apache/2.4.52 (Unix) OpenSSL/1.1.1m
X-Firefox-Spdy: h2

And this one is for csv:

HTTP/2 200 OK
x-powered-by: PHP/8.1.4
x-ob_mode: 1
content-encoding: gzip
vary: Accept-Encoding
expires: Fri, 18 Mar 2022 14:47:43 +0000
cache-control: no-store, no-cache, must-revalidate,  pre-check=0, post-check=0, max-age=0
pragma: no-cache
content-description: File Transfer
content-disposition: attachment; filename="REMOVED.csv"
content-transfer-encoding: binary
set-cookie: REMOVED path=/; secure; HttpOnly; SameSite=Strict
set-cookie: REMOVED path=/; secure; HttpOnly; SameSite=Strict
last-modified: Fri, 18 Mar 2022 14:47:43 GMT
content-type: text/comma-separated-values;charset=utf-8
date: Fri, 18 Mar 2022 14:47:42 GMT
server: Apache/2.4.52 (Unix) OpenSSL/1.1.1m
X-Firefox-Spdy: h2

@Draghmar Draghmar changed the title Issue with exporting using FF - file is not saved because of issue with reading source file Issue with exporting using FF (or PHP8.1.4 issue) - file is not saved because of issue with reading source file Mar 18, 2022
@kamil-tekiela
Copy link
Contributor

Related php/php-src#8218

kamil-tekiela added a commit to kamil-tekiela/phpmyadmin that referenced this issue Mar 18, 2022
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
kamil-tekiela added a commit to kamil-tekiela/phpmyadmin that referenced this issue Mar 18, 2022
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
@ophian
Copy link

ophian commented Mar 22, 2022

Just to confirm this now being solved.
I had this export issue on 5.1.3 and PHP 8.1.4 with Firefox versions too on windows.
Adding the patch #17447 export runs well again,

@bessone
Copy link

bessone commented Mar 24, 2022

I had the same problem with PhpMyAdmin 5.1.3 and PHP 8.0.17, both using Firefox and Chrome.

Applying the patch the problem disappeared.

kamil-tekiela added a commit to kamil-tekiela/phpmyadmin that referenced this issue Mar 25, 2022
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
@williamdes williamdes added Bug A problem or regression with an existing feature has-pr An issue that has a pull request pending that may fix this issue. The pull request may be incomplete labels Mar 25, 2022
@williamdes williamdes added this to the 5.1.4 milestone Mar 25, 2022
@williamdes williamdes added this to Needs triage in issues via automation Mar 25, 2022
@williamdes williamdes moved this from Needs triage to ready to merge in issues Mar 25, 2022
@williamdes williamdes linked a pull request Mar 25, 2022 that will close this issue
kamil-tekiela added a commit to kamil-tekiela/phpmyadmin that referenced this issue Mar 26, 2022
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
@ibennetch ibennetch pinned this issue Mar 29, 2022
@DarceyLloyd
Copy link

Same issue, tried in win: chrome/firefox/opera/edge & ubuntu firefox).
Network error, if download is forced you end up with a html dump in a sql file.

Issue occurs on:

  1. Windows xampp, phpmyadmin 5.1.3, PHP 8.1.4
  2. Ubuntu 20.x LTS, phpmyadmin 5.1.3, PHP 8.1.4

Also tried phpMyAdmin-5.2.0-rc1, same result.

Alternate route advised:
Reverse engineered database's via DbSchema (Maria) & MySQL Workbench (MySQL) and use DBeaver to do the rest.

@williamdes

This comment was marked as resolved.

@williamdes
Copy link
Member

Hi everybody, can you try the latest 5.1 version in development (phpMyAdmin 5.1+snapshot) and let me know if it works fine afterwards ?

@matthiasradde
Copy link

Checked with (phpMyAdmin 5.1+snapshot) -> successful!
Exporting to file is possible again with PHP 8.1.4
(Tested with Win10 + FF98.0.2 + Chrome 100.0.4896.60 + Apache 2.4.53 + PHP 8.1.4 - 64bit where possible)

Thanks all for investigating and solving this issue.

@VFAndrew
Copy link

Exports are working again for me. Thanks.

@tylerkowalchuk
Copy link

tylerkowalchuk commented Mar 31, 2022

I was having this problem with PHP 8.0.17 as well. With PMA 5.1+snapshot, exports are working again for me.

@soloincc
Copy link

soloincc commented Apr 1, 2022

Using PHP 8.1.4 and PMA 5.1.3 exports weren't working. They are now working using PMA 5.1+snapshots

@DarceyLloyd
Copy link

Confirmed working with phpMyAdmin 5.1+snapshot, tested on:

  • Windows Xampp - Apache, PHP 8.1.4, MariaDb - Chrome & Firefox
  • Ubuntu 20.04 LTS Server - Nginx, PHP 8.1.4, MariaDb - Chrome & Firefox

Nice 1

@mtovmassian
Copy link

mtovmassian commented Apr 8, 2022

On my side I had to downgrade Docker image to phpmyadmin:5.1.1 to have the export feature work properly.

@williamdes
Copy link
Member

On my side I had to downgrade Docker image to phpmyadmin:5.1.1 to have the export feature work properly.

Yeah, this is because the image switched to PHP 8 in phpmyadmin/docker@7c28533 before 5.1.2 was released and build in the docker image :)

@fd6130
Copy link

fd6130 commented Apr 13, 2022

Hi everybody, can you try the latest 5.1 version in development (phpMyAdmin 5.1+snapshot) and let me know if it works fine afterwards ?

Yay, it is working again in php 8.0.17 ubuntu 20.04 mariadb 10.6.7

@nelsonprsousa
Copy link

Is it possible to test phpMyAdmin 5.1+snapshot as a docker image?

@williamdes
Copy link
Member

Is it possible to test phpMyAdmin 5.1+snapshot as a docker image?

Yes, are you able to build docker images on your setup ?
You may want to copy, tweak and remove some security rules from this file https://github.com/phpmyadmin/docker/blob/master/apache/Dockerfile

@williamdes williamdes changed the title Issue with exporting using FF (or PHP8.1.4 issue) - file is not saved because of issue with reading source file Issue with exporting using Firefox or Safari (or PHP8.1.4 issue) - file is not saved because of issue with reading source file Apr 15, 2022
@nelsonprsousa
Copy link

Is it possible to test phpMyAdmin 5.1+snapshot as a docker image?

Yes, are you able to build docker images on your setup ? You may want to copy, tweak and remove some security rules from this file https://github.com/phpmyadmin/docker/blob/master/apache/Dockerfile

I'll see. Thanks :)

@MauricioFauth MauricioFauth self-assigned this Apr 21, 2022
issues automation moved this from ready to merge to Closed Apr 21, 2022
@williamdes
Copy link
Member

Fixed by 51f26fa

@MuhammadUsman0304
Copy link

I always find that (Network Failed) error every time I export a database from PHPMyAdmin using XAMPP. my php version 8.0.18
any solution?

@matthiasradde
Copy link

@thesoftwaresquad please provide more details - in addition to the PHP-version the PHPMyAdmin-version and the browser you are using might be helpful.
For me using the snapshot-version https://www.phpmyadmin.net/downloads/#snapshot_5.1+snapshot was working for me with PHP 8.1.x and Firefox and Chrome.

@rudiedirkx
Copy link

According to the changelog this is a "Firefox or Safari" issue, but it isn't just. It probably shouldn't say that.

freebsd-git pushed a commit to freebsd/freebsd-ports that referenced this issue May 21, 2022
Changelog:
Welcome to the release of phpMyAdmin version 5.2.0. This release contains many new features and quite a few bug fixes. We are simultaneously releasing phpMyAdmin 5.1.4, which is the last release of the 5.1 line and is mostly intended to help downstream packaging teams. Most users should migrate to 5.2.0.

Most notably, these releases resolve a networking error when exporting a file (phpmyadmin/phpmyadmin#17445).

Some other highlights of 5.2.0 include:

    Removed support for Microsoft Internet Explorer
    Requires PHP 7.2 or newer
    Requires the openssl PHP extension
    Improved handling of system CA bundle and cacert.pem, falling back to Mozilla CA if needed
    Replace "master/slave" terms with "primary/replica"
    Add "NOT LIKE %...%" operator to Table search
    Add support for the Mroonga engine
    Add support for account locking
    Several fixes and improvements to the SQL parser library

Sponsored by:	Netzkommune GmbH
@gitderekz
Copy link

This is what I did,
While you export you will find Quick is selected,
->you need to select custom, then
-->go to Output section and do the following
--->select, save output to file
---->on compression category, select zipped

Then go on download your table as a zipped file.

@DRF24k
Copy link

DRF24k commented Oct 18, 2022

Hi all! I have this same error. Glad to see there is a patch that fixes it. ...where do I find patch #17447? Clicking on the link gets me to a thread where a test case is discussed, but I don't see where to download or implement the patch anywhere.

@matthiasradde
Copy link

@DRF24k You can use phpMyAdmin 5.2.0 (or any newer version - if available) or the nightly builds which include this patch. If you really need to stay an phpMyAdmin 5.1 then you can find the patch at the URL you have linked - there you go to the tab "files" to see what exactly was modified in which file: https://github.com/phpmyadmin/phpmyadmin/pull/17447/files

@DRF24k
Copy link

DRF24k commented Oct 18, 2022

Thank you for the link, but I am afraid I can't tell what I'm looking at. Is it color coded for something?

I'm using the phpMyAdmin that came installed with XAMPP. It's 5.1.3, it seems. I tried replacing the folder with a new verison, but then I couldn't log in. Thank you. I will give it another try.

WOHOO! Turns out all I had to do was copy the configuration file over to the new folder! Ha ha! Thank you for all your help!!

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug A problem or regression with an existing feature has-pr An issue that has a pull request pending that may fix this issue. The pull request may be incomplete
Projects
issues
  
Closed
Development

Successfully merging a pull request may close this issue.