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

macOS : Crashes on startup - Bad date parsing 12 hours format #331

Closed
ghost opened this issue Jun 22, 2021 · 35 comments
Closed

macOS : Crashes on startup - Bad date parsing 12 hours format #331

ghost opened this issue Jun 22, 2021 · 35 comments
Assignees
Labels
🐛 bug Something isn't working
Projects
Milestone

Comments

@ghost
Copy link

ghost commented Jun 22, 2021

Just installed the latest version on my new MacBook Air with all the latest updates. Crashes after 3 seconds and disappears

@isontheline isontheline self-assigned this Jun 22, 2021
@isontheline isontheline added the 🐛 bug Something isn't working label Jun 22, 2021
@isontheline isontheline added this to To do in General via automation Jun 22, 2021
@isontheline isontheline added this to the 14.20 - Cactus milestone Jun 22, 2021
@isontheline
Copy link
Owner

Hello @JansonBHong 👋

Is it a first install of the app? Or an upgrade?

@ghost
Copy link
Author

ghost commented Jun 22, 2021

Hi - many thanks for a quick reply. I have had WebSSH on my iPad and iPhone for a while. I got my new MacBook Air yesterday and was happy to realise today that it will run on a MacBook Air with the M1 processor. After installation, when run it appears momentarily then crashes.

@ghost
Copy link
Author

ghost commented Jun 22, 2021

There is a crash report if that would be of help

@isontheline
Copy link
Owner

isontheline commented Jun 22, 2021

Could you email me your crash report please?
team AT webssh DOT net

Thank you a lot and sorry for the trouble

@ghost
Copy link
Author

ghost commented Jun 22, 2021

Sent as requested

@isontheline
Copy link
Owner

Thank you a lot @JansonBHong 👍

I will now fix this issue related to you crash report :

Application Specific Backtrace 1:
0   CoreFoundation                      0x0000000180894c78 __exceptionPreprocess + 240
1   libobjc.A.dylib                     0x00000001805bd0a8 objc_exception_throw + 60
2   CoreFoundation                      0x0000000180925abc -[NSObject(NSObject) __retain_OA] + 0
3   CoreFoundation                      0x00000001807f6114 ___forwarding___ + 1444
4   CoreFoundation                      0x00000001807f5ab0 _CF_forwarding_prep_0 + 96
5   CoreFoundation                      0x00000001807aaf08 CFStringCompareWithOptionsAndLocale + 296
6   WebSSH                              0x00000001003cc368 -[DAO listObjectsOfType:andKey:isEqualTo:] + 1068
7   WebSSH                              0x00000001003e7e9c +[SimpleSetting boSettingForKey:] + 96
8   WebSSH                              0x00000001003e7cec +[SimpleSetting settingForKey:andDefaultValue:] + 80
9   WebSSH                              0x00000001003e8170 +[SimpleSetting boolForKey:andDefaultValue:] + 60
10  WebSSH                              0x00000001003b6c14 -[BOCloudSync _fetchFromCloud] + 132
11  WebSSH                              0x000000010031d52c __17-[GCDTimer start]_block_invoke + 100
12  libdispatch.dylib                   0x0000000180567ec0 _dispatch_client_callout + 20
13  libdispatch.dylib                   0x000000018056b398 _dispatch_continuation_pop + 448
14  libdispatch.dylib                   0x000000018057db7c _dispatch_source_invoke + 1284
15  libdispatch.dylib                   0x0000000180579684 _dispatch_root_queue_drain + 388
16  libdispatch.dylib                   0x0000000180579e90 _dispatch_worker_thread2 + 112
17  libsystem_pthread.dylib             0x0000000180713860 _pthread_wqthread + 216
18  libsystem_pthread.dylib             0x00000001807125d4 start_wqthread + 8

@isontheline
Copy link
Owner

