threeplanetssoftware / apple_cloud_notes_parser

Parser for Apple Notes data stored on the Cloud as seen on Apple handsets
MIT License
412 stars 26 forks source link

Permission denied @ rb_file_s_rename #4

Closed jktujg closed 4 years ago

jktujg commented 4 years ago

Hello! I did everything according to the instructions for windows (10), and get this error:

PS D:\apple_cloud_notes_parser-master> rake

D:/Ruby26-x64/bin/ruby.exe notes_cloud_ripper.rb --file NoteStore.sqlite

Starting Apple Notes Parser at Sat Feb  1 18:47:55 2020
Storing the results in ./output/2020_02_01-18_47_55

Created a new AppleBackup from single file: NoteStore.sqlite
Traceback (most recent call last):
        8: from notes_cloud_ripper.rb:83:in `<main>'
        7: from notes_cloud_ripper.rb:83:in `new'
        6: from D:/apple_cloud_notes_parser-master/lib/AppleBackup.rb:86:in `initialize'
        5: from D:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/fileutils-1.4.1/lib/fileutils.rb:539:in `mv'
        4: from D:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/fileutils-1.4.1/lib/fileutils.rb:1586:in `fu_each_src_dest'
        3: from D:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/fileutils-1.4.1/lib/fileutils.rb:1604:in `fu_each_src_dest0'
        2: from D:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/fileutils-1.4.1/lib/fileutils.rb:1588:in `block in fu_each_src_dest'
        1: from D:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/fileutils-1.4.1/lib/fileutils.rb:548:in `block in mv'
D:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/fileutils-1.4.1/lib/fileutils.rb:548:in `rename': Permission denied @ rb_file_s_rename - (./output/2020_02_01-18_47_55/test.sqlite, ./output/2020_02_01-18_47_55/NoteStore.sqlite) (Errno::EACCES)
rake aborted!
Command failed with status (1): [D:/Ruby26-x64/bin/ruby.exe notes_cloud_rip...]
D:/apple_cloud_notes_parser-master/Rakefile:7:in `block in <top (required)>'
Tasks: TOP => default => run
(See full trace by running task with --trace)
threeplanetssoftware commented 4 years ago

Thank you for reporting this. Can you please include the version of Windows 10 and Ruby (ruby --version)? Also, could you please provide a recursive dirwalk of the output folder so I can see the permissions the files were created with?

jktujg commented 4 years ago

Windows 10 pro version 10.0.18362 build 18362 ruby 2.6.5p114 (2019-10-01 revision 67812) [x64-mingw32]

could you please provide a recursive dirwalk of the output folder so I can see the permissions the files were created with?

Sorry, but I do not quite understand what it is, and, accordingly, how to do it. Сan you please explain what is needed for this?

threeplanetssoftware commented 4 years ago

If you open up powershell and type:

cd D:\apple_cloud_notes_parser-master
dir -Recurse

I mainly want to make sure that the output folder and subfolders were correctly created. Thank you!

jktujg commented 4 years ago

I forgot to mention that when rake is executed, a dated folder is created in the output folder, with a single test.sqlite file that is identical to the original NoteStore.sqlite dir -Recurse

PS D:\apple_cloud_notes_parser-master> dir -Recurse

    Каталог: D:\apple_cloud_notes_parser-master

Mode                LastWriteTime         Length Name
----                -------------         ------ ----
d-----       01.02.2020     18:47                lib
d-----       01.02.2020     22:28                output
d-----       01.02.2020     18:47                proto
-a----       25.01.2020     16:33            468 .gitignore
-a----       25.01.2020     16:33            302 Gemfile
-a----       01.02.2020     16:56            369 Gemfile.lock
-a----       25.01.2020     16:33           1079 LICENSE
-a----       31.01.2020     18:16        3186688 NoteStore.sqlite
-a----       25.01.2020     16:33           4912 notes_cloud_ripper.rb
-a----       25.01.2020     16:33            448 Rakefile
-a----       25.01.2020     16:33          16140 README.md

    Каталог: D:\apple_cloud_notes_parser-master\lib

