spacedrive
spacedrive copied to clipboard
Fail to start if watch directory contains non-permitted directory
Describe the bug
After adding a watch(location) directory, it contains a non-permitted (e.g. root 100) directory, restart the Spacedrive, it gets stuck
Reproduction
> su user
> mkdir foo
> cd foo
> mkdir bar
> sudo chown root bar
> sudo chmod 700 bar
> sudo su
> touch bar/alice
> touch bar/bob
- start spacedrive
- add location /home/user/foo
- restart the spacedrive
Expected behavior
Ignore the non-permitted directory and let the program run
Platform and versions
I'm using a released appimage version / v0.1.4 2f01b21
8.14.1
cargo 1.73.0 (9c4383fb5 2023-08-26)
rustc 1.73.0 (cc66ad468 2023-10-03)
Stack trace
❯ ./Spacedrive-linux-x86_64.AppImage
2024-01-21T13:56:41.606505Z INFO sd_core: core/src/lib.rs:88: Starting core with data directory '/home/kdh8219/.local/share/spacedrive'
2024-01-21T13:56:41.616213Z WARN sd_core::util::version_manager: core/src/util/version_manager.rs:159: Config file for sd_core::node::config::NodeConfig does not exist, trying to create a new one with version -> V2
2024-01-21T13:56:41.664466Z INFO sd_core::p2p::p2p_manager: core/src/p2p/p2p_manager.rs:50: Node RemoteIdentity('t9xFqCwi9rBM0ZhQNlwb2TnGJSFwq5UnfZ8ngIBqJa8') libp2p::PeerId('12D3KooWNC5b1oAp3GYTv5YvTYN44j51Q3Yw6nYNTVycDfGd1HnW') is now online listening at addresses: {}
2024-01-21T13:56:41.778324Z INFO sd_core: core/src/lib.rs:145: Spacedrive online.
2024-01-21T13:56:41.791837Z INFO sd_desktop::tauri_plugins: apps/desktop/src-tauri/src/tauri_plugins.rs:62: Internal server listening on: http://127.0.0.1:39821
2024-01-21T13:56:52.685171Z WARN sd_core::util::version_manager: core/src/util/version_manager.rs:159: Config file for sd_core::object::media::thumbnail::directory::ThumbnailVersion does not exist, trying to create a new one with version -> V3
** (spacedrive:406581): WARNING **: 22:57:07.072: atk-bridge: get_device_events_reply: unknown signature
2024-01-21T13:57:23.252310Z ERROR sd_core::location::manager::watcher: core/src/location/manager/watcher/mod.rs:237: Unable to watch location: (path: /home/kdh8219/foo, error: Error {
kind: Io(
Os {
code: 13,
kind: PermissionDenied,
message: "허가 거부",
},
),
paths: [
"/home/kdh8219/foo/bar",
],
})
2024-01-21T13:57:23.252610Z INFO sd_core::location: core/src/location/mod.rs:181: Created location: Data { id: 1, pub_id: [80, 216, 123, 210, 218, 55, 79, 197, 147, 177, 184, 155, 161, 244, 175, 73], name: Some("foo"), path: Some("/home/kdh8219/foo"), total_capacity: None, available_capacity: None, size_in_bytes: None, is_archived: None, generate_preview_media: None, sync_preview_media: None, hidden: None, date_created: Some(2024-01-21T13:57:23.229+00:00), instance_id: Some(0), indexer_rules: [Data { indexer_rule: Data { id: 1, pub_id: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], name: Some("No OS protected"), default: Some(true), rules_per_kind: Some([145, 129, 177, 82, 101, 106, 101, 99, 116, 70, 105, 108, 101, 115, 66, 121, 71, 108, 111, 98, 153, 174, 42, 42, 47, 46, 115, 112, 97, 99, 101, 100, 114, 105, 118, 101, 165, 42, 42, 47, 42, 126, 176, 42, 42, 47, 46, 102, 117, 115, 101, 95, 104, 105, 100, 100, 101, 110, 42, 173, 42, 42, 47, 46, 100, 105, 114, 101, 99, 116, 111, 114, 121, 171, 42, 42, 47, 46, 84, 114, 97, 115, 104, 45, 42, 168, 42, 42, 47, 46, 110, 102, 115, 42, 175, 47, 123, 100, 101, 118, 44, 115, 121, 115, 44, 112, 114, 111, 99, 125, 175, 47, 123, 114, 117, 110, 44, 118, 97, 114, 44, 98, 111, 111, 116, 125, 173, 42, 42, 47, 108, 111, 115, 116, 43, 102, 111, 117, 110, 100]), date_created: Some(2024-01-21T13:56:52.399+00:00), date_modified: Some(2024-01-21T13:56:52.399+00:00), locations: None } }] }
2024-01-21T13:57:23.252996Z INFO sd_core::job::manager: core/src/job/manager.rs:140: Running job: "indexer"
2024-01-21T13:57:23.268341Z INFO sd_core::job: core/src/job/mod.rs:471: Starting Job <id='4c311d73-827a-4986-b3b5-3507a08fe1fa', name='indexer'>
2024-01-21T13:57:23.283299Z INFO sd_core::location::indexer::indexer_job: core/src/location/indexer/indexer_job.rs:485: Scan of /home/kdh8219/foo completed in 2.162833ms. 1 new files found, indexed 1 files in db, updated 0 entries. db write completed in 5.43129ms
2024-01-21T13:57:23.292197Z WARN sd_core::job::worker: core/src/job/worker.rs:545: Job<id='4c311d73-827a-4986-b3b5-3507a08fe1fa', name='indexer'> completed with errors
2024-01-21T13:57:23.296471Z INFO sd_core::job::manager: core/src/job/manager.rs:140: Running job: "file_identifier"
2024-01-21T13:57:23.300295Z INFO sd_core::job: core/src/job/mod.rs:471: Starting Job <id='ae474396-793a-4c8b-b123-c716a12109bf', name='file_identifier'>
2024-01-21T13:57:23.300840Z INFO sd_core::job: core/src/job/mod.rs:545: job had a early finish: <name='file_identifier', reason='Found no orphan file paths to process'>
2024-01-21T13:57:23.300852Z INFO sd_core::object::file_identifier::file_identifier_job: core/src/object/file_identifier/file_identifier_job.rs:244: Finalizing identifier job: FileIdentifierJobRunMetadata { cursor: 0, total_orphan_paths: 0, total_objects_created: 0, total_objects_linked: 0, total_objects_ignored: 0 }
2024-01-21T13:57:23.304588Z INFO sd_core::job::manager: core/src/job/manager.rs:140: Running job: "media_processor"
2024-01-21T13:57:23.308715Z INFO sd_core::job: core/src/job/mod.rs:471: Starting Job <id='634f836f-5336-41d6-a6e8-993682c73b7f', name='media_processor'>
2024-01-21T13:57:23.310176Z INFO sd_core::object::media::media_processor::job: core/src/object/media/media_processor/job.rs:274: Finished media processing for location 1 at /home/kdh8219/foo
2024-01-21T13:57:40.922029Z ERROR sd_core::location::indexer::shallow: core/src/location/indexer/shallow.rs:103: error accessing path: '/home/kdh8219/foo/bar'
❯ ./Spacedrive-linux-x86_64.AppImage
2024-01-21T13:58:31.673560Z INFO sd_core: core/src/lib.rs:88: Starting core with data directory '/home/kdh8219/.local/share/spacedrive'
2024-01-21T13:58:31.750196Z INFO sd_core::p2p::p2p_manager: core/src/p2p/p2p_manager.rs:50: Node RemoteIdentity('t9xFqCwi9rBM0ZhQNlwb2TnGJSFwq5UnfZ8ngIBqJa8') libp2p::PeerId('12D3KooWNC5b1oAp3GYTv5YvTYN44j51Q3Yw6nYNTVycDfGd1HnW') is now online listening at addresses: {}
2024-01-21T13:58:31.775119Z INFO sd_core::object::media::thumbnail::state: core/src/object/media/thumbnail/state.rs:62: Resuming thumbnailer actor state: Existing ephemeral thumbs: 0; Queued batches waiting processing: 0
2024-01-21T13:58:32.016093Z ERROR sd_core::location::manager::watcher: core/src/location/manager/watcher/mod.rs:237: Unable to watch location: (path: /home/kdh8219/foo, error: Error {
kind: Io(
Os {
code: 13,
kind: PermissionDenied,
message: "Permission denied",
},
),
paths: [
"/home/kdh8219/foo/bar",
],
})
2024-01-21T13:58:32.049278Z ERROR sd_core::location::manager::watcher: core/src/location/manager/watcher/mod.rs:237: Unable to watch location: (path: /home/kdh8219/foo, error: Error {
kind: Io(
Os {
code: 13,
kind: PermissionDenied,
message: "Permission denied",
},
),
paths: [
"/home/kdh8219/foo/bar",
],
})
2024-01-21T13:58:32.082227Z INFO sd_core: core/src/lib.rs:145: Spacedrive online.
2024-01-21T13:58:32.136694Z INFO sd_desktop::tauri_plugins: apps/desktop/src-tauri/src/tauri_plugins.rs:62: Internal server listening on: http://127.0.0.1:43497
*** bit out of range 0 - FD_SETSIZE on fd_set ***: terminated
zsh: IOT instruction (core dumped) ./Spacedrive-linux-x86_64.AppImage
Additional context
No response