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

Usernotes write error #123

Closed
CryptoMaximalist opened this issue Oct 25, 2022 · 8 comments
Closed

Usernotes write error #123

CryptoMaximalist opened this issue Oct 25, 2022 · 8 comments
Assignees

Comments

@CryptoMaximalist
Copy link

CryptoMaximalist commented Oct 25, 2022

I'm trying out usernotes instead of modnotes to possibly reduce API hits, and running a very barebones config: https://pastebin.com/GbggRW4m

I'm using the sample code to add a usernote from here: https://github.com/FoxxMD/context-mod/blob/master/docs/subreddit/components/userNotes/usernoteSP.yaml

Below is the logs error:

12:25:11 CDT debug  : [App] API Usage Rolling Avg: 0.07/s | Est Depletion: 2 hours (8,190 seconds)
12:25:08 CDT debug  : [Delayed Activities] No Activities ready to queue
12:25:03 CDT debug  : [Delayed Activities] No Activities ready to queue
12:25:01 CDT debug  : [App] API Usage Rolling Avg: 0.07/s | Est Depletion: 2 hours (8,190 seconds)
12:25:00 CDT info   : [App] CryptoContextModBot from localhost:8095 => CONNECTED
12:24:58 CDT debug  : [Delayed Activities] No Activities ready to queue
12:24:55 CDT verbose: [COM itqv3by] Reddit API Stats: Initial 588 | Current 584 | Used ~4 | Events ~0.00/s
12:24:55 CDT verbose: [COM itqv3by] Run Stats:        Checks 0 | Rules => Total: 0 Unique: 1 Cached: -1 Rolling Avg: ~0.00/s | Actions 0
12:24:55 CDT debug  : [COM itqv3by] [RUN OtherSubsRun] [CHK FreekarmaComments] [Post Check Trigger] Behavior => NEXT RUN => Skip remaining checks and go to next Run
12:24:55 CDT info   : [COM itqv3by] [RUN OtherSubsRun] [CHK FreekarmaComments] Ran Actions: Usernote - usernote
12:24:55 CDT error  : [COM itqv3by] [RUN OtherSubsRun] [CHK FreekarmaComments] [Action Usernote] Action did not run successfully due to unexpected error
ErrorWithCause: 
    at UserNoteAction.handle (/app/src/Action/index.js:123:37)
    at async CommentCheck.runActions (/app/src/Check/index.js:496:29)
    at async CommentCheck.handle (/app/src/Check/index.js:330:49)
    at async Run.handle (/app/src/Run/index.js:156:38)
    at async Manager.handleActivity (/app/src/Subreddit/Manager.js:832:51)
    at async /app/src/Subreddit/Manager.js:363:17

caused by: TypeError: Cannot read properties of undefined (reading 'matches')
    at /app/src/Subreddit/SubredditResources.js:2814:88
    at Array.filter (<anonymous>)
    at notePass (/app/src/Subreddit/SubredditResources.js:2814:74)
    at SubredditResources.isAuthor (/app/src/Subreddit/SubredditResources.js:2834:44)
    at async UserNoteAction.process (/app/src/Action/UserNoteAction.js:43:45)
    at async UserNoteAction.handle (/app/src/Action/index.js:113:29)
    at async CommentCheck.runActions (/app/src/Check/index.js:496:29)
    at async CommentCheck.handle (/app/src/Check/index.js:330:49)
    at async Run.handle (/app/src/Run/index.js:156:38)
    at async Manager.handleActivity (/app/src/Subreddit/Manager.js:832:51)
    at async /app/src/Subreddit/Manager.js:363:17
12:24:55 CDT verbose: [COM itqv3by] [RUN OtherSubsRun] [CHK FreekarmaComments] [Action Usernote] Note:

