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

ERR_UNHANDLED_REJECTION #8

Closed
QazCetelic opened this issue Aug 20, 2023 · 4 comments
Closed

ERR_UNHANDLED_REJECTION #8

QazCetelic opened this issue Aug 20, 2023 · 4 comments

Comments

@QazCetelic
Copy link

The error includes incorrect_login, however I'm able to log in just fine with the same credentials on the site.

stdout

STARTED: Started Bot
INSTANCES: 1 instances loaded.
FEEDS: 1 feeds loaded.
Starting bot
Creating database file
DB: Connected to the database.
Initializing DB
logging in
TABLE: Loaded posts table.
TABLE: Loaded time table
POSTS: 0 posts in database.
node:internal/process/promises:289
            triggerUncaughtException(err, true /* fromPromise */);
            ^

[UnhandledPromiseRejection: This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason "incorrect_login".] {
  code: 'ERR_UNHANDLED_REJECTION'
}

Node.js v20.5.1

config.yaml

---
# Whether to give the bot a bot tag (true) or not (false). Recommended to mark it but the option is here if you already 
# marked it manually and it starts throwing user_already_exists errors
markAsBot: true

# How often to check for new posts in minutes
postCheckInterval: 10

# How often to check for a new day in minutes (for unpinning posts)
dayCheckInterval: 10

# The timezone to use for the bot (as reference for unpinning posts at midnight)
# You can see the options here: https://www.inmotionhosting.com/support/website/tz-ref-table/
timezone: 'Europe/Amsterdam'

# Posts from how many days ago are you willing to backpost when the bot starts
dayCutOff: 3

# Set to true to add all posts to the db without posting them. Good to set for one run to clear out backposts if you 
# dont want any old posts posted when the bot is first ran. Set to false to post normally
stopPosts: false

# Set to true if you want to see log messages. False if not
# (Note I cant control log messages sent by the bot library so those will still show. Just ones thrown by the bot wont)
showLogs: true

# The maximum amount of posts it will do on every post check. Set to 0 for no limit. (Each post being posted to another instance is separate in here but itll finish up the same post before it stops)
maxPosts: 5

# The time in milliseconds it will sleep before doing another post in the same post check
postSleepDuration: 5000

# The instances and communities used by the bot
instances:
  sh.itjust.works: # The instance name
    nos_tech:
      - "nos_tech"


# The rss feeds used to pull posts from
feeds:
  nos_tech:
    url: 'https://feeds.nos.nl/nosnieuwstech'
    content: 'description'
    datefield: 'pubDate'
@th3raid0r
Copy link
Contributor

I'm also getting the same thing after upgrading Lemmy to v.0.19.0. @QazCetelic is your issue with a v0.19 instance or is it a v0.18.4/5 instance still?

@Ategon - Perhaps something to do with navigating an invalidated session? That's my hunch given all of this. I noticed that Lemmy seems to have different (and better) response codes across the board and perhaps the app needs to be informed of a new response code to accept.

@th3raid0r
Copy link
Contributor

Ah, okay, just need to update the lemmy-bot library to v0.5.0+ which may require a larger rebase onto Node 18.

@QazCetelic
Copy link
Author

I tried it with the changes from 485b41f and got a different error, so this issue seems to be fixed.

@QazCetelic
Copy link
Author

I've create a new issue for the new problem, #26

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