Bug 396208 - Can't open .xmi file from smb remote location
Summary: Can't open .xmi file from smb remote location
Status: RESOLVED WORKSFORME
Alias: None
Product: frameworks-kio
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: 5.47.0
Platform: Manjaro Linux
: NOR normal
Target Milestone: ---
Assignee: David Faure
URL:
Keywords: triaged
Depends on:
Blocks: 373932
  Show dependency treegraph
 
Reported: 2018-07-05 15:29 UTC by wzygmuntowicz.zygmuntowicz
Modified: 2018-10-29 02:17 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
output_with_screenshots (400.98 KB, application/gzip)
2018-07-05 15:29 UTC, wzygmuntowicz.zygmuntowicz
Details
serwerek_umbrello (10.75 KB, text/plain)
2018-07-08 12:41 UTC, wzygmuntowicz.zygmuntowicz
Details

Note You need to log in before you can comment on or make changes to this bug.
Description wzygmuntowicz.zygmuntowicz 2018-07-05 15:29:08 UTC
Created attachment 113781 [details]
output_with_screenshots

The problem is every time I try to open file from smb remote location I get the error "The file <smb://path/to/umbrello/file.xmi> does not exist.". It only works when I mount the smb share manually and then open the same file. 

In the attachment there is an output from console where I typed "umbrello5 2>&1 | tee umbrello.log" (the moment when I tried to open is near the 103th line) and three screenshots presenting what I have been doing.
Comment 1 Ralf Habacker 2018-07-06 13:10:10 UTC
The KIO framework retrieves files from a remote location. With installed KF5 framework there is a command line application named kioclient5, with which the use case can be checked outside from umbrello. 

How to reproduce: 
If you have configured a file on an SMB server with authentication, e.g. smb://server/data/test.xmi, the file could be downloaded with 

 kioclient5 move smb://server/data/test.xmi /tmp/test.xmi

Executing this command with current KF5 packages (18.04) returns the error message "The file..... does not exist", your are reporting. 

Executing the same command with the KDE4 counterpart

 kioclient move smb://server/data/test.xmi /tmp/test.xmi

opens a password dialog. After entering the correct user and password information, the file is downloaded and stored in /tmp/test.xmi.

The fact that this function works with KDE4 shows that the problem lies in the underlying KF5 framework, probably in kio or the smb kioslave.
Comment 2 wzygmuntowicz.zygmuntowicz 2018-07-07 18:12:49 UTC
(In reply to Ralf Habacker from comment #1)
> The KIO framework retrieves files from a remote location. With installed KF5
> framework there is a command line application named kioclient5, with which
> the use case can be checked outside from umbrello. 
> 
> How to reproduce: 
> If you have configured a file on an SMB server with authentication, e.g.
> smb://server/data/test.xmi, the file could be downloaded with 
> 
>  kioclient5 move smb://server/data/test.xmi /tmp/test.xmi
> 
> Executing this command with current KF5 packages (18.04) returns the error
> message "The file..... does not exist", your are reporting. 
> 
> Executing the same command with the KDE4 counterpart
> 
>  kioclient move smb://server/data/test.xmi /tmp/test.xmi
> 
> opens a password dialog. After entering the correct user and password
> information, the file is downloaded and stored in /tmp/test.xmi.
> 
> The fact that this function works with KDE4 shows that the problem lies in
> the underlying KF5 framework, probably in kio or the smb kioslave.

Actually executing:
  $ kioclient5 move smb://server/data/test.xmi /tmp/test.xmi
doesn't return the error message, moreover It copies file to desired location and I can read It. My kioclient5 version is 5.13.2
Comment 3 Ralf Habacker 2018-07-08 11:41:01 UTC
>  $ kioclient5 move smb://server/data/test.xmi /tmp/test.xmi
> doesn't return the error message, moreover It copies file to desired location and I can read It.
So you did setup a smb server (or a windows host) with hostname 'server', the share 'data' with authentification and placed a file test.xmi in the root dir, which you could download with the mentioned command ? 

In the log it looks you are using an incorrect url

> umbrello: UMLDoc::openDocument: copy from  QUrl("smb://path/to/umbrello/file.xmi")  to  QUrl("file:///tmp/umbrello.HAORWs") .

Please retest with umbrello using the correct url and report if it works
Comment 4 wzygmuntowicz.zygmuntowicz 2018-07-08 12:40:25 UTC
(In reply to Ralf Habacker from comment #3)
> So you did setup a smb server (or a windows host) with hostname 'server',
> the share 'data' with authentification and placed a file test.xmi in the
> root dir, which you could download with the mentioned command ? 

The fact is I changed the real urls in order to hide the company name where do I work (company name was in the url). 

> Please retest with umbrello using the correct url and report if it works

I changed the smb share and repeated steps. Now smb hostname is 'serwerek', share is 'Oprogramowanie' and file name is 'preferences_model.xmi'. 

Umbrello still doesn't work and I attached the output logs again (named 'serwerek_umbrello.log'). Command:
  $ kioclient5 move smb://serwerek/Oprogramowanie/preferences_model.xmi /tmp/preferences_model.xmi
still works perfectly and I can open the file with ubrello from location '/tmp/preferences_model.xmi' after executing kioclient5 command.
Comment 5 wzygmuntowicz.zygmuntowicz 2018-07-08 12:41:13 UTC
Created attachment 113836 [details]
serwerek_umbrello
Comment 6 Ralf Habacker 2018-07-09 08:22:40 UTC
> $ kioclient5 move smb://server/data/test.xmi /tmp/test.xmi

This will fail on the second call because of the changed kioclient5 'move' command behavior. It really moves the file instead of creating a local copy compared to the KDE4 kio client.

So a better test case is

 kioclient5 cp smb://server/data/test.xmi /tmp/test.xmi
Comment 7 Ralf Habacker 2018-07-09 08:32:26 UTC
Looking at the implementation of the kioclient cp command (https://cgit.kde.org/kde-cli-tools.git/tree/kioclient/kioclient.cpp#n210) it turns out that umbrello uses a different KIO function - KIO:copy_file - to fetch remote files (https://cgit.kde.org/umbrello.git/tree/umbrello/umldoc.cpp#n504)
Comment 8 Ralf Habacker 2018-07-09 08:54:45 UTC
KIO::copy does not solve the issue, instead the issue is solved by using KIO::NetAccess::download(), which was used for KDE4.
Comment 9 Christoph Feck 2018-07-30 23:17:13 UTC
What is the status of this issue? It is not clear which information is needed.
Comment 10 Ralf Habacker 2018-08-01 20:14:21 UTC
1. The recent state is that neither KIO::copy_file nor KIO::copy work in the related umbrello context, only KIO::NetAccess::download()
The failing code fragment from umbrello source is:

    QTemporaryFile tmpfile;
    tmpfile.open();
    QUrl dest(QUrl::fromLocalFile(tmpfile.fileName()));
    KIO::FileCopyJob *job = KIO::file_copy(url, dest, -1, KIO::Overwrite);
    KJobWidgets::setWindow(job, UMLApp::app());
    job->exec();
    QFile file(tmpfile.fileName());
    if (job->error() || !tmpfile.exists()) {


2. To reproduce the problem with a test case provided by kio, an attempt was made to simulate this type of kio operation with kioclient5 (comment 6), but could not be reproduced in that way.
Comment 11 Andrew Crouthamel 2018-09-28 03:36:36 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least 15 days. Please provide the requested information as soon as possible and set the bug status as REPORTED. Due to regular bug tracker maintenance, if the bug is still in NEEDSINFO status with no change in 30 days, the bug will be closed as RESOLVED > WORKSFORME due to lack of needed information.

For more information about our bug triaging procedures please read the wiki located here: https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please set the bug status as REPORTED so that the KDE team knows that the bug is ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 12 Andrew Crouthamel 2018-10-29 02:17:21 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least 30 days. The bug is now closed as RESOLVED > WORKSFORME due to lack of needed information.

For more information about our bug triaging procedures please read the wiki located here: https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

Thank you for helping us make KDE software even better for everyone!