(spamwatch) User has 32 activities in 1 freekarma sub(s)
12:24:55 CDT debug  : [COM itqv3by] [RUN OtherSubsRun] [CHK FreekarmaComments] Running Actions
12:24:55 CDT info   : [COM itqv3by] [RUN OtherSubsRun] [CHK FreekarmaComments] ✓ => Rules: ✓ Recent - FreeKarmaRule
12:24:55 CDT verbose: [COM itqv3by] [RUN OtherSubsRun] [CHK FreekarmaComments] [Rule Recent - FreeKarmaRule] ✓ 32 activities found in 1 of the specified subreddits (out of 5 total) MET threshold of >= 1 activities -- subreddits: FreeKarma4You
12:24:55 CDT debug  : [COM itqv3by] [Resources] [Subreddit Check] Passed: {"name":{}}
12:24:55 CDT debug  : [COM itqv3by] [Resources] [Subreddit Check] Passed: {"name":{}}
12:24:55 CDT debug  : [COM itqv3by] [Resources] [Subreddit Check] Passed: {"name":{}}
12:24:55 CDT debug  : [COM itqv3by] [Resources] [Subreddit Check] Passed: {"name":{}}
12:24:55 CDT debug  : [COM itqv3by] [Resources] [Subreddit Check] Passed: {"name":{}}
12:24:55 CDT debug  : [COM itqv3by] [Resources] [Subreddit Check] Passed: {"name":{}}
12:24:55 CDT debug  : [COM itqv3by] [Resources] [Subreddit Check] Passed: {"name":{}}
12:24:55 CDT debug  : [COM itqv3by] [Resources] [Subreddit Check] Passed: {"name":{}}
12:24:55 CDT debug  : [COM itqv3by] [Resources] [Subreddit Check] Passed: {"name":{}}
12:24:55 CDT debug  : [COM itqv3by] [Resources] [Subreddit Check] Passed: {"name":{}}
12:24:55 CDT debug  : [COM itqv3by] [Resources] [Subreddit Check] Passed: {"name":{}}
12:24:55 CDT debug  : [COM itqv3by] [Resources] [Subreddit Check] Passed: {"name":{}}
12:24:55 CDT debug  : [COM itqv3by] [Resources] [Subreddit Check] Passed: {"name":{}}
12:24:55 CDT debug  : [COM itqv3by] [Resources] [Subreddit Check] Passed: {"name":{}}
12:24:55 CDT debug  : [COM itqv3by] [Resources] [Subreddit Check] Passed: {"name":{}}
12:24:55 CDT debug  : [COM itqv3by] [Resources] [Subreddit Check] Passed: {"name":{}}
12:24:55 CDT debug  : [COM itqv3by] [Resources] [Subreddit Check] Passed: {"name":{}}
12:24:55 CDT debug  : [COM itqv3by] [Resources] [Subreddit Check] Passed: {"name":{}}
12:24:55 CDT debug  : [COM itqv3by] [Resources] [Subreddit Check] Passed: {"name":{}}
12:24:55 CDT debug  : [COM itqv3by] [Resources] [Subreddit Check] Passed: {"name":{}}
12:24:55 CDT debug  : [COM itqv3by] [Resources] [Subreddit Check] Passed: {"name":{}}
12:24:55 CDT debug  : [COM itqv3by] [Resources] [Subreddit Check] Passed: {"name":{}}
12:24:55 CDT debug  : [COM itqv3by] [Resources] [Subreddit Check] Passed: {"name":{}}
12:24:55 CDT debug  : [COM itqv3by] [Resources] [Subreddit Check] Passed: {"name":{}}
12:24:55 CDT debug  : [COM itqv3by] [Resources] [Subreddit Check] Passed: {"name":{}}
12:24:55 CDT debug  : [COM itqv3by] [Resources] [Subreddit Check] Passed: {"name":{}}
12:24:55 CDT debug  : [COM itqv3by] [Resources] [Subreddit Check] Passed: {"name":{}}
12:24:55 CDT debug  : [COM itqv3by] [Resources] [Subreddit Check] Passed: {"name":{}}
12:24:55 CDT debug  : [COM itqv3by] [Resources] [Subreddit Check] Passed: {"name":{}}
12:24:55 CDT debug  : [COM itqv3by] [Resources] [Subreddit Check] Passed: {"name":{}}
12:24:55 CDT debug  : [COM itqv3by] [Resources] [Subreddit Check] Passed: {"name":{}}
12:24:55 CDT debug  : [COM itqv3by] [Resources] [Subreddit Check] Passed: {"name":{}}
12:24:55 CDT debug  : [COM itqv3by] [Resources] [Activities Fetch] 100 Activities Fetched (1 API Calls) | 39 Met Window Range After Pre Filter
12:24:54 CDT verbose: [COM itqv3by] [RUN OtherSubsRun] [CHK FreekarmaComments] [Author Filter] ✓ => Exclusive author criteria matched => 1 Passed (isMod) | 0 Failed
12:24:54 CDT debug  : [COM itqv3by] [RUN OtherSubsRun] [CHK FreekarmaComments] [Author Filter] Criteria Details: 
isMod => ✓ => Expected: true => Found: false (Exclude passes when Expected is not Found)
12:24:54 CDT debug  : [COM itqv3by] [RUN OtherSubsRun] [CHK FreekarmaComments] [Author Filter] ✓ (AND) => Exclusive Author Criteria 1 => 1 Passed (isMod) | 0 Failed
12:24:54 CDT debug  : [COM itqv3by] [Resources] Cache Hit: Author Check on johnhhyip (Hash authorCrit-CryptoCurrency-johnhhyip-4d05f2d5b644fc00947bbeccc279c0d8994683d4)
12:24:54 CDT verbose: [COM itqv3by] [RUN OtherSubsRun] [Author Filter] ✓ => Exclusive author criteria matched => 1 Passed (isMod) | 0 Failed
12:24:54 CDT debug  : [COM itqv3by] [RUN OtherSubsRun] [Author Filter] Criteria Details: 
isMod => ✓ => Expected: true => Found: false (Exclude passes when Expected is not Found)
12:24:54 CDT debug  : [COM itqv3by] [RUN OtherSubsRun] [Author Filter] ✓ (AND) => Exclusive Author Criteria 1 => 1 Passed (isMod) | 0 Failed
12:24:54 CDT info   : [COM itqv3by] <EVENT>  (Dispatched by undefined | CryptoContextModBot) WTF happened to eth just now? I don't get it the Macro is still the same why the sudden pump? by johnhhyip in https://reddit.com/r/CryptoCurrency/comments/ycqkjy/daily_general_discussion_october_25_2022_gmt0/itqv3by/
12:24:54 CDT info   :  /u/CryptoContextModBot Queued check on https://reddit.com/r/CryptoCurrency/comments/ycqkjy/daily_general_discussion_october_25_2022_gmt0/itqv3by/
12:24:53 CDT debug  : [Delayed Activities] No Activities ready to queue
12:24:48 CDT debug  : [Delayed Activities] No Activities ready to queue
12:24:43 CDT debug  : [Delayed Activities] No Activities ready to queue
12:24:38 CDT debug  : [Delayed Activities] No Activities ready to queue
12:24:33 CDT debug  : [Delayed Activities] No Activities ready to queue
12:24:28 CDT debug  : [Delayed Activities] No Activities ready to queue
12:24:26 CDT info   :  Event polling is PAUSED. (Note: To change polling behavior you must first STOP event polling)
12:24:26 CDT debug  : [Polling] [Comment] Stopping Polling Interval
12:24:26 CDT info   :  /u/CryptoContextModBot invoked 'pause' action for event on r/CryptoCurrency
12:24:23 CDT debug  : [Delayed Activities] No Activities ready to queue
12:24:22 CDT info   :  Activity processing queue started RUNNING with 0 queued activities
12:24:22 CDT info   :  Event polling STARTED
12:24:22 CDT debug  : [Polling] [Comment] Polling Interval Started
12:24:22 CDT debug  :  Starting own streams => COMMENT 30s interval
12:24:22 CDT debug  :  Polling NEWCOMM => create new dedicated stream
12:24:22 CDT info   :  /u/CryptoContextModBot invoked 'start' action for bot on r/CryptoCurrency
12:22:49 CDT debug  : [App] Skipping config check/restart on heartbeat due to previously being stopped by user
12:15:49 CDT info   :  Activity processing queue state set to STOPPED by user
12:15:49 CDT info   :  Note: Polling behavior will be re-built from configuration when next started
12:15:49 CDT info   :  Events STOPPED by user
12:15:49 CDT info   :  /u/CryptoContextModBot invoked 'stop' action for bot on r/CryptoCurrency
12:14:48 CDT info   :  Activity processing queue stopped by system and 2 queued activities cleared (waited 1 seconds while activity processing finished)
12:14:48 CDT warn   :  Waited longer than 5 seconds to stop activities. Something isn't right so forcing stop :/ 
12:14:48 CDT verbose:  Activity processing queue is stopping...waiting for 0 activities to finish processing
12:14:46 CDT verbose: [COM itqv5sx] Reddit API Stats: Initial 0 | Current 0 | Used ~0 | Events ~0.43/s
12:14:46 CDT verbose: [COM itqv5sx] Run Stats:        Checks 0 | Rules => Total: 0 Unique: 0 Cached: 0 Rolling Avg: ~0.36/s | Actions 0
12:14:46 CDT verbose: [COM itqv5sx] No checks triggered
@CryptoMaximalist
Copy link
Author