Mode                LastWriteTime         Length Name
----                -------------         ------ ----
-a----       25.01.2020     16:33           9929 AppleBackup.rb
-a----       25.01.2020     16:33          20037 AppleNote.rb
-a----       25.01.2020     16:33           3163 AppleNotesAccount.rb
-a----       25.01.2020     16:33           3112 AppleNotesEmbeddedDrawing.rb
-a----       25.01.2020     16:33           3794 AppleNotesEmbeddedGallery.rb
-a----       25.01.2020     16:33           4693 AppleNotesEmbeddedObject.rb
-a----       25.01.2020     16:33           3412 AppleNotesEmbeddedPDF.rb
-a----       25.01.2020     16:33           3914 AppleNotesEmbeddedPublicJpeg.rb
-a----       25.01.2020     16:33           1907 AppleNotesEmbeddedPublicURL.rb
-a----       25.01.2020     16:33           3458 AppleNotesEmbeddedPublicVCard.rb
-a----       25.01.2020     16:33          11875 AppleNotesEmbeddedTable.rb
-a----       25.01.2020     16:33           2700 AppleNotesEmbeddedThumbnail.rb
-a----       25.01.2020     16:33           1755 AppleNotesFolder.rb
-a----       25.01.2020     16:33          20950 AppleNoteStore.rb
-a----       25.01.2020     16:33           6618 notestore_pb.rb

    Каталог: D:\apple_cloud_notes_parser-master\output

Mode                LastWriteTime         Length Name
----                -------------         ------ ----
d-----       01.02.2020     18:47                2020_02_01-17_44_30
d-----       01.02.2020     18:47                2020_02_01-17_51_57
d-----       01.02.2020     18:47                2020_02_01-17_55_19
d-----       01.02.2020     18:47                2020_02_01-18_12_03
d-----       01.02.2020     18:47                2020_02_01-18_44_47
d-----       01.02.2020     18:47                2020_02_01-18_47_55
d-----       01.02.2020     18:54                2020_02_01-18_54_05
d-----       01.02.2020     19:17                2020_02_01-19_17_35
d-----       01.02.2020     22:28                2020_02_01-22_28_45
d-----       01.02.2020     22:28                2020_02_01-22_28_59

    Каталог: D:\apple_cloud_notes_parser-master\output\2020_02_01-17_44_30

Mode                LastWriteTime         Length Name
----                -------------         ------ ----
-a----       01.02.2020     17:44        3186688 test.sqlite

    Каталог: D:\apple_cloud_notes_parser-master\output\2020_02_01-17_51_57

Mode                LastWriteTime         Length Name
----                -------------         ------ ----
-a----       01.02.2020     17:51        3186688 test.sqlite

    Каталог: D:\apple_cloud_notes_parser-master\output\2020_02_01-17_55_19

Mode                LastWriteTime         Length Name
----                -------------         ------ ----
-a----       01.02.2020     17:55        3186688 test.sqlite

    Каталог: D:\apple_cloud_notes_parser-master\output\2020_02_01-18_12_03

Mode                LastWriteTime         Length Name
----                -------------         ------ ----
-a----       01.02.2020     18:12        3186688 test.sqlite

    Каталог: D:\apple_cloud_notes_parser-master\output\2020_02_01-18_44_47

Mode                LastWriteTime         Length Name
----                -------------         ------ ----
-a----       01.02.2020     18:44        3186688 test.sqlite

    Каталог: D:\apple_cloud_notes_parser-master\output\2020_02_01-18_47_55

Mode                LastWriteTime         Length Name
----                -------------         ------ ----
-a----       01.02.2020     18:47        3186688 test.sqlite

    Каталог: D:\apple_cloud_notes_parser-master\output\2020_02_01-18_54_05

