erikng / Cacher

A python script for extracting macOS Caching Server data
Apache License 2.0
134 stars 40 forks source link

Error with regex #34

Closed calum-github closed 7 years ago

calum-github commented 7 years ago

I get an error with the script:

Traceback (most recent call last):
  File "./test.py", line 940, in <module>
    main()
  File "./test.py", line 923, in main
    cacherdata = cacher(rawLog.readlines(), targetDate, friendlyNames, site_name)
  File "./test.py", line 324, in cacher
    x).group(1).replace('OS X ', 'macOS/').split('/')[0]
AttributeError: 'NoneType' object has no attribute 'group'

Attached is the debug log that causes this error (the target date is 2017-02-18

Debug.zip

Running the script on a different target date of 2017-02-28 works fine however. Attached is the debug log for that target date as well. Debug_28-02.log.zip

erikng commented 7 years ago

If this is on an old caching server, I have no intention of fixing it.


From: Calum notifications@github.com Sent: Wednesday, March 1, 2017 6:43:39 PM To: erikng/Cacher Cc: Subscribed Subject: [erikng/Cacher] Error with regex (#34)

I get an error with the script:

Traceback (most recent call last): File "./test.py", line 940, in main() File "./test.py", line 923, in main cacherdata = cacher(rawLog.readlines(), targetDate, friendlyNames, site_name) File "./test.py", line 324, in cacher x).group(1).replace('OS X ', 'macOS/').split('/')[0] AttributeError: 'NoneType' object has no attribute 'group'

Attached is the debug log that causes this error (the target date is 2017-02-18

Debug.ziphttps://github.com/erikng/Cacher/files/812618/Debug.zip

Running the script on a different target date of 2017-02-28 works fine however. Attached is the debug log for that target date as well. Debug_28-02.log.ziphttps://github.com/erikng/Cacher/files/812620/Debug_28-02.log.zip

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/erikng/Cacher/issues/34, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AFa_GDrTzREC2KUaFNaqpAMmeAUaTpTJks5rhizbgaJpZM4MQeow.

calum-github commented 7 years ago

Turns out it trips up on this

2017-02-18 09:58:06.322 #d92df43NRCrA Received GET request from 10.190.17.150:56062 [Configurator/2.0] for /iOS9.3.5/031-74004-20160825-995D69FE-6715-11E6-A974-933E34D2D062/iPad2,5_9.3.5_13G36_Restore.ipsw
2017-02-18 09:58:06.323 #d92df43NRCrA ECAssetHandler[0x7fe6d8415470]: Asset /iOS9.3.5/031-74004-20160825-995D69FE-6715-11E6-A974-933E34D2D062/iPad2,5_9.3.5_13G36_Restore.ipsw, path /Library/Server/Caching/Data/60A9474E-71B1-4401-9F63-9178B6F6C584, extents none
2017-02-18 09:58:06.323 #d92df43NRCrA ECAssetRequestor[0x7fe6d87ee370]: Issuing outgoing full request for URL http://appldnld.apple.com/iOS9.3.5/031-74004-20160825-995D69FE-6715-11E6-A974-933E34D2D062/iPad2,5_9.3.5_13G36_Restore.ipsw
2017-02-18 09:58:06.348 #d92df43NRCrA ECCacheManager: space requested 1.54 GB, current cache size 976.0 MB (limit unlimited) for asset /iOS9.3.5/031-74004-20160825-995D69FE-6715-11E6-A974-933E34D2D062/iPad2,5_9.3.5_13G36_Restore.ipsw
2017-02-18 09:58:06.348 #d92df43NRCrA ECResponse[0x7fe6d8528710]: Info loaded: response code = 200, file length = 1536525186, reader = 0x7fe6d841be30
2017-02-18 09:58:06.348 #d92df43NRCrA ECAssetHandler[0x7fe6d8415470]: Opened extent [0,0r-] for writing at offset 0 (offset into file = 0)
2017-02-18 09:58:06.348 #d92df43NRCrA ECAssetHandler[0x7fe6d8415470]: Opened extent [0,0r-] for reading at offset 0 (offset into file = 0)
erikng commented 7 years ago

Figured it would be configurator. That was the one value no one could give me so I guessed. Try and figure it out. I won't have time to fix it for a bit.


From: Calum notifications@github.com Sent: Wednesday, March 1, 2017 6:59:51 PM To: erikng/Cacher Cc: Erik Gomez; Comment Subject: Re: [erikng/Cacher] Error with regex (#34)

Turns out it trips up on this

2017-02-18 09:58:06.322 #d92df43NRCrA Received GET request from 10.190.17.150:56062 [Configurator/2.0] for /iOS9.3.5/031-74004-20160825-995D69FE-6715-11E6-A974-933E34D2D062/iPad2,5_9.3.5_13G36_Restore.ipsw 2017-02-18 09:58:06.323 #d92df43NRCrA ECAssetHandler[0x7fe6d8415470]: Asset /iOS9.3.5/031-74004-20160825-995D69FE-6715-11E6-A974-933E34D2D062/iPad2,5_9.3.5_13G36_Restore.ipsw, path /Library/Server/Caching/Data/60A9474E-71B1-4401-9F63-9178B6F6C584, extents none 2017-02-18 09:58:06.323 #d92df43NRCrA ECAssetRequestor[0x7fe6d87ee370]: Issuing outgoing full request for URL http://appldnld.apple.com/iOS9.3.5/031-74004-20160825-995D69FE-6715-11E6-A974-933E34D2D062/iPad2,5_9.3.5_13G36_Restore.ipsw 2017-02-18 09:58:06.348 #d92df43NRCrA ECCacheManager: space requested 1.54 GB, current cache size 976.0 MB (limit unlimited) for asset /iOS9.3.5/031-74004-20160825-995D69FE-6715-11E6-A974-933E34D2D062/iPad2,5_9.3.5_13G36_Restore.ipsw 2017-02-18 09:58:06.348 #d92df43NRCrA ECResponse[0x7fe6d8528710]: Info loaded: response code = 200, file length = 1536525186, reader = 0x7fe6d841be30 2017-02-18 09:58:06.348 #d92df43NRCrA ECAssetHandler[0x7fe6d8415470]: Opened extent [0,0r-] for writing at offset 0 (offset into file = 0) 2017-02-18 09:58:06.348 #d92df43NRCrA ECAssetHandler[0x7fe6d8415470]: Opened extent [0,0r-] for reading at offset 0 (offset into file = 0)

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/erikng/Cacher/issues/34#issuecomment-283541873, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AFa_GLhYraKiSPl7WHVT7zQlqMbFUFMNks5rhjCngaJpZM4MQeow.

calum-github commented 7 years ago

Cool no probs i'll try to fix and send a PR :)

erikng commented 7 years ago

Fixed as of https://github.com/erikng/Cacher/commit/812c51f698dfe318fd4dafbdc28c2d5af8199734