CryptoMaximalist commented Oct 26, 2022

Maybe this affects modNotes too. They were working before but now getting a similar error. The post above was on the 'latest' docker, but I'm currently on the 'edge'

        actions:
          - kind: modnote # Leave a Mod Note to prevent repeat alerts for this user
            type: SPAM_WATCH
            content: >-
              User has {{rules.freekarmarule.totalCount}} activities in {{rules.freekarmarule.subCount}} freekarma sub(s)
            referenceActivity: true


20:14:36 CDT verbose: [COM itstfbf] Reddit API Stats: Initial 554 | Current 550 | Used ~4 | Events ~0.17/s
20:14:36 CDT verbose: [COM itstfbf] Run Stats:        Checks 0 | Rules => Total: 0 Unique: 2 Cached: -2 Rolling Avg: ~0.16/s | Actions 0
20:14:35 CDT debug  : [COM itstfbf] [RUN BurstpostRun] Skipping b/c Run did not contain any comment Checks
20:14:35 CDT debug  : [COM itstfbf] [RUN OtherSubsRun] [CHK FreekarmaComments] [Post Check Trigger] Behavior => NEXT RUN => Skip remaining checks and go to next Run
20:14:35 CDT info   : [COM itstfbf] [RUN OtherSubsRun] [CHK FreekarmaComments] Ran Actions: Report - report | Remove - remove | Modnote - modnote
20:14:35 CDT error  : [COM itstfbf] [RUN OtherSubsRun] [CHK FreekarmaComments] [Action Modnote] Action did not run successfully due to unexpected error
ErrorWithCause: 
    at ModNoteAction.handle (/app/src/Action/index.js:123:37)
    at async CommentCheck.runActions (/app/src/Check/index.js:496:29)
    at async CommentCheck.handle (/app/src/Check/index.js:330:49)
    at async Run.handle (/app/src/Run/index.js:156:38)
    at async Manager.handleActivity (/app/src/Subreddit/Manager.js:852:51)
    at async /app/src/Subreddit/Manager.js:364:17

