Log doesn´t work!

As I say in the title I am having problems with my logs. :sweat_smile:

Yesterday instead of using the powershell command I tried changing to a logfile on the system. Things didn’t go well at all, I even lost the node connection for about 10m for messing up the yaml file.

The point is that due to my inexperience with the power shell I don’t know how to redirect a route between that tangle of symbols (: \ /) so im not getting any logfile but in addictive now the command Get-Content "$ env: ProgramFiles / Storj / Storage Node / storagenode.log "-Tail 20 -Wait is not working either, the only data they give me is 24 hours old.

So at this point I am now, with no logs in file or powershell, nor do I dare to reset the service much and try combinations since yesterday it was a disaster and I receive constant errors “Error 1067: the process terminated unexpectedly”

So please, I’m here looking for guidance im afraid im stuck with this.

Thank you!

What did you do exactly?

1 Like

Follow the FAQs guide

https://documentation.storj.io/resources/faq/redirect-logs

1º Stop the node by power shell, Stop-Service storagenode. This showup:

Stop-Service : No se puede detener el servicio ‘Storj V3 Storage Node (storagenode)’ debido al error siguiente: No se
puede abrir el servicio storagenode en el equipo ‘.’.
En línea: 1 Carácter: 1

  • Stop-Service storagenode
  •   + CategoryInfo          : CloseError: (System.ServiceProcess.ServiceController:ServiceController) [Stop-Service],
     ServiceCommandException
      + FullyQualifiedErrorId : CouldNotStopService,Microsoft.PowerShell.Commands.StopServiceCommand
    
    

So I used the services windows for stop the node (error 1067 appears but anyway i guess the log went offline at that point.

2º Edit the log.output: winfile:///X:\Storagenode\node.log comand in order to introduce the path, but wasnt sure how paths in powershell works so probably i changed something not propperly.

3º Start-Service storagenode. But node didt wake up, after a few moments of despair it occurred to me to comment # the yaml line that I had edited. If I remember correctly, in powershell Start-Service storagenode doesnt work, but through windows services the node rebooted.

4º From that point my logs are gone from anywwhere.

5º Seeing that it had been a problem with the yaml file, I edited it again to try to leave it as before. I did not have a backup (I have learned the lesson on that) I left it so I suppose that here may be the error.

can be stdout, stderr, or a filename

log.output: winfile: /// X: \ Storagenode \ node.log

Show screenshot of config.yaml file with this line

log.output

1 Like

Here it is

To stop the service from the Powershell you should run the Powershell session as an administrator

Please, check the path (Powershell):

ls X:\Storagenode
1 Like

Im not completely sure, but as far as i know, i also tried elevated powershell (was yesterday and can´t remember every step). Probably didnt do it propperly, cause now elevated powershell seems to shutdown the node and reestar propperly.

ls X:\Storagenode shows this:

PS C:\Users\Servidor> ls X:\Storagenode
ls : No se encuentra la unidad. No existe ninguna unidad con el nombre ‘X’.
En línea: 1 Carácter: 1

  • ls X:\Storagenode
  •   + CategoryInfo          : ObjectNotFound: (X:String) [Get-ChildItem], DriveNotFoundException
      + FullyQualifiedErrorId : DriveNotFound,Microsoft.PowerShell.Commands.GetChildItemCommand

You do not have a path X:\Storagenode to store the log file node.log, please specify the correct path.

1 Like

I`ve tried. But never used the powershell before.

Should i create a text file named node.log or it will be created automatically?

the X in X:\Storagenode is part of some powershell function, or just a letter to change for my drive path.

if the path i want to use is

C:\Program Files\Storj\Storage Node

then this should be ok ??

log.output: winfile:///C:\Program Files\StorjStoragenode\node.log

Sorry for be so so newbie

Nope…

log.output: winfile:///C:\Program Files\StorjStoragenode\node.log

Doesnt work. gives after save the Yaml file with notepad as admin with that path and try to reboot the node i get this

Start-Service : No pudo iniciarse el servicio ‘Storj V3 Storage Node (storagenode)’.
En línea: 1 Carácter: 1

  • Start-Service storagenode
  •   + CategoryInfo          : OpenError: (System.ServiceProcess.ServiceController:ServiceController) [Start-Service],
     ServiceCommandException
      + FullyQualifiedErrorId : StartServiceFailed,Microsoft.PowerShell.Commands.StartServiceCommand

The default value for it is:

log.output: winfile:///C:\Program Files\Storj\Storage Node\\storagenode.log
1 Like

I’m just wondering, what is the difference between winfile:///C:\Storj\app\\storagenode.log and C:\Storj\app\storagenode.log? Both seem to work fine.
Furthermore, the original config.yaml contains both types - simple Windows style path identity.cert-path: D:\Storj\Identity\identity.cert and also the weird winfile:/// style path log.output: winfile:///C:\Storj\app\\storagenode.log
Does it make any difference?

image

2 Likes

Hmm why do you copy text as image? Hard to read on mobile. Anyway, I can talk to chatgpt as well, but, unfortunately it is not correct answer. What I am asking has obviously nothin to do with web based and windows explorer

I would say, that even if I do not like the ChatGPT answers, this one almost correct.
Just different libraries and compatibility settings between platforms. I would assume, that both formats are safe for this option.
But the question is interesting. Not worth to investigate, but still.

I was wondering why storj developers are using both conventions in single file / app? Usually it may be good rule to use the same everywhere :innocent:

We do not re-implement already implemented stuff. We just use them, if the license is allowing to do so (we are an Open Source project, and must follow all license agreements).
Of course, we can modify the behavior… But why? Does it affect you? (the developers time, which can be used for implementing some customers’ requests = bringing more money, SNOs are included).

Internally it’ll convert C:\Storj\... to winfile://C:\Storj\...; so they are equivalent.

The winfile:// quirk came from using go.uber.org/zap library, because it gets confused what’s a URL vs. filepath. See Windows paths not supported by default file sink · Issue #621 · uber-go/zap · GitHub for more details.

Unfortunately the winfile:// workaround ended up leaking into the config files due to some complexities in how we handle configuration files.

Or in other words – it’s a quirk that would be nice to fix, but not important enough to actually spend significant amount of time on it.

2 Likes

Thank you for thorough explanation. Yes I was wondering some libraries are the cause. I plan to start my Golang lessons soon, and I find the storj project good source for my study :wink:
No need to fix, just for learning purposes…

1 Like