You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@opendal.apache.org by "vdudouyt (via GitHub)" <gi...@apache.org> on 2024/12/02 09:12:51 UTC

[I] bug: MKD in unftp_sbe_opendal is broken due '/' requirement in path end [opendal]

vdudouyt opened a new issue, #5380:
URL: https://github.com/apache/opendal/issues/5380

   ### Describe the bug
   
   I'm trying to run a simple hello world program with unftp_sbe_opendal and OpenDAL v0.52.0. Somehow I end up with MKD command not working due a convention to add "/" in the end of directory path, which unftp_sbe_opendal is apparently breaking.
   
   ```rust
   #[tokio::main]
   async fn main() -> Result<()> {
       let builder = opendal::services::Memory::default()
           .root("/");
       let op = Operator::new(builder)?.finish();
       let backend = OpendalStorage::new(op);
       let server = libunftp::ServerBuilder::new(Box::new(move || backend.clone()))
           .greeting("Welcome to my FTP server")
           .active_passive_mode(ActivePassiveMode::PassiveOnly)
           .passive_ports(50000..65535)
           .build().unwrap();
   
       let _ = server.listen("0.0.0.0:21").await;
       Ok(())
   }
   ```
   
   In my Filezilla log I have:
   ```
   Status:	Creating directory '/Test'...
   Command:	MKD Test
   Response:	451 Local error
   ```
   In my env_logger I have:
   ```
   MKD: Failure creating directory "/Test" storage error: 451 Local error, source: myip:2311, trace-id: 0xd9067fe760e85899
   Control channel event InternalMsg(StorageError(Error { kind: LocalError, source: Some(NotADirectory (permanent) at create_dir => the path trying to create should end with `/`
   ```
   
   ### Steps to Reproduce
   
   1) Run any application using unftp_sbe_opendal and OpenDAL v0.52.0. You can use main.rs from example above
   2) Connect with FTP client (personally, I'm using Filezilla)
   3) Try to create a directory
   
   ### Expected Behavior
   
   I expect the directory to be created
   
   ### Additional Context
   
   _No response_
   
   ### Are you willing to submit a PR to fix this bug?
   
   - [ ] Yes, I would like to submit a PR.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] bug: MKD in unftp_sbe_opendal is broken due '/' requirement in path end [opendal]

Posted by "Xuanwo (via GitHub)" <gi...@apache.org>.
Xuanwo closed issue #5380: bug: MKD in unftp_sbe_opendal is broken due '/' requirement in path end
URL: https://github.com/apache/opendal/issues/5380


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] bug: MKD in unftp_sbe_opendal is broken due '/' requirement in path end [opendal]

Posted by "Xuanwo (via GitHub)" <gi...@apache.org>.
Xuanwo commented on issue #5380:
URL: https://github.com/apache/opendal/issues/5380#issuecomment-2512364522

   Thank you, @vdudouyt, for the report.
   
   This should be straightforward to fix: we just need to ensure the path passed to `create_dir` ends with a `/`:
   
   https://github.com/apache/opendal/blob/5834e2817861c288f659abd89f71ee4350667523/integrations/unftp-sbe/src/lib.rs#L226
   
   I have flagged this as a good first issue.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] bug: MKD in unftp_sbe_opendal is broken due '/' requirement in path end [opendal]

Posted by "Xuanwo (via GitHub)" <gi...@apache.org>.
Xuanwo commented on issue #5380:
URL: https://github.com/apache/opendal/issues/5380#issuecomment-2513139994

   > I would like to work on this one, do we want to check if the path ends with a `/` or do we want to add it when there is not a `/` at the end
   
   Just adding a `/` should be ok.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] bug: MKD in unftp_sbe_opendal is broken due '/' requirement in path end [opendal]

Posted by "Frank-III (via GitHub)" <gi...@apache.org>.
Frank-III commented on issue #5380:
URL: https://github.com/apache/opendal/issues/5380#issuecomment-2513054934

   I would like to work on this one, do we want to check if the path ends with a `/` or do we want to add it when there is not a `/` at the end


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org