caused by: TypeError: Cannot read properties of undefined (reading 'trim')
    at parseRedditFullname (/app/src/util.js:2494:26)
    at new ModNote (/app/src/Subreddit/ModNotes/ModNote.js:30:56)
    at /app/src/Subreddit/SubredditResources.js:660:34
    at [Array.map](http://array.map/) (<anonymous>)
    at SubredditResources.getAuthorModNotes (/app/src/Subreddit/SubredditResources.js:659:42)
20:14:35 CDT debug  : [COM itstfbf] [Resources] Cache Hit: Author ModNotes throwawayyyyyy78901 in CryptoCurrency
20:14:35 CDT verbose: [COM itstfbf] [RUN OtherSubsRun] [CHK FreekarmaComments] [Action Modnote] Note:

(SPAM_WATCH) User has 12 activities in 1 freekarma sub(s)
20:14:35 CDT info   : [COM itstfbf] [RUN OtherSubsRun] [CHK FreekarmaComments] [Action Remove] Not run because it is not enabled.
20:14:34 CDT verbose: [COM itstfbf] [RUN OtherSubsRun] [CHK FreekarmaComments] [Action Report] Contents:

User has 12 activities in 1 freekarma sub(s)
20:14:34 CDT debug  : [COM itstfbf] [RUN OtherSubsRun] [CHK FreekarmaComments] Running Actions
20:14:34 CDT info   : [COM itstfbf] [RUN OtherSubsRun] [CHK FreekarmaComments] ✓ => Rules: ✓ Recent - FreeKarmaRule AND ✓ Author - hasNoFreeKarmaNotes
20:14:34 CDT debug  : [COM itstfbf] [RUN OtherSubsRun] [CHK FreekarmaComments] [Rule Author - hasNoFreeKarmaNotes] [Author Filter] Criteria Details: 

@FoxxMD
Copy link
Owner

FoxxMD commented Oct 26, 2022

im looking into this...i merged some code earlier last week that seems to have "erased" some earlier(er) changes silently. It was causing problems in the same area (authorIs). Checking to see if that is the issue.

FoxxMD added a commit that referenced this issue Oct 26, 2022
FoxxMD added a commit that referenced this issue Oct 26, 2022
#123

Same issues as a949a4e -- memory provider stores objects in memory (no serialization) so need to check for object instance before trying to reconstruct
@FoxxMD
Copy link
Owner

FoxxMD commented Oct 26, 2022

This should be fixed now in edge @CryptoMaximalist

@CryptoMaximalist
Copy link
Author

CryptoMaximalist commented Oct 26, 2022

Thanks! I don't see that error anymore, but I see another one at the debug level and on the verbose level it seems to be deciding not to complete the ModNote action (which is weird because there's no conditions on the Action). This happens even on users with no modnotes at all. The report Action does go through though

          - name: FreeKarmaRule
            kind: recentActivity
            window:
              count: 100
              duration: 1 year
            useSubmissionAsReference: false
            thresholds:
              - subreddits:
                  - FreeKarma4U
                  - FreeKarma4You
                  - KarmaStore
                  - upvote
          - name: hasNoFreeKarmaNotes
            kind: author
            include:
              - isContributor: false
                modActions:
                  - note: '/freekarma/i'
                    noteType: SPAM_WATCH
                    search: total
                    count: "< 1 in 1 year"  
        actions:
          - kind: modnote # Leave a Mod Note to prevent repeat alerts for this user
            type: SPAM_WATCH
            content: >-
              User has {{rules.freekarmarule.totalCount}} activities in {{rules.freekarmarule.subCount}} freekarma sub(s)
            referenceActivity: true