I think I'm able to reproduce the bug on my side :

	0   CoreFoundation                      0x00007fff20421af6 __exceptionPreprocess + 242
	1   libobjc.A.dylib                     0x00007fff20177e78 objc_exception_throw + 48
	2   CoreFoundation                      0x00007fff204306f7 +[NSObject(NSObject) instanceMethodSignatureForSelector:] + 0
	3   CoreFoundation                      0x00007fff20426036 ___forwarding___ + 1489
	4   CoreFoundation                      0x00007fff20428068 _CF_forwarding_prep_0 + 120
	5   CoreFoundation                      0x00007fff203be944 CFStringCompareWithOptionsAndLocale + 340
	6   Foundation                          0x00007fff20845976 -[NSString compare:options:range:] + 34
	7   WebSSH                              0x0000000109807d2f -[DAO listObjectsOfType:andKey:isEqualTo:] + 2159
	8   WebSSH                              0x00000001098370bf +[SimpleSetting boSettingForKey:] + 111
	9   WebSSH                              0x0000000109836e2e +[SimpleSetting settingForKey:andDefaultValue:] + 94
	10  WebSSH                              0x00000001098374a2 +[SimpleSetting boolForKey:andDefaultValue:] + 98

It seems to be a bad value in the database.

@isontheline
Copy link
Owner

@JansonBHong Do you remember the year of your installation of WebSSH on your iPhone / iPad ?

@ghost
Copy link
Author

ghost commented Jun 23, 2021

I originally installed some years ago but then deleted as I had no need - I reinstalled yesterday as I now have several Raspberry Pi I need to SSH into.

@isontheline
Copy link
Owner

Thanks for your feedback. I'm fixing the issue.

@isontheline
Copy link
Owner

Hello @JansonBHong 👋

Could you run and post here the result of this one line command inside your terminal on your macOS?

WEBSSH_DB_LOCATION=$(find ~/Library/Containers -name "webssh.db" 2>&1 | grep -v "Operation not permitted"); echo $WEBSSH_DB_LOCATION; sqlite3 $WEBSSH_DB_LOCATION "SELECT * FROM main.NSFValues WHERE NSFAttribute='objectDeletion';"

Thank you

@ghost
Copy link
Author

ghost commented Jun 23, 2021

/Users/MYNAME/Library/Containers/81ADD741-4765-460E-9C77-D1EB16DB24F9/Data/Library/Application Support/webssh.db
10|CA4A06E5-D6CD-42AC-84DA-9CB586057289|objectDeletion|2021-06-22T2:23:08 pmZ|TEXT
44|B9A25BDE-71A3-4117-A6FA-BB73A89D4D5A|objectDeletion|2021-06-22T2:24:48 pmZ|TEXT

@isontheline
Copy link
Owner

@JansonBHong Thank you a lot.

Now please run :

WEBSSH_DB_LOCATION=$(find ~/Library/Containers -name "webssh.db" 2>&1 | grep -v "Operation not permitted"); echo $WEBSSH_DB_LOCATION; sqlite3 $WEBSSH_DB_LOCATION "DELETE FROM main.NSFValues WHERE NSFAttribute='objectDeletion';"

You should then be able to launch WebSSH I think.

I'm fixing the issue in code but this last command should help before.

@ghost
Copy link
Author

ghost commented Jun 23, 2021

Very sorry - despite running the above it still crashes

@isontheline
Copy link
Owner

:/

When you run the first command again what's the output?

@ghost
Copy link
Author

ghost commented Jun 23, 2021

/Users/MYNAME/Library/Containers/81ADD741-4765-460E-9C77-D1EB16DB24F9/Data/Library/Application Support/webssh.db

@isontheline
Copy link
Owner

I think there is a second crash point.

Could you send me by email a new crash report?

Sorry for the trouble.

@ghost
Copy link
Author

ghost commented Jun 23, 2021

Sent

@isontheline
Copy link
Owner

Don't have received it yet

@ghost
Copy link
Author

ghost commented Jun 23, 2021

Sorry - might have sent to the wrong email address - sent again to team AT webssh DOT net

@isontheline
Copy link
Owner

Does WebSSH have been started at least once with success on your macOS?

If not you could try to remove the database of WebSSH :

rm ~/Library/Containers/81ADD741-4765-460E-9C77-D1EB16DB24F9/Data/Library/Application Support/webssh.db

If the crash occurs after enabling iCloud on WebSSH on your macOS please let me know.

@ghost
Copy link
Author

ghost commented Jun 23, 2021

The result of entering the above is "No such file or directory"

WebSHH has never run on the MacBook Air successfully - it crashed from fist run after install

@isontheline
Copy link
Owner

isontheline commented Jun 23, 2021

Excuse me you need to run it with double quotes :

rm "~/Library/Containers/81ADD741-4765-460E-9C77-D1EB16DB24F9/Data/Library/Application Support/webssh.db"

Could you tell me in which country are you running WebSSH?
I ask this because the crash seems to occurs with a date format that I wrongly parse and need to reproduce on my side the same settings.

@ghost
Copy link
Author

ghost commented Jun 23, 2021

Even with double quotes there is no such file - manually looking in terminal confirms it does not exist. I am in the UK

@isontheline
Copy link
Owner

Thanks for the country!

Even this command doesn't work?

rm /Users/MYNAME/Library/Containers/81ADD741-4765-460E-9C77-D1EB16DB24F9/Data/Library/Application Support/webssh.db

I'm using the full path displayed on your previous replies, and I'm trying to remove the WebSSH database for a try.

@ghost
Copy link
Author

ghost commented Jun 23, 2021

No sorry - no such file (I obviously changed MYNAME to my user name)

@isontheline
Copy link
Owner

This one will tell where the database is stored :

find ~/Library/Containers -name "webssh.db" 2>&1 | grep -v "Operation not permitted"

@ghost
Copy link
Author

ghost commented Jun 23, 2021

The result of above was /Users/MYNAME/Library/Containers/81ADD741-4765-460E-9C77-D1EB16DB24F9/Data/Library/Application Support/webssh.db

And I have now deleted the database. Success! WebSSH now starts! I will try enabling iCloud and report back in a moment

@ghost
Copy link
Author

ghost commented Jun 23, 2021

Worked until I enabled iCloud then crashed again when enabled.
Deleting the database again and it loads and runs fine with iCloud disabled

@isontheline
Copy link
Owner

OK so we have a confirmation that some date are not parsed with success inside WebSSH database.

A fix will be sent asap to Apple but I can't say it will works as we can't beta test on macOS until the end of year :(

At this time of writing I could only recommend you to remove the database and don't enable iCloud yet.
I understand that it could not be a good option for you but it's the only solution I have found to help you asap in order to try WebSSH on your macOS.

@ghost
Copy link
Author

ghost commented Jun 23, 2021

Ok - many thanks for your amazing support. I will use WebSHH with iCloud disabled for the moment and look forward to the fix at some stage in the futures. Again many many thanks

@isontheline
Copy link
Owner

@JansonBHong Thank you too for all your feedback!

@ghost
Copy link
Author

ghost commented Jun 24, 2021

UPDATE - I have it working with iCloud enabled. I had my MacBook Air time setup for a 24 hour clock. When I changed it to a 12 hour clock I found I could enable iCloud!!! My iPhone and iPad are set up to display a 12 hour clock.

@isontheline
Copy link
Owner

isontheline commented Jun 24, 2021

@JansonBHong OK so it explains the date parsing problem 😅
I will rename this issue so.

Thank you a lot for your feedback 🙏

@isontheline isontheline changed the title Crashes on startup macOS : Crashes on startup - Bad date parsing 12 hours format Jun 24, 2021
@isontheline
Copy link
Owner

Released on WebSSH Beta 14.20

General automation moved this from To do to Done Jun 29, 2021
@isontheline isontheline modified the milestones: 14.20 - Cactus, 15.0 Jul 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working
Projects
No open projects
Development

No branches or pull requests

1 participant