SK
Signal K2mo ago
Aswin

Aswin - Last night I published new versions of ...

Last night I published new versions of my plugins advancedwind and speedandcurrent. They both use another npm package called signalkutilities that I also published. Right after publishing these via my laptop I upgraded my navigation computer (a different computer ). And then, chaos. Signalk broke down, my settings and security settings were gone. The reason was an old version of the signalk utlities. I immediately withdrew the upgraded versions of my plugins to prevent this from happening to others. The appstore however still shows the withdrawn version of my plugins. You cannot download them though. I think I did everything right with the dependencies and versions in the different package.sjon files. But I have to admit that I am an amateur. The git files are the ones I published if one cares to look. Any ideas on how to prevent this, how to correct this?
7 Replies
Teppo Kurki
Teppo Kurki2mo ago
it is a bit hard to understand what exactly you did in what order side note, but when asking questions it helps a lot if you can include direct links to exactly what you are talking about - like direct links to the packages and code in question in npm and in github in principle something like this should go like this: - publish the new version of your dependency, like signalkutilities@1.4.0 - update your plugin’s dependencies to require at the minimum that version - test your plugin: wipe node_modules, reinstall npm dependencies, check that you got the version you expected - publish a new version of the plugin - when the plugin gets updated npm will install the new version of the dependency i have a really hard time imagining how an old dependency of a plugin would break the server’s functionality, let alone losing settings. as this is not the only case of settings disappearing it would be really great to get as much information as you can share: the exact starting point, the exact steps that you took, so that we might track down what is wiping the settings do you still have server’s logs from when sk was broken - i’d love to see what was the exact error that prevented the server from working, there should be something in the log app store uses npm’s search by keyword feature to fetch the list of plugins. the result of that search is not real time, as they employ caching and the cache is not always up to the exact state of things in the registry. search returning outdated results and install failing when the version is not available would be the symptom, as you describe how did you withdraw the incorrect versions? meaning: unpublish or deprecate?
David Godin
David Godin2mo ago
I don’t mean to barge in this conversation but almost every user I speak with say the Appstore, frequently but not always, does not display the correct installed version on reboot.
Aswin
AswinOP2mo ago
A short answer for now. Tonight I'll send the log and details. This morning I managed to publish the plugins. I noticed that it takes time for the webstore to see the most current version. After some time I got an up to date version in the webstore that I installed successfully. I did not wait for this last night. This is probably why things went wrong. I used npm unpublish plugin@version for the plugins. As promised, a bit more detail: I have three projects. Two are signalK plugins: AdvancedWind (https://github.com/Asw1n/advancedwind) and SpeedAndCurrent (https://github.com/Asw1n/speedandcurrent). The third contains some utility classes that I use in the other projects (https://github.com/Asw1n/signalkutilities). The plugins are already in the appstore. I updated these three projects and I wanted to publish them yesterday. So I increased version numbers. In Git I committed and synched them. I then published the to NPM (signalkutilities first, then the other two). This was all doen from my laptop that I use for development. Immediately I started to update my navigation computer, this one is never used for development. So no local links in NPM. I stopped the SignalK service and started it again from the CLI. I did this because I suspected hat SignalK needs a fresh start to repopulate the appstore but I did not want to restart the computer. After the restart of signalK I went to the appstore and installed the updates of my apps. I did not check version numbers at that time, so I do not know if they were the latest. I then stopped the server and restarted it from the CLI. I got an error immediately that originiated from my advancedwind plugin saying that MessageHandlerDamped is not a class. I then knew that the link to signalkutilities was broken, because that class is new. I did not examine the log any further, not did I save it. As I thought that all errors ware the result of the one error that I recognised. I wanted to disable my plugin and evaluate the situation, but the lists of installed plugins was blank. I then restarted the server again. This time the plugin settings were available and I disabled my updated plugins. But I then also noticed that I could not logout, I sign that the security settings were gone. ... .... The server also did not have any data connections any more. (Luckily I had copies of these files as I recently upgraded signalk to the latest version that comes with the windows installer.) This was the moment I panicked, I did not want to be responsible for ruining other peoples signalK install. So I upgraded my projects, made sure al dependencies were right and republished to NPM. I went to upgrade them again in signalK, but this time I noticed that the version numbering was behind. So I aborted the install. Instead I unpublished the two versions of the plugin I had published that night. I did not unpublish the signalkutilities. I thought I was save. This morning I went to check the appstore, only to find the unpublished versions of my plugins. I tried to install one, but to my relieve that did not work. So than I increased the version numbers of my plugins and republished them. I frequently restarted signalk until the moment the appstore showed my the right version number. I installed my plugins and verified in the node_modules directory that I also got the most recent version of the signalKutilities. I tested my plugins and they worked just as on my devlopment PC. I hope this breakdown is detailed enough. Too bad I did not save the log from the CLI.
Teppo Kurki
Teppo Kurki2mo ago
thanks for the detailed writeup. what i don’t understand is the sequence of events - restart and plugin settings are not available - second restart and they are available if you had used the filter feature in plugin settings the first step makes sense: loading your plugin failsbecause of the error, and when you navigate to plugin config it filters for your plugin, but it is not there and the list appears empty but how does the second restart fix things so that the plugin settings appear?? do you have any log information available from that time?
Teppo Kurki
Teppo Kurki2mo ago
https://github.com/Asw1n/speedandcurrent/blob/main/index.js#L1 the old version would be required as the first thing and plugin loading should fail, so no amount of simple restarts would fix that
GitHub
speedandcurrent/index.js at main · Asw1n/speedandcurrent
A signalK plugin to estimate boat speed, leeway and current - Asw1n/speedandcurrent
Teppo Kurki
Teppo Kurki2mo ago
how did you restart from cli? do you happen to have shell history still available? trying to the bottom of this, as losing settings is a pretty nasty outcome of a sequence of actions. plugin not loading because of errors is pretty frequent when developing and juggling plugins, so that alone does not cause this
Aswin
AswinOP2mo ago
there is a misunderstanding here. At first restart the plugin page was not populated. I did not mean that the plugin settings were gone, I just could see them via the server interface. At the second restart they were there in the plugins page. The plugin settings were not damaged nor changed. The server settings however were gone. There was an (more or less) empty settings.json with none of the settings I made. Most notably to me were the missing data sources. The security.json was gone. For this reason I concluded that also the settings.json must have been gone and that signalk created a default one when I restarted the server. I do not know if the lost of these two settings happened at the crash or at the first restart. I did not save the shell history. Instead I panicked when I realised these two files were gone, as I realised the impact this could have for others. My only goal then was to prevent this. Indeed I am used to plugins not loading during development. I also had a similar error (MessageHandlerDamped is not a class) on my development machine during development. But that time nothing got damaged.

Did you find this page helpful?