Verbose weblog:

12:03:12 CDT verbose: {r/CryptoMarkets} [COM itvl4lx] Reddit API Stats: Initial 539 | Current 536 | Used ~3 | Events ~0.01/s
12:03:12 CDT verbose: {r/CryptoMarkets} [COM itvl4lx] Run Stats:        Checks 0 | Rules => Total: 0 Unique: 2 Cached: -2 Rolling Avg: ~0.01/s | Actions 0
12:03:12 CDT info   : {r/CryptoMarkets} [COM itvl4lx] [RUN OtherSubsRun] [CHK FreekarmaComments] Ran Actions: Report - report | Remove - remove | Modnote - modnote
12:03:12 CDT info   : {r/CryptoMarkets} [COM itvl4lx] [RUN OtherSubsRun] [CHK FreekarmaComments] [Action Modnote] Will not add note because existing note check condition failed -- modActions => ✘ => Expected: < 1 of current notes is noteType: SPAM_WATCH || note: User has {{rules.freekarmarule.totalCount}} activities in {{rules.freekarmarule.subCount}} freekarma sub(s) || referencesCurrentActivity: true => Found: No Mod Actions present
12:03:12 CDT verbose: {r/CryptoMarkets} [COM itvl4lx] [RUN OtherSubsRun] [CHK FreekarmaComments] [Action Modnote] Note:

(SPAM_WATCH) User has 9 activities in 1 freekarma sub(s)
12:03:12 CDT info   : {r/CryptoMarkets} [COM itvl4lx] [RUN OtherSubsRun] [CHK FreekarmaComments] [Action Remove] Not run because it is not enabled.
12:03:11 CDT verbose: {r/CryptoMarkets} [COM itvl4lx] [RUN OtherSubsRun] [CHK FreekarmaComments] [Action Report] Contents:

User has 9 activities in 1 freekarma sub(s)
12:03:11 CDT info   : {r/CryptoMarkets} [COM itvl4lx] [RUN OtherSubsRun] [CHK FreekarmaComments] ✓ => Rules: ✓ Recent - FreeKarmaRule AND ✓ Author - hasNoFreeKarmaNotes
12:03:11 CDT verbose: {r/CryptoMarkets} [COM itvl4lx] [RUN OtherSubsRun] [CHK FreekarmaComments] [Rule Author - hasNoFreeKarmaNotes] [Author Filter] ✓ => Inclusive Author Criteria 1 => 2 Passed (isContributor,modActions) | 0 Failed
12:03:11 CDT verbose: {r/CryptoMarkets} [COM itvl4lx] [RUN OtherSubsRun] [CHK FreekarmaComments] [Rule Recent - FreeKarmaRule] ✓ 9 activities found in 1 of the specified subreddits (out of 22 total) MET threshold of >= 1 activities -- subreddits: FreeKarma4You
12:03:11 CDT verbose: {r/CryptoMarkets} [COM itvl4lx] [RUN OtherSubsRun] [CHK FreekarmaComments] [Author Filter] ✓ => Exclusive author criteria matched => 1 Passed (isMod) | 0 Failed
12:03:10 CDT verbose: {r/CryptoMarkets} [COM itvl4lx] [RUN OtherSubsRun] [Author Filter] ✓ => Exclusive author criteria matched => 1 Passed (isMod) | 0 Failed
12:03:10 CDT info   : {r/CryptoMarkets} [COM itvl4lx] <EVENT>  (Dispatched by undefined | newComm) i left that school where u learned money is time cus time equals money squared by cruxxxx in https://reddit.com/r/CryptoMarkets/comments/ydqza1/mainstream_adoption_is_happening_slowly_but_surely/itvl4lx/
12:03:07 CDT info   : [App] CryptoContextModBot from localhost:8095 => CONNECTED
12:02:42 CDT verbose: {r/CryptoCurrency} [COM itvl2cm] Reddit API Stats: Initial 545 | Current 544 | Used ~1 | Events

https://reddit.com/r/CryptoMarkets/comments/ydqza1/mainstream_adoption_is_happening_slowly_but_surely/itvl4lx/

Debug file log:

2022-10-26T17:19:54+00:00 info   : ~u/CryptoContextModBot~ {r/CryptoCurrency}  /u/CryptoContextModBot Queued DRY RUN check on FOREIGN ACTIVITY https://www.reddit.com/r/CryptoMarkets/comments/ydqza1/mainstream_adoption_is_happening_slowly_but_surely/itvl4lx/
2022-10-26T17:19:54+00:00 info   : ~u/CryptoContextModBot~ {r/CryptoCurrency} [COM itvl4lx] <EVENT>  (Dispatched by undefined | CryptoContextModBot) i left that school where u learned money is time cus time equals money squared by cruxxxx in https://reddit.com/r/CryptoMarkets/comments/ydqza1/mainstream_adoption_is_happening_slowly_but_surely/itvl4lx/
2022-10-26T17:19:54+00:00 debug  : ~u/CryptoContextModBot~ {r/CryptoCurrency} [COM itvl4lx] [RUN SpamRun] Skipping b/c Run did not contain any comment Checks
2022-10-26T17:19:54+00:00 debug  : ~u/CryptoContextModBot~ {r/CryptoCurrency} [COM itvl4lx] [Resources] Cache Hit: Author Check on cruxxxx (Hash authorCrit-CryptoCurrency-cruxxxx-4d05f2d5b644fc00947bbeccc279c0d8994683d4)
2022-10-26T17:19:54+00:00 debug  : ~u/CryptoContextModBot~ {r/CryptoCurrency} [COM itvl4lx] [RUN OtherSubsRun] [Author Filter] ✓ (AND) => Exclusive Author Criteria 1 => 1 Passed (isMod) | 0 Failed
2022-10-26T17:19:54+00:00 debug  : ~u/CryptoContextModBot~ {r/CryptoCurrency} [COM itvl4lx] [RUN OtherSubsRun] [Author Filter] Criteria Details: 
isMod => ✓ => Expected: true => Found: false (Exclude passes when Expected is not Found)
2022-10-26T17:19:54+00:00 verbose: ~u/CryptoContextModBot~ {r/CryptoCurrency} [COM itvl4lx] [RUN OtherSubsRun] [Author Filter] ✓ => Exclusive author criteria matched => 1 Passed (isMod) | 0 Failed
2022-10-26T17:19:54+00:00 debug  : ~u/CryptoContextModBot~ {r/CryptoCurrency} [COM itvl4lx] [Resources] Cache Hit: Author Check on cruxxxx (Hash authorCrit-CryptoCurrency-cruxxxx-4d05f2d5b644fc00947bbeccc279c0d8994683d4)
2022-10-26T17:19:54+00:00 debug  : ~u/CryptoContextModBot~ {r/CryptoCurrency} [COM itvl4lx] [RUN OtherSubsRun] [CHK FreekarmaComments] [Author Filter] ✓ (AND) => Exclusive Author Criteria 1 => 1 Passed (isMod) | 0 Failed
2022-10-26T17:19:54+00:00 debug  : ~u/CryptoContextModBot~ {r/CryptoCurrency} [COM itvl4lx] [RUN OtherSubsRun] [CHK FreekarmaComments] [Author Filter] Criteria Details: 
isMod => ✓ => Expected: true => Found: false (Exclude passes when Expected is not Found)
2022-10-26T17:19:54+00:00 verbose: ~u/CryptoContextModBot~ {r/CryptoCurrency} [COM itvl4lx] [RUN OtherSubsRun] [CHK FreekarmaComments] [Author Filter] ✓ => Exclusive author criteria matched => 1 Passed (isMod) | 0 Failed
2022-10-26T17:19:54+00:00 debug  : ~u/CryptoContextModBot~ {r/CryptoCurrency} [COM itvl4lx] [Resources] [Activities Fetch] 100 Activities From Cache (1 API Calls saved! ) | 100 Met Window Range After Pre Filter | Cache Fingerprint: cruxxxx-overview-75b9fda44af6ea8b0029c20dbc4d6ef4ae5cb3f4
2022-10-26T17:19:54+00:00 debug  : ~u/CryptoContextModBot~ {r/CryptoCurrency} [COM itvl4lx] [Resources] [Subreddit Check] Passed: {"name":{}}
2022-10-26T17:19:54+00:00 debug  : ~u/CryptoContextModBot~ {r/CryptoCurrency} [COM itvl4lx] [Resources] [Subreddit Check] Passed: {"name":{}}
2022-10-26T17:19:54+00:00 debug  : ~u/CryptoContextModBot~ {r/CryptoCurrency} [COM itvl4lx] [Resources] [Subreddit Check] Passed: {"name":{}}
2022-10-26T17:19:54+00:00 debug  : ~u/CryptoContextModBot~ {r/CryptoCurrency} [COM itvl4lx] [Resources] [Subreddit Check] Passed: {"name":{}}
2022-10-26T17:19:54+00:00 debug  : ~u/CryptoContextModBot~ {r/CryptoCurrency} [COM itvl4lx] [Resources] [Subreddit Check] Passed: {"name":{}}
2022-10-26T17:19:54+00:00 debug  : ~u/CryptoContextModBot~ {r/CryptoCurrency} [COM itvl4lx] [Resources] [Subreddit Check] Passed: {"name":{}}
2022-10-26T17:19:54+00:00 debug  : ~u/CryptoContextModBot~ {r/CryptoCurrency} [COM itvl4lx] [Resources] [Subreddit Check] Passed: {"name":{}}
2022-10-26T17:19:54+00:00 debug  : ~u/CryptoContextModBot~ {r/CryptoCurrency} [COM itvl4lx] [Resources] [Subreddit Check] Passed: {"name":{}}
2022-10-26T17:19:54+00:00 debug  : ~u/CryptoContextModBot~ {r/CryptoCurrency} [COM itvl4lx] [Resources] [Subreddit Check] Passed: {"name":{}}
2022-10-26T17:19:54+00:00 verbose: ~u/CryptoContextModBot~ {r/CryptoCurrency} [COM itvl4lx] [RUN OtherSubsRun] [CHK FreekarmaComments] [Rule Recent - FreeKarmaRule] ✓ 9 activities found in 1 of the specified subreddits (out of 21 total) MET threshold of >= 1 activities -- subreddits: FreeKarma4You
2022-10-26T17:19:54+00:00 debug  : ~u/CryptoContextModBot~ {r/CryptoCurrency} [COM itvl4lx] [Resources] Cache Hit: Subreddit Contributors CryptoCurrency
2022-10-26T17:19:54+00:00 error  : ~u/CryptoContextModBot~ {r/CryptoCurrency} [COM itvl4lx] [RUN OtherSubsRun] [CHK FreekarmaComments] [Rule Author - hasNoFreeKarmaNotes] Error occurred while processing rule
2022-10-26T17:19:54+00:00 warn   : ~u/CryptoContextModBot~ {r/CryptoCurrency} [COM itvl4lx] [RUN OtherSubsRun] [CHK FreekarmaComments] [CHK FreekarmaComments] Running rules failed due to uncaught exception
ErrorWithCause: 
    at CommentCheck.handle (/app/src/Check/index.js:312:45)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async Run.handle (/app/src/Run/index.js:156:38)
    at async Manager.handleActivity (/app/src/Subreddit/Manager.js:852:51)
    at async /app/src/Subreddit/Manager.js:364:17

