FusionAuth / nodebb-plugin-fusionauth-oidc

NodeBB Plugin that allows users to login/register via any configured OAuth provider.
https://fusionauth.io
BSD 2-Clause "Simplified" License
9 stars 10 forks source link

Break build after install #12

Closed julienfollow closed 2 years ago

julienfollow commented 2 years ago

HEllo When i install ur plugin in my nodebb system, build works but not start. Just ur plugin the issue.

Any solutions ?

Thanks

2021-12-22T17:51:34.715Z [4567/115] - error: uncaughtException: Cannot convert undefined or null to object
TypeError: Cannot convert undefined or null to object
    at Function.entries (<anonymous>)
    at trim (/usr/src/app/src/settings.js:27:35)
    at trim (/usr/src/app/src/settings.js:31:4)
    at mergeSettings (/usr/src/app/src/settings.js:44:3)
    at Settings.checkStructure (/usr/src/app/src/settings.js:233:3)
    at Settings.<anonymous> (/usr/src/app/src/settings.js:69:9)
    at /usr/src/app/src/settings.js:103:13
    at /usr/src/app/src/promisify.js:43:50
    at processTicksAndRejections (node:internal/process/task_queues:83:21) {"date":"Wed Dec 22 2021 17:51:34 GMT+0000 (Coordinated Universal Time)","error":{},"exception":true,"os":{"loadavg":[5.28,4.76,4.18],"uptime":121397.97},"process":{"argv":["/usr/local/bin/node","/usr/src/app/app.js"],"cwd":"/usr/src/app","execPath":"/usr/local/bin/node","gid":1000,"memoryUsage":{"arrayBuffers":2765213,"external":5411772,"heapTotal":100519936,"heapUsed":78528896,"rss":155144192},"pid":115,"uid":1000,"version":"v16.13.1"},"stack":"TypeError: Cannot convert undefined or null to object\n    at Function.entries (<anonymous>)\n    at trim (/usr/src/app/src/settings.js:27:35)\n    at trim (/usr/src/app/src/settings.js:31:4)\n    at mergeSettings (/usr/src/app/src/settings.js:44:3)\n    at Settings.checkStructure (/usr/src/app/src/settings.js:233:3)\n    at Settings.<anonymous> (/usr/src/app/src/settings.js:69:9)\n    at /usr/src/app/src/settings.js:103:13\n    at /usr/src/app/src/promisify.js:43:50\n    at processTicksAndRejections (node:internal/process/task_queues:83:21)","trace":[{"column":null,"file":null,"function":"Function.entries","line":null,"method":"entries","native":false},{"column":35,"file":"/usr/src/app/src/settings.js","function":"trim","line":27,"method":null,"native":false},{"column":4,"file":"/usr/src/app/src/settings.js","function":"trim","line":31,"method":null,"native":false},{"column":3,"file":"/usr/src/app/src/settings.js","function":"mergeSettings","line":44,"method":null,"native":false},{"column":3,"file":"/usr/src/app/src/settings.js","function":"Settings.checkStructure","line":233,"method":"checkStructure","native":false},{"column":9,"file":"/usr/src/app/src/settings.js","function":null,"line":69,"method":null,"native":false},{"column":13,"file":"/usr/src/app/src/settings.js","function":null,"line":103,"method":null,"native":false},{"column":50,"file":"/usr/src/app/src/promisify.js","function":null,"line":43,"method":null,"native":false},{"column":21,"file":"node:internal/process/task_queues","function":"processTicksAndRejections","line":83,"method":null,"native":false}]}
2021-12-22T17:51:34.716Z [4567/115] - error: TypeError: Cannot convert undefined or null to object
joolsr commented 2 years ago

I get same issue with v1.19.1

zhivkoangelov commented 2 years ago

I got the same error.

Additional details: 2022-03-29T14:55:35.189Z [5555/22844] - warn: [plugins] Unable to load library for: nodebb-plugin-fusionauth-oidc 2022-03-29T14:55:35.190Z [5555/22844] - error: ReferenceError: settings is not defined at Object. (C:\zan\repos\vial_repos\vial-forum-nodebb\src\settings.js:88:24)

Did anyone solved this issue ?

jimmiejackson414 commented 2 years ago

Doesn't look like it's been addressed or this project has been abandoned. I just tried installing and am receiving the same error

mooreds commented 2 years ago

Thanks for the report and sorry about this!

I know we're running it for our community forum, so maybe we made changes that haven't been upstreamed. I'll take a look.

mooreds commented 2 years ago

No changes I can see. It looks like we are running version 1.0.1 which is the latest version in the package.json. We are running v 1.18.6.

Is everyone here running this plugin against FusionAuth or are you running against different OIDC servers?

jimmiejackson414 commented 2 years ago

@mooreds I'd followed this FusionAuth article yesterday, using a fresh NodeBB install from two days prior.

mooreds commented 2 years ago

@jimmiejackson414 what version of nodebb are you running?

jimmiejackson414 commented 2 years ago

@mooreds v1.18.6

mooreds commented 2 years ago

I just merged https://github.com/FusionAuth/nodebb-plugin-fusionauth-oidc/pull/7 and made a new release. Can you please try that? I am also opening a ticket with our nodebb provider to see if they have done anything different to the plugin; will report back.

mooreds commented 2 years ago

@jimmiejackson414 I diffed what we are currently running on our forum with the 1.0.2 release I just made and there are no changes. So I think that merging #7 fixed the issue. Please let me know, and I apologize for not monitoring this repo more carefully.

jimmiejackson414 commented 2 years ago

@mooreds When I search for the plugin, I'm still only seeing v1.0.1. Also that is totally ok, thank you for the quick responses!

Screen Shot 2022-06-01 at 11 00 36 AM

mooreds commented 2 years ago

Ah, my mistake. Please try now and grab 1.0.3. (That included a small upgrade to typescript required for publishing.)

jimmiejackson414 commented 2 years ago

Odd, I'm having issues opening localhost:9011 following that FusionAuth guide I posted earlier. I'm using v.18.6 of NodeBB, but that makes me think that it's not really an issue with this specific plugin (I haven't installed it yet).

jimmiejackson414 commented 2 years ago

@mooreds Finally got past that issue. Now I'm not seeing the option for "OpenID Connect" in the Plugins dropdown? I've already rebuilt and restarted nodebb, and performed several page refreshes. Is this an issue with the plugin?

I'm running the logs and seeing this issue after rebuild:

2022-06-01T22:27:22.264Z [4567/22252] - error: uncaughtException: Cannot convert undefined or null to object
TypeError: Cannot convert undefined or null to object
    at Function.entries (<anonymous>)
    at trim (/Users/jimmiejackson/Documents/repositories/gear_closet_forums_test/src/settings.js:27:35)
    at trim (/Users/jimmiejackson/Documents/repositories/gear_closet_forums_test/src/settings.js:31:4)
    at mergeSettings (/Users/jimmiejackson/Documents/repositories/gear_closet_forums_test/src/settings.js:44:3)
    at Settings.checkStructure (/Users/jimmiejackson/Documents/repositories/gear_closet_forums_test/src/settings.js:233:3)
    at Settings.<anonymous> (/Users/jimmiejackson/Documents/repositories/gear_closet_forums_test/src/settings.js:69:9)
    at /Users/jimmiejackson/Documents/repositories/gear_closet_forums_test/src/settings.js:103:13
    at /Users/jimmiejackson/Documents/repositories/gear_closet_forums_test/src/promisify.js:43:50
    at processTicksAndRejections (node:internal/process/task_queues:83:21) {"date":"Wed Jun 01 2022 15:27:22 GMT-0700 (Pacific Daylight Time)","error":{},"exception":true,"os":{"loadavg":[12.40087890625,5.923828125,3.9130859375],"uptime":9922},"process":{"argv":["/usr/local/bin/node","/Users/jimmiejackson/Documents/repositories/gear_closet_forums_test/app.js"],"cwd":"/Users/jimmiejackson/Documents/repositories/gear_closet_forums_test","execPath":"/usr/local/bin/node","gid":20,"memoryUsage":{"arrayBuffers":2276476,"external":7523923,"heapTotal":102617088,"heapUsed":77862560,"rss":170102784},"pid":22252,"uid":501,"version":"v16.13.1"},"stack":"TypeError: Cannot convert undefined or null to object\n    at Function.entries (<anonymous>)\n    at trim (/Users/jimmiejackson/Documents/repositories/gear_closet_forums_test/src/settings.js:27:35)\n    at trim (/Users/jimmiejackson/Documents/repositories/gear_closet_forums_test/src/settings.js:31:4)\n    at mergeSettings (/Users/jimmiejackson/Documents/repositories/gear_closet_forums_test/src/settings.js:44:3)\n    at Settings.checkStructure (/Users/jimmiejackson/Documents/repositories/gear_closet_forums_test/src/settings.js:233:3)\n    at Settings.<anonymous> (/Users/jimmiejackson/Documents/repositories/gear_closet_forums_test/src/settings.js:69:9)\n    at /Users/jimmiejackson/Documents/repositories/gear_closet_forums_test/src/settings.js:103:13\n    at /Users/jimmiejackson/Documents/repositories/gear_closet_forums_test/src/promisify.js:43:50\n    at processTicksAndRejections (node:internal/process/task_queues:83:21)","trace":[{"column":null,"file":null,"function":"Function.entries","line":null,"method":"entries","native":false},{"column":35,"file":"/Users/jimmiejackson/Documents/repositories/gear_closet_forums_test/src/settings.js","function":"trim","line":27,"method":null,"native":false},{"column":4,"file":"/Users/jimmiejackson/Documents/repositories/gear_closet_forums_test/src/settings.js","function":"trim","line":31,"method":null,"native":false},{"column":3,"file":"/Users/jimmiejackson/Documents/repositories/gear_closet_forums_test/src/settings.js","function":"mergeSettings","line":44,"method":null,"native":false},{"column":3,"file":"/Users/jimmiejackson/Documents/repositories/gear_closet_forums_test/src/settings.js","function":"Settings.checkStructure","line":233,"method":"checkStructure","native":false},{"column":9,"file":"/Users/jimmiejackson/Documents/repositories/gear_closet_forums_test/src/settings.js","function":null,"line":69,"method":null,"native":false},{"column":13,"file":"/Users/jimmiejackson/Documents/repositories/gear_closet_forums_test/src/settings.js","function":null,"line":103,"method":null,"native":false},{"column":50,"file":"/Users/jimmiejackson/Documents/repositories/gear_closet_forums_test/src/promisify.js","function":null,"line":43,"method":null,"native":false},{"column":21,"file":"node:internal/process/task_queues","function":"processTicksAndRejections","line":83,"method":null,"native":false}]}
jimmiejackson414 commented 2 years ago

Just a follow up question, do you know if this plugin happens to work with v2.x of NodeBB?

Never mind, I think I answered my own question. I get an error stating that the plugin isn't white listed by the NodeBB Package Manager, so I don' think it works in v2.x

mooreds commented 2 years ago

@jimmiejackson414 does the error go away when you delete/disable this plugin?

jimmiejackson414 commented 2 years ago

Yep!

mooreds commented 2 years ago

Okay. I need to set it up and debug it myself. That'll probably be a week or so from now, just because of my current schedule.

jimmiejackson414 commented 2 years ago

Great, thank you for the update!

Rnaaz commented 2 years ago

Hello, I am also facing the same issue. Looks like the plugin has some issue. Even I upgraded the nodebb to version 1.19.8 and the fusionauth plugin I am using shows version 1.0.1. Any ETA for this issue?

mooreds commented 2 years ago

Hi @Rnaaz . I'm trying to find time to test this out, but unfortunately this week got away from me. I aim to take a look soon, but can't commit to an ETA.

Happy to review any PRs, though :) .

ThorodanBrom commented 2 years ago

Hello @mooreds, I've pushed a PR for the fix - it works when I tested it on NodeBB v1.19.1.

ankeshanand1 commented 2 years ago

Pull Request #14 fixes this issue! Verified it on NodeBB v2.2.1

Rnaaz commented 2 years ago

Hello @mooreds, I've pushed a PR for the fix - it works when I tested it on NodeBB v1.19.1.

Rnaaz commented 2 years ago

We have also done the same and it works fine. Though We don't know if this is the correct approach. This PR works.

mooreds commented 2 years ago

Thanks everyone, I just merged #14 . Thanks so much to @ThorodanBrom for submitting it. I'll push a release today.

Am going to close this issue out when that is done.

mooreds commented 2 years ago

Fixed in 1.0.4