tagyoureit / nodejs-poolController-webClient

Web app for nodejs-poolController 6.0 and above.
GNU Affero General Public License v3.0
9 stars 4 forks source link

Cannot GET /utilities #24

Closed leftyfl1p closed 3 years ago

leftyfl1p commented 3 years ago

The "Utilities" nav button at the top sends me to /utilities and 404s with the error Cannot GET /utilities. Default config file, haven't changed anything. Let me know if you need more info.

Version: 6.1.0

Config file:

{
  "discovery": {
    "override": {
      "protocol": "http",
      "host": "10.0.1.6",
      "port": 4200
    },
    "useSSDP": false,
    "poolURL": "http://10.0.1.6:4200"
  },
  "web": {
    "port": 8080
  },
  "options": {
    "hidePanels": [],
    "debug": false
  },
  "chemController": {}
}
tagyoureit commented 3 years ago

Try 'next' Branch. It has many fixes.

arrmo commented 3 years ago

FYI, I recently updated to the latest 'next' code - and now npm run build is failing. Not sure if it's just me (likely ... LOL). I did install and update npm, still having issues. If it helps, log attached. 2020-12-26T17_56_03_453Z-debug.log

Thanks!

tagyoureit commented 3 years ago

Did you run 'npm i' to make sure you have the latest dependencies?

arrmo commented 3 years ago

Yes - sorry, didn't say that very clearly above. Did npm i, and also checked outdated, did an update. I can try whacking the entire node-modules directory, reinstall. No biggie, if it makes sense to try it.

Thanks!

tagyoureit commented 3 years ago

@leftyfl1p I was able to replicate your issue; need to investigate.

@arrmo I still can't replicate your issue. Try upgrading to node v12.

arrmo commented 3 years ago

Try upgrading to node v12

Error earlier 🤣. Upgraded, but now the poolController won't start? Error as below,

web/interfaces/influxInterface.ts:19:42 - error TS2305: Module '"../../node_modules/@influxdata/influxdb-client/dist/all"' has no exported member 'WritePrecision'.

Do you have influxdata enabled?

arrmo commented 3 years ago

And FYI, inside webClient,

pi@rpi3b:~/Documents/nodejs-poolController-webClient(next)$ npm install
npm WARN react-horizontal-stacked-bar-chart@8.15.2 requires a peer of react@~16.12.0 but none is installed. You must install peer dependencies yourself.
npm WARN react-rangeslider@2.2.0 requires a peer of react@^0.14.0 || ^15.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN recompose@0.22.0 requires a peer of react@^0.14.0 || ^15.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN nodejs-poolcontroller-webclient@6.1.1 No repository field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"arm"})
arrmo commented 3 years ago

poolController won't start

OK, fixed this one 😄. From the latest at https://github.com/influxdata/influxdb-client-js/blob/master/examples/write.js, changes as below ... do you want to add this in, or a PR for this?

$ git diff web/interfaces/influxInterface.ts
diff --git a/web/interfaces/influxInterface.ts b/web/interfaces/influxInterface.ts
index 32eef8a..81f43cb 100644
--- a/web/interfaces/influxInterface.ts
+++ b/web/interfaces/influxInterface.ts
@@ -16,7 +16,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

 import extend = require("extend");
-import { ClientOptions, InfluxDB, Point, WritePrecision } from '@influxdata/influxdb-client';
+import { ClientOptions, InfluxDB, Point } from '@influxdata/influxdb-client';
 import { utils } from '../../controller/Constants';
 import { logger } from "../../logger/Logger";
 import { BaseInterfaceBindings, InterfaceContext, InterfaceEvent } from "./baseInterface";
@@ -49,7 +49,7 @@ export class InfluxInterfaceBindings extends BaseInterfaceBindings {
             token: `${baseOpts.username}:${baseOpts.password}`,
         }
         const influxDB = new InfluxDB(clientOptions);
-        this.writeApi = influxDB.getWriteApi('', bucket, 'ms' as WritePrecision);
+        this.writeApi = influxDB.getWriteApi('', bucket, 'ms');

         // set global tags from context
         let baseTags = {}
arrmo commented 3 years ago

And FYI, inside webClient,

And this one ... fixed also 😄. Removed node, nodejs, node_modules => clean upgrade to v14, install all npm again. FYI, still this list of warnings,

npm WARN nodejs-poolcontroller-webclient@6.1.1 No repository field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"arm"})

Thanks!

arrmo commented 3 years ago

OK, not so fast ... LOL. webClient still fails to build / run (parcel it seems?).

tagyoureit commented 3 years ago

What platform are you running this on? And try Node v12. v14 hasn't been tested yet and could have some breaking changes.

I just downloaded -webClient onto my Pi, switched to the next branch, ran npm i and npm start and it worked fine. Did you run npm upgrade by any chance? And don't worry about any errors/warnings that say optional. They aren't needed.

And mqtt is only on njsPC, not webclient. Let's try to keep the issues separate because they aren't related at all.

arrmo commented 3 years ago

Well, I had issues with v12, that's why I tried v14 (also) ... LOL. I did run npm upgrade - is that known to cause issues? I can whack all of node_modules, try again. NP!

Yes, agreed (separate issues) - do you want me to open a different issue report? I can, NP there.

Thanks!

arrmo commented 3 years ago

npm upgrade - is that known to cause issues?

That's it! Clean wipe + npm install ... it works again. Thanks!

Hmmm ... why does npm upgrade not work? Thinking it should, no?

tagyoureit commented 3 years ago

Ya, 'npm upgrade' will try to load newer versions of packages. So, say we code with Influx 1.8 then the upgrade may try to install Influx 2 modules. There should be safe guards around it (eg only upgrade minor/patch version) but sometimes it will cause incompatibility.

arrmo commented 3 years ago

Ya, 'npm upgrade' will try to load newer versions of packages

OK, wondered if that was what it was. So you specify target versions (installed with npm install), right? Thanks!

Live and learn 🤣.

FYI, wasn't trying to sidetrack this, rather test it here. I can confirm, from Utilities (menu), I also see

Cannot GET /utilities

With the latest code.

tagyoureit commented 3 years ago

I have deprecated this project in favor of dashPanel. Rstrouse and I have been doing a ton of work and this project has fallen behind and it isn't worth the effort to keep two similar projects maintained. If anything from this project is missing please request it in the other repo.