Mode                LastWriteTime         Length Name
----                -------------         ------ ----
-a----       01.02.2020     18:54        3186688 test.sqlite

    Каталог: D:\apple_cloud_notes_parser-master\output\2020_02_01-19_17_35

Mode                LastWriteTime         Length Name
----                -------------         ------ ----
-a----       01.02.2020     19:17        3186688 test.sqlite

    Каталог: D:\apple_cloud_notes_parser-master\output\2020_02_01-22_28_45

Mode                LastWriteTime         Length Name
----                -------------         ------ ----
-a----       01.02.2020     22:28        3186688 test.sqlite

    Каталог: D:\apple_cloud_notes_parser-master\output\2020_02_01-22_28_59

Mode                LastWriteTime         Length Name
----                -------------         ------ ----
-a----       01.02.2020     22:28        3186688 test.sqlite

    Каталог: D:\apple_cloud_notes_parser-master\proto

Mode                LastWriteTime         Length Name
----                -------------         ------ ----
-a----       25.01.2020     16:33           5128 notestore.proto
-a----       25.01.2020     16:33           4566 protobuf_config.py
threeplanetssoftware commented 4 years ago

Thanks for sharing this. The problem was Windows saw the file as "open" and wouldn't rename it. I added a line to expressly close the database and it appears to work well now on Windows 10 Enterprise. Please try it out and let me know if it solves your problems.

Commit was 9e31faa8a7982e9ebd1ce389b07406ef1f4f8079

SamarthMayya commented 3 years ago

So what am I supposed to do to fix this error?

SamarthMayya commented 3 years ago

I have encountered the same error

threeplanetssoftware commented 3 years ago

@SamarthMayya Can you provide more information?

Without those answers, my general answer would be to grab the latest version of the program as this hasn't come up for a while. Thanks,

SamarthMayya commented 3 years ago

I'm using Rails 6.0.3.4, the latest version I believe. My Ruby version is 2.7.0. I'm using Windows 10.

SamarthMayya commented 3 years ago

Where would I find the debug_log file in my application?

threeplanetssoftware commented 3 years ago

Hmm, the versions should be OK, I think. When you run the program, if you change no options it creates an output folder in the same folder as the program. Inside output are timestamped folders for each run. Here is an example of what was created the last time I broke a run on my file system:

[notta@cuppa 2020_11_15-17_06_58]$ pwd
/home/notta/apple_cloud_notes_parser/output/2020_11_15-17_06_58
[notta@cuppa 2020_11_15-17_06_58]$ ls
debug_log.txt  NoteStore.sqlite

debug_log.txt gets created pretty early in the run, so my hope is it will let us know what happened immediately prior to the crash. But please be careful, if you are decrypting notes (this would be an intentional decision using -w) it will alert you to the password in the log.

jrodbet commented 3 years ago

Hi guys,

I get the same error when I try to migrate the db with rake or rails:

image

... here in between more logs

image

What could be the problem? I tried to change the environment but it does not works.

jrodbet commented 3 years ago

P.S. The folder has "full access" permissions

threeplanetssoftware commented 3 years ago

Please forgive what may be seen as an ignorant question, are you trying to run Apple Cloud Notes Parser? If so, can you please provide the debug log file to see where exactly it dies? If not, you would be best served opening an issue on whatever that project is since all I can tell you is for some reason Ruby doesn't have permissions to rename that temp load-path-cache to your new name. You might try doing it by hand and seeing what happens, checking if the destination file is already locked, or similar issues.

I hope this helps,

tarikbouari commented 1 year ago

If your database is running you should close it. I had the same error once, that's how I fixed it

tejaser commented 1 year ago

I ran the command line as admin user and tried it again and it resolved the issue.

dinhhop172 commented 1 year ago

If your database is running you should close it. I had the same error once, that's how I fixed it

good job, bro

JackSoh66 commented 3 months ago

I have this issue while serving my application, if you are using rails server to serve your application can run your terminal or VS code as administrator, hope this help