Bug 106427 - failure to diagnose invalid file: URL
Summary: failure to diagnose invalid file: URL
Status: RESOLVED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Base (show other bugs)
Version:
(earliest affected)
5.4.0.0.alpha0+
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Database-Wizard
  Show dependency treegraph
 
Reported: 2017-03-08 03:57 UTC by Terrence Enger
Modified: 2021-11-10 19:22 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
example.fdb (1.45 MB, application/octet-stream)
2017-03-08 03:59 UTC, Terrence Enger
Details
make debugrun with backtrace from hang (78.69 KB, text/plain)
2017-03-08 04:01 UTC, Terrence Enger
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Terrence Enger 2017-03-08 03:57:50 UTC
Description:
The program used for the attachment is commit 9ba5eb22, committed
2017-02-04, configured
    CC=ccache /usr/bin/gcc
    CXX=ccache /usr/bin/g++
    --enable-option-checking=fatal
    --enable-dbgutil
    --enable-debug
    --without-system-postgresql
    --without-myspell-dicts
    --with-extra-buildid
    --without-doxygen
    --with-external-tar=/home/terry/lo_hacking/git/src
    --without-package-format
built and running on debian-stretch.

The observations in the following STR are collected from daily Linux
dbgutil bibisect repository version 2017-03-07.


Steps to Reproduce:
(1) Download attached example.fdb.  It is a firebird database with one
    table with one column and no records.

(2) In the download directory, run LO with parameters
        --norestore --nologo --base.

(3) In wizard step 1 "Select Database", click "Connect to existing
    database" and in the dropdown list select "Firebird File".  Click
    <Next>.

(4) In wizard step 2 "Connection settings", in "Datasource URL", type
    "file://example.fdb" without the quotes.  (Yes, I know that this
    is an invalid URL.)  Click <Next>.

    Observed : The wizard progresses to step 3.

    Expected : a complaint about the invalid URL.

(5) In wizard step 3 "Save and proceed", click "No, do not register
    the database".  Click <Finish>.

(6) In "Save as" dialog, navigate to the download directory and enter
    file name "example".  Click <Save>.

    Observed : The program closes "Save as" dialog, and starts to
               display the main database window, showing title bar and
               border, but the rest of the window is transparent.  CPU
               usage is zero.  The window does not respond to X-icon
               on the the toolbar.

    Expected : The program presents the main database window, complete
               and responsive.


Actual Results:  
Described in step (6) above.

Expected Results:
Described in step (6) above.


Reproducible: Always

User Profile Reset: No

Additional Info:
Note some minor variations:
  - The local build shown in the attached gdb run did not get as far
    as showing a hint of the main database window.
  - The local build, given URL file://thing.fdb (when thing.fdb does
    not exist), shows a complete database main window, but it is
    equally unresponsive.



User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Firefox/45.0
Comment 1 Terrence Enger 2017-03-08 03:59:52 UTC
Created attachment 131743 [details]
example.fdb
Comment 2 Terrence Enger 2017-03-08 04:01:29 UTC
Created attachment 131744 [details]
make debugrun with backtrace from hang
Comment 3 Alex Thurgood 2017-03-13 08:01:22 UTC
Hi Terrence,

On my own master debug build :

Version: 5.4.0.0.alpha0+
Build ID: 6de4ecbe1372c0242f406d45cf999969616f87dc
Threads CPU : 2; Version de l'OS :Mac OS X 10.12.3; UI Render : par défaut; 
Locale : fr-FR (fr_FR.UTF-8); Calc: group


I see the following error message :

Impossible d'établir la connexion à la source de données "FB3testincorrectfileurl".

Code d'erreur: 1

firebird_sdbc error:
*I/O error during "open O_CREAT" operation for file "/example.fdb"
*Error while trying to create file
*Permission denied
caused by
'isc_create_database'

This would appear to be the correct behaviour - I don't get a hang or crash...
Comment 4 Terrence Enger 2017-03-13 19:25:47 UTC
Oh.  Of course I avoided that error because I created the database
myself.