caused by: ErrorWithCause: Running rules failed due to error
    at CommentCheck.runRules (/app/src/Check/index.js:486:19)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async CommentCheck.handle (/app/src/Check/index.js:300:44)
    at async Run.handle (/app/src/Run/index.js:156:38)
    at async Manager.handleActivity (/app/src/Subreddit/Manager.js:852:51)
    at async /app/src/Subreddit/Manager.js:364:17

caused by: SimpleError: Can only get Modnotes for current moderator subreddit, Activity is from CryptoMarkets
    at SubredditResources.getAuthorModNotesByActivityAuthor (/app/src/Subreddit/SubredditResources.js:647:19)
2022-10-26T17:19:54+00:00 debug  : ~u/CryptoContextModBot~ {r/CryptoCurrency} [COM itvl4lx] [RUN OtherSubsRun] [CHK FreekarmaComments] [Post Check Fail] Behavior => NEXT => Run next check
2022-10-26T17:19:54+00:00 debug  : ~u/CryptoContextModBot~ {r/CryptoCurrency} [COM itvl4lx] [RUN BurstpostRun] Skipping b/c Run did not contain any comment Checks
2022-10-26T17:19:54+00:00 verbose: ~u/CryptoContextModBot~ {r/CryptoCurrency} [COM itvl4lx] No checks triggered
2022-10-26T17:19:54+00:00 verbose: ~u/CryptoContextModBot~ {r/CryptoCurrency} [COM itvl4lx] Run Stats:        Checks 0 | Rules => Total: 0 Unique: 0 Cached: 0 Rolling Avg: ~0.06/s | Actions 0

https://www.reddit.com/r/CryptoMarkets/comments/ydqza1/mainstream_adoption_is_happening_slowly_but_surely/itvl4lx/

EDIT: Can confirm writing usernotes is working now though. However, reading notes doesn't seem to find any. A user with 36 of these notes reports as having 0

          - name: hasNoFreeKarmaNotes
            kind: author
            exclude:
              - userNotes:
                - note: '/freekarma/i'
                  type: spamwatch
                  search: total
                  count: "> 0 in 1 year"

2022-10-26T19:11:34+00:00 debug  : ~u/CryptoContextModBot~ [Snoowrap] Received a 200 status code from a `get` request sent to https://oauth.reddit.com/api/mod/notes?raw_json=1&subreddit=CryptoCurrency&user=HaroldFish&limit=100. ratelimitRemaining: 584
2022-10-26T19:11:34+00:00 debug  : ~u/CryptoContextModBot~ {r/CryptoCurrency} [COM itw20cn] [RUN OtherSubsRun] [CHK FreekarmaComments] [Rule Author - hasNoFreeKarmaNotes] [Author Filter] ✓ (AND) => Exclusive Author Criteria 1 => 1 Passed (modActions) | 0 Failed
2022-10-26T19:11:34+00:00 debug  : ~u/CryptoContextModBot~ {r/CryptoCurrency} [COM itw20cn] [RUN OtherSubsRun] [CHK FreekarmaComments] [Rule Author - hasNoFreeKarmaNotes] [Author Filter] Criteria Details: 
modActions => ✓ => Expected: > 0 in 1 year of total notes is note: /freekarma/i || noteType: SPAM_WATCH => Found: 0 matched criteria (Exclude passes when Expected is not Found)
2022-10-26T19:11:34+00:00 debug  : ~u/CryptoContextModBot~ {r/CryptoCurrency} [COM itw20cn] [Resources] Returned cached notes
2022-10-26T19:11:34+00:00 debug  : ~u/CryptoContextModBot~ {r/CryptoCurrency} [COM itw20cn] [RUN OtherSubsRun] [CHK FreekarmaComments] [Rule Author - hasNoFreeKarmaNotes] [Author Filter] ✓ (AND) => Exclusive Author Criteria 2 => 1 Passed (userNotes) | 0 Failed
2022-10-26T19:11:34+00:00 debug  : ~u/CryptoContextModBot~ {r/CryptoCurrency} [COM itw20cn] [RUN OtherSubsRun] [CHK FreekarmaComments] [Rule Author - hasNoFreeKarmaNotes] [Author Filter] Criteria Details: 
userNotes => ✓ => Expected: > 0 in 1 year of total notes is spamwatch => Found: 0 are spamwatch (Exclude passes when Expected is not Found)
2022-10-26T19:11:34+00:00 verbose: ~u/CryptoContextModBot~ {r/CryptoCurrency} [COM itw20cn] [RUN OtherSubsRun] [CHK FreekarmaComments] [Rule Author - hasNoFreeKarmaNotes] [Author Filter] ✓ => Exclusive author criteria matched => (many, see debug)
2022-10-26T19:11:34+00:00 info   : ~u/CryptoContextModBot~ {r/CryptoCurrency} [COM itw20cn] [RUN OtherSubsRun] [CHK FreekarmaComments] ✓ => Rules: ✓ Recent - FreeKarmaRule AND ✓ Author - AuthorNotWhitelisted AND ✓ Author - hasNoFreeKarmaNotes
2022-10-26T19:11:34+00:00 debug  : ~u/CryptoContextModBot~ {r/CryptoCurrency} [COM itw20cn] [RUN OtherSubsRun] [CHK FreekarmaComments] Running Actions

https://www.reddit.com/r/CryptoCurrency/comments/ydjljt/daily_general_discussion_october_26_2022_gmt0/itw20cn/

@FoxxMD FoxxMD self-assigned this Oct 27, 2022
@FoxxMD
Copy link
Owner

FoxxMD commented Oct 27, 2022

I need permalinks for these activities alongside the logs, i can't fetch the activity (for comments) just from ids in the log.

@CryptoMaximalist
Copy link
Author

Sure, links added under each log snippet

@FoxxMD
Copy link
Owner

FoxxMD commented Oct 27, 2022

@CryptoMaximalist I've deployed changes to edge which should fix usernote filtering and hopefully also mod note action.

Just FYI for mod/user note action -- by default CM will not add a note if it the current note for the user matches the same criteria as in the action. So type content and referenceActivity -- those all "match" the current note then another note is not added. If you want to add duplicates then add existingNoteCheck: false to your note action.

@CryptoMaximalist
Copy link
Author

CryptoMaximalist commented Oct 27, 2022

Thanks! After about an hour of testing, I can say reading and writing both UserNotes and ModNotes is working again! And I don't have any other errors in my logs either

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants