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

move.after.process is failing #49

Open
debelyoo opened this issue Mar 27, 2019 · 7 comments
Open

move.after.process is failing #49

debelyoo opened this issue Mar 27, 2019 · 7 comments

Comments

@debelyoo
Copy link

Description:
I want to move a file after being processed.
It fails and shows the following exception:
org.apache.commons.vfs2.FileSystemException: Could not rename "file:///home/wso2carbon/wso2sp-4.3.0/wso2/editor/deployment/input/input1.json" to "file:///home/wso2carbon/wso2sp-4.3.0/wso2/editor/deployment/processed/input1.json".

I have the following source definition in my rule:
@source(
type='file',
file.uri='file:///home/wso2carbon/wso2sp-4.3.0/wso2/editor/deployment/input/input1.json',
tailing='false',
action.after.process='move',
move.after.process='file:///home/wso2carbon/wso2sp-4.3.0/wso2/editor/deployment/processed/input1.json',
@Map(type='json'))

Suggested Labels:
file,move

Affected Product Version:
1.0.14

Steps to reproduce:
Deploy a rule with the source definition shown above.

@debelyoo
Copy link
Author

Apparently the rename operation is not supported by the commons-vfs2 lib.

In AbstractFileObject.java

protected void doRename(final FileObject newFile) throws Exception {
        throw new FileSystemException("vfs.provider/rename-not-supported.error");
    }

The version of commons-vfs2 is org.apache.commons.wso2:commons-vfs2:2.0-wso2v15

@minudika
Copy link
Contributor

Hi @debelyoo ,

We tested your siddhi app on our end and the move after process operation works properly on our environment.
Could you please verify whether you have write access to your target location in the file system?

@mohanvive
Copy link
Contributor

@debelyoo do you have any feedback on the response made by Minudika?

@debelyoo
Copy link
Author

I have write access on the target folder, but I still get the exception.

@SinthujanSintha
Copy link

SinthujanSintha commented Oct 2, 2019

I have checked this source code it works properly without any exception or error .I think it will be better if you check your directly folder whether that input file exist in the correct path or not(' file.uri='file:///home/wso2carbon/wso2sp-4.3.0/wso2/editor/deployment/input/input1.json') and also check is there any existing same name file in move path a("move.after.process='file:///home/wso2carbon/wso2sp-4.3.0/wso2/editor/deployment/processed/input1.json', ") if it is please remove it.

@mohanvive
Copy link
Contributor

It seems like a common issue that faced with VFS file transport. We may need to dig this since we couldn't reproduce this locally.

wso2/product-ei#4261

@Tharunnath
Copy link

Hi,
I am also facing the same issue in (vfs2 2.2).
Is this Issue resolved ?

senthuran16 pushed a commit to senthuran16/siddhi-io-file that referenced this issue Nov 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants