# (Reproducable) Installed node-red-contrib-chatbot which disable/messed up projects

**URL:** https://discourse.nodered.org/t/reproducable-installed-node-red-contrib-chatbot-which-disable-messed-up-projects/20580
**Category:** General
**Created:** [19 January 2020 16:32 UTC](https://discourse.nodered.org/t/reproducable-installed-node-red-contrib-chatbot-which-disable-messed-up-projects/20580 "2020-01-19T16:32:23Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)
#### Post date: [19 January 2020 16:32 UTC](https://discourse.nodered.org/t/reproducable-installed-node-red-contrib-chatbot-which-disable-messed-up-projects/20580/1 "2020-01-19T16:32:23Z")

</div>

OS: macOS 10.14.6  
Node-red: v1.0.3  
Node.js: v12.13.0  
Running projects.

So I was trying to look into an issue for a user. Somewhere in the process of installing start/stopping NR and removing the node, it lost the connection to projects.

Now everytime I start NR I see in the log:

```auto
19 Jan 16:13:48 - [warn] No active project : using default flows file
19 Jan 16:13:48 - [info] Flows file : /Users/Paul/.node-red/flows_Pauls-mini-4.local.json
19 Jan 16:13:48 - [info] Creating new flow file

```

and in NR I'm greeted with

 ![Screen Shot 2020-01-19 at 11.29.28 AM](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/8/3/83eea2a27f3f92ca9f74f82995d13722aa4cf38d.png)

How do I fix it so it will use my existing projects?

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [19 January 2020 16:57 UTC](https://discourse.nodered.org/t/reproducable-installed-node-red-contrib-chatbot-which-disable-messed-up-projects/20580/2 "2020-01-19T16:57:04Z")

</div>

Has it changed the setting in settings.js? That would be a bit odd.

---

<div class="post-metadata">

### Author: ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)
#### Post date: [19 January 2020 17:02 UTC](https://discourse.nodered.org/t/reproducable-installed-node-red-contrib-chatbot-which-disable-messed-up-projects/20580/3 "2020-01-19T17:02:30Z")

</div>

Click 'open existing project' in the bottom and see where that gets you.

---

<div class="post-metadata">

### Author: ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)
#### Post date: [19 January 2020 17:05 UTC](https://discourse.nodered.org/t/reproducable-installed-node-red-contrib-chatbot-which-disable-messed-up-projects/20580/4 "2020-01-19T17:05:10Z")

</div>

@Colin - No it did not change settings.js - the last mod date on it is Dec 28, 2019  
@knolleary, If I open an existing project make a change stop/start NR, the log shows no active project and I get the 'Hello we have intrduced projects...' again

---

<div class="post-metadata">

### Author: ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)
#### Post date: [19 January 2020 17:18 UTC](https://discourse.nodered.org/t/reproducable-installed-node-red-contrib-chatbot-which-disable-messed-up-projects/20580/5 "2020-01-19T17:18:56Z")

</div>

I went and looked at .config.json - at the end of the file I see:

```auto
 "projects": {
  "projects": {}
 }

```

so I went into Timemachine (on my mac) and grabbed a copy from yesterday and at the end I see:

```auto
"projects": {
  "projects": {
   "RFID-reader": {
    "credentialSecret": false
   },
   "The-Project": {
    "credentialSecret": false
   },
   "test-area": {
    "credentialSecret": false
   },
   "Davids-CHAT": {
    "credentialSecret": false
   },
   "test_upgrade": {
    "credentialSecret": false
   },
   "Fire-Training": {
    "credentialSecret": false
   },
   "Music_box": {
    "credentialSecret": false
   },
   "GreenHouse": {
    "credentialSecret": false
   },
   "stupidhead": {
    "credentialSecret": false
   },
   "UI_testing": {
    "credentialSecret": false
   },
   "Abel": {
    "credentialSecret": false
   },
   "linechart": {
    "credentialSecret": false
   },
   "WemosBackupRestore": {
    "credentialSecret": false
   },
   "david-Weather": {
    "credentialSecret": false
   },
   "DavePlaytime": {
    "credentialSecret": false
   },
   "musicbox": {
    "credentialSecret": false
   },
   "DavidDeepSleep": {
    "credentialSecret": false
   },
   "debug_mqtt": {
    "credentialSecret": false
   },
   "coffee": {
    "credentialSecret": false
   },
   "a-fix-mqtt": {
    "credentialSecret": false
   },
   "deleteeme": {
    "credentialSecret": false
   },
   "PMB_Scrapr": {
    "credentialSecret": false
   },
   "plane2": {
    "credentialSecret": false
   },
   "SVG_testing": {
    "credentialSecret": false
   },
   "Outdoor_Survival": {
    "credentialSecret": false
   },
   "David_musicbox": {
    "credentialSecret": false
   },
   "Dave_musicbox2": {
    "credentialSecret": false
   },
   "AA_testing": {
    "credentialSecret": false
   },
   "FCATV-Telegram": {
    "credentialSecret": false
   },
   "MySQL_test": {
    "credentialSecret": false
   },
   "A_flow_module_finder": {
    "credentialSecret": false
   },
   "aTelegram_group": {
    "credentialSecret": false
   },
   "a-a-fs-test": {
    "credentialSecret": false
   },
   "M4": {
    "credentialSecret": false
   },
   "aaxterm": {
    "credentialSecret": false
   },
   "Find_templates": {
    "credentialSecret": false
   }
  },
  "activeProject": "AA_testing"
 },

```

(yes I have a lot of projects)

I'm going replace the .config.json and see what happens.

---

<div class="post-metadata">

### Author: ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)
#### Post date: [19 January 2020 17:30 UTC](https://discourse.nodered.org/t/reproducable-installed-node-red-contrib-chatbot-which-disable-messed-up-projects/20580/6 "2020-01-19T17:30:56Z")

</div>

Well that got me out of that mess. Now to try installing the node again and see if it happens again.

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [19 January 2020 17:31 UTC](https://discourse.nodered.org/t/reproducable-installed-node-red-contrib-chatbot-which-disable-messed-up-projects/20580/7 "2020-01-19T17:31:59Z")

</div>

Is there a deficiency in the system, if you loose config.json you lose the projects?

---

<div class="post-metadata">

### Author: ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)
#### Post date: [19 January 2020 17:35 UTC](https://discourse.nodered.org/t/reproducable-installed-node-red-contrib-chatbot-which-disable-messed-up-projects/20580/8 "2020-01-19T17:35:29Z")

</div>

Not lost.... just misplaced :-)...(the file are still present - just the index was lost for some reason) - and yes - may be a bug if we can find out how it happened and can reproduce it.

---

<div class="post-metadata">

### Author: ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)
#### Post date: [19 January 2020 17:44 UTC](https://discourse.nodered.org/t/reproducable-installed-node-red-contrib-chatbot-which-disable-messed-up-projects/20580/9 "2020-01-19T17:44:58Z")

</div>

.config.json contains all your runtime configuration. So yes, if it is lost, then you lose configuration. You don't lose any projects or data.

There is an item on the backlog to split some of runtime configuration into their own files to minimise any issue if one file gets corrupted.

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [19 January 2020 18:20 UTC](https://discourse.nodered.org/t/reproducable-installed-node-red-contrib-chatbot-which-disable-messed-up-projects/20580/10 "2020-01-19T18:20:20Z")

</div>

I realised it wouldn't have removed the files, but how do you re-index them?

---

<div class="post-metadata">

### Author: ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)
#### Post date: [19 January 2020 18:44 UTC](https://discourse.nodered.org/t/reproducable-installed-node-red-contrib-chatbot-which-disable-messed-up-projects/20580/11 "2020-01-19T18:44:38Z")

</div>

Well I have been able to reproduce it but need to build a step by step. I'll do it later since I'm going to go for a family swim with the grandkids!

---

<div class="post-metadata">

### Author: ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)
#### Post date: [20 January 2020 10:02 UTC](https://discourse.nodered.org/t/reproducable-installed-node-red-contrib-chatbot-which-disable-messed-up-projects/20580/12 "2020-01-20T10:02:39Z")

</div>

Reproducable - here is how I can reproduce it

`WARNING: before doing this, go to your .node-red directory and backup your .config.json`

1. stop NR
2. npm remove node-red-contrib-chatbot
3. start NR
4. open project
5. import test flow - get errors missing nodes
6. in palette add node-red-contrib-chatbot

- note screen grey, node moved out of the flow to top left - page not active

1. refresh screen
2. re-import flow
3. deploy
4. shutdown NR
5. close browser window

- note at this point the .config.json file is still good.

1. start NR - .config.json file good - projects ok
2. stop/start NR  
At this point the .config.json file updated and projects gone

---

<div class="post-metadata">

### Author: ![afelix](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/afelix/32/9743_2.png) [@afelix](https://discourse.nodered.org/u/afelix)
#### Post date: [20 January 2020 11:39 UTC](https://discourse.nodered.org/t/reproducable-installed-node-red-contrib-chatbot-which-disable-messed-up-projects/20580/13 "2020-01-20T11:39:27Z")

</div>

Sadly, I can't say I'm surprised here. I've used redbot/node-red-contrib-chatbot in the past, but right now it's not in use in any of my flows no matter the benefits it would bring me. I've tried to understand how the code functions, but so far without much luck. It's incredibly powerful if/when it works, but for example the discord nodes (that have now been moved to their own package due to incompatibility with some platforms) will cause issues when a flow branches. (Note that the discord nodes won't show up in the flow library, the package published to NPM has a readme missing. I filled an issue and it has been added to the backlog on trello, will likely have to wait to a further version.)

And because of the complexity of the code it's hard to write PRs for it. Every redbot entry node puts a set of functions on the message object to handle the communication, as well as introduce its own messaging context. Depending on the communication type (slack/telegram/facebook messenger/discord/...) these functions are sync/async. Some can be cloned, others can't, thus cloneMessage running into trouble, especially on branching.

For each communication type a bot is defined, either development or production. The bot settings are stored in the functionGlobalContext in settings.js, which the node will edit. To later edit your bot settings you're instructed to go to your settings.js file to change them according to your needs. Figuring out what does what/what is located where is particularly hard as some core parts have been moved to their own package/repository. As a result it will be hard to figure out where this exact issue was caused, and whether it goes wrong on a Node-RED level or somewhere in the Redbot packages due to editing files. Iirc there's a number of injects taking place by the Redbot core on start/restart of Node-RED, so it could be there, but honestly I just tried to read through the code and I can't find where it even happens.

---

<div class="post-metadata">

### Author: ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)
#### Post date: [20 January 2020 12:24 UTC](https://discourse.nodered.org/t/reproducable-installed-node-red-contrib-chatbot-which-disable-messed-up-projects/20580/14 "2020-01-20T12:24:21Z")

</div>

I fully agree. I tried to use it when it first came out but it had almost no documentation then. I've tried a few times since but it is just too complex without any real need. I got the feeling from the developer that it was part of a custom build of Node-RED that they used commercially & therefore there was little interest in fixing issues when used "normally".

I use the standard telegram node.

---

<div class="post-metadata">

### Author: ![kanke](https://avatars.discourse-cdn.com/v4/letter/k/a698b9/32.png) [@kanke](https://discourse.nodered.org/u/kanke)
#### Post date: [20 January 2020 16:03 UTC](https://discourse.nodered.org/t/reproducable-installed-node-red-contrib-chatbot-which-disable-messed-up-projects/20580/15 "2020-01-20T16:03:56Z")

</div>

I have weird issue here too: [Telegram error when sending message](https://discourse.nodered.org/t/telegram-error-when-sending-message/20237)  
Which node do you use right now?

---

<div class="post-metadata">

### Author: ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)
#### Post date: [20 January 2020 16:23 UTC](https://discourse.nodered.org/t/reproducable-installed-node-red-contrib-chatbot-which-disable-messed-up-projects/20580/16 "2020-01-20T16:23:54Z")

</div>

@knolleary/@dceejay - bug in the node (in which case I'll open an issue) or issue with NR?

@kanke - see your thread for answer to your query.

---

<div class="post-metadata">

### Author: ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)
#### Post date: [20 January 2020 18:03 UTC](https://discourse.nodered.org/t/reproducable-installed-node-red-contrib-chatbot-which-disable-messed-up-projects/20580/17 "2020-01-20T18:03:51Z")

</div>

> **[node-red-contrib-telegrambot](https://flows.nodered.org/node/node-red-contrib-telegrambot)**
>
> Telegram bot nodes.

Never really had any problems with it and it seems to do what I need it to.

I also use the Rivescript node for helping with conversational bot interfaces.

---

<div class="post-metadata">

### Author: ![dynamicdave](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dynamicdave/32/96_2.png) [@dynamicdave](https://discourse.nodered.org/u/dynamicdave)
#### Post date: [20 January 2020 19:07 UTC](https://discourse.nodered.org/t/reproducable-installed-node-red-contrib-chatbot-which-disable-messed-up-projects/20580/18 "2020-01-20T19:07:30Z")

</div>

I agree with Julian - never had any problems with _node-red-contrib-telegrambot_  
although I did have issues with _chatbo_t and gave up trying to figure it out.

---

<div class="post-metadata">

### Author: ![kanke](https://avatars.discourse-cdn.com/v4/letter/k/a698b9/32.png) [@kanke](https://discourse.nodered.org/u/kanke)
#### Post date: [21 January 2020 17:45 UTC](https://discourse.nodered.org/t/reproducable-installed-node-red-contrib-chatbot-which-disable-messed-up-projects/20580/19 "2020-01-21T17:45:18Z")

</div>

migrated over to this node, works fine. thank you

---

<div class="post-metadata">

### Author: ![kanke](https://avatars.discourse-cdn.com/v4/letter/k/a698b9/32.png) [@kanke](https://discourse.nodered.org/u/kanke)
#### Post date: [24 January 2020 04:01 UTC](https://discourse.nodered.org/t/reproducable-installed-node-red-contrib-chatbot-which-disable-messed-up-projects/20580/20 "2020-01-24T04:01:37Z")

</div>

node-red-contrib-telegrambot worked most of time, but do got error from time to time.

![Screen Shot 2020-01-23 at 9.51.54 PM](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/9/5983df73130af43f84b54f890e05f891f8b2679d.jpeg)

from log:

```auto
23 Jan 21:49:53 - [warn] [telegram bot:ea007ac4.9f7f88] ETELEGRAM: 500 Internal server error: restart
23 Jan 21:49:53 - [warn] [telegram bot:ea007ac4.9f7f88] Unknown error. Trying again.
23 Jan 21:49:57 - [warn] [telegram bot:ea007ac4.9f7f88] ETELEGRAM: 502 Bad Gateway
23 Jan 21:49:57 - [warn] [telegram bot:ea007ac4.9f7f88] Unknown error. Trying again.

```

[Next page](https://discourse.nodered.org/t/reproducable-installed-node-red-contrib-chatbot-which-disable-messed-up-projects/20580.md?page=2)