To create my database, on a system with firebird 3 installed,
I put these commands into exmple_crt.sql ...

    -- a new database, please
    connect "example.fdb" ;
    drop database ;
    create database "example.fdb";
    connect "example.fdb" ;
    
    -- and a table
    create table "authors"
    ( "author" char (50) primary key
    ) ;

    -- That's all, folks.
    commit ;

and ran

    isql-fb -i example_crt.sql -e
Comment 5 Alex Thurgood 2017-03-16 13:37:41 UTC
(In reply to Terrence Enger from comment #4)
> Oh.  Of course I avoided that error because I created the database
> myself.
> 


Ah oK, well that's me out for the moment then, I don't have Firebird3 server installed on my OSX machine.
Comment 6 Buovjaga 2017-03-19 17:50:02 UTC
Tamás: can you look at this?
Comment 7 Xisco Faulí 2018-01-17 15:09:32 UTC
Hi Terrence,
is this issue still reproducible in master ?
Comment 8 Terrence Enger 2018-01-27 02:06:54 UTC
Thank you for the reminder, Xisco.

With daily Linux dbgutil bibisect repository version 2018-01-22
running on debian-buster, when I try to save the new .odb, LO
complains:

    The connection to the data source "a01" could not be established.

    Error code: 1

    firebird_sdbc error:
    *I/O error during "open O_CREAT" operation for file "/vista/Users/terry/lo_hacking/notes/bug_10xxxx/bug_106427/example.fdb"
    *Error while trying to create file
    *File exists
    caused by
    'isc_create_database'

and the same problem happens when I try to test connection in the
created .odb.

The named file does exists, so the bug is that LO is trying to create
the file.  I am changing bug summary to "failure to diagnose invalid
file: URL".
Comment 9 Drew Jensen 2018-06-30 16:39:27 UTC
verified with Ubuntu 18.04 and 6.2 Alpha0 build on 6-28

Used the example.odb file from the attachment and started LibreOffice as described, entered the URL exactly as shown in the issue. 

The error generated is:
firebird_sdbc error:
*I/O error during "open O_CREAT" operation for file "/home/drew/Desktop/libreofficedev6.2/program/example.fdb"
*Error while trying to create file
*File exists
caused by
'isc_create_database'

the URL was translated to the correct file path, but as it says it is not finding it. The example.fdb is in that directory and can be updated (no rights issue).

So, open the connection properties and change the url from "file://example.fdb"
to "file:///home/drew/Desktop/libreofficedev6.2/program/example.fdb" and of course all is good.
Comment 10 QA Administrators 2019-07-01 02:47:15 UTC Comment hidden (obsolete)
Comment 11 Terrence Enger 2019-07-30 22:20:25 UTC
I get results like Drew Jensen (comment # 9) with ...

a local build of commit f34a525a, 2019-07-15, configured
    CC=ccache /usr/bin/gcc
    CXX=ccache /usr/bin/g++
    CCFLAGS=-Wshadow
    --with-jdk-home=/usr/lib/jvm/default-java
    --enable-split-debug
    --enable-gdb-index
    --enable-ld=gold
    --enable-option-checking=fatal
    #--enable-dbgutil
    --enable-debug
    --without-system-postgresql
    --without-myspell-dicts
    --with-extra-buildid
    --without-doxygen
    --with-external-tar=/home/terry/lo_hacking/git/src
    --without-package-format
built and running on debian-buster.
Comment 12 QA Administrators 2021-07-30 06:21:43 UTC Comment hidden (obsolete)
Comment 13 Terrence Enger 2021-11-10 19:22:18 UTC
In a local build of commit 631aa911, built and running on debian-buster, when I try to save the .odb, LO gives the message

    Error code: 1

    firebird_sdbc error:
    *Unable to complete network request to host "file".
    *Failed to locate host machine.
    *The specified name was not found in the hosts file or Domain Name Services.
    caused by
    'isc_create_database'
     /home/terry/lo_hacking/git/libo6/connectivity/source/drivers/firebird/Util.cxx:68

and LO gives the same message for "Test Connection".

I am setting bug status RESOLVED WORKSFORME.