question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support remote files over network drive, ftp, or ssh

See original GitHub issue

I’m using an SMB share to work in Windows from a virtual Linux VM. Turned on debugging and looking in the developer console and the log file to see why none of my time is being tracked (I’ve put in line breaks for readability).

VS Code dev console:

[Extension Host] [WakaTime] [DEBUG] Sending heartbeat:
C:\Users\myUser\.vscode\extensions\wakatime.vscode-wakatime-1.2.3\out\python\pythonw
C:\Users\myUser\.vscode\extensions\wakatime.vscode-wakatime-1.2.3\out\wakatime-master\wakatime\cli.py
--file \\192.168.0.10\myShare\myProject\myFile.sh
--plugin "vscode/1.27.2 vscode-wakatime/1.2.3"
--alternate-project myProject
--write
--config C:\Users\myUser\.wakatime.cfg
--logfile C:\Users\myUser\.wakatime.log

.wakatime.log:

{
"now": "2018/10/02 06:53:22 +0200",
"version": "10.3.0",
"plugin": "vscode/1.27.2 vscode-wakatime/1.2.3",
"time": 1538456002.735315,
"caller": "C:\\Users\\myUser\\.vscode\\extensions\\wakatime.vscode-wakatime-1.2.3\\out\\wakatime-master\\wakatime\\main.py",
"lineno": 51,
"is_write": true,
"file": "\\\\192.168.0.10\\myShare\\myProject\\myFile.sh",
"level": "DEBUG",
"message": "File does not exist; ignoring this heartbeat."
}

It seems that it detects that the file does not exist \\192.168.0.10\myShare\myProject\myFile.sh. But that path does work when entering it into Explorer, so I assume that Wakatime is not able to interpret a network path like Explorer does.

How can I get around this issue? Is there a way to ignore ‘file does not exist’ and track it anyway?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:2
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

5reactions
glicscommented, May 18, 2020

Happening here as well. Windows 10 x64 1909, vscode 1.45.1, extension version 4.0.0. Weird that it happens also when a remote folder is mapped as network drive 🤔 Here i am accessing the file via Z:\supersecretfolder\supersecretfile.php, where Z: is a mapping of the network folder \\192.168.0.222\htdocs. This is on SMB, in case it’s not clear.

{
  "now": "2020/05/18 18:25:18 +0200",
  "version": "13.0.7",
  "plugin": "vscode/1.45.1 vscode-wakatime/4.0.0",
  "time": 1589819118.2597008,
  "caller": "wakatime\\main.py",
  "lineno": 68,
  "file": "\\\\192.168.0.222\\htdocs\\supersecretfolder\\supersecretfile.php",
  "level": "DEBUG",
  "message": "File does not exist; ignoring this heartbeat."
}

EDIT

Little update, apparently, this only happens when accessing paths via their ip addresses instead of their hostname.

To give you the best explaination I can offer, my previous log was on access to the following file paths (both leading to the same result in "file"):

Z:\supersecretfolder\supersecretfile.php \\192.168.0.222\htdocs\supersecretfolder\supersecretfile.php (where Z: is mapped as network drive for a shared folder on \\192.168.0.222\htdocs)

When instead i’m editing the same file from the following paths (again, both giving the same result):

Z:\supersecretfolder\supersecretfile.php \\CFSERVER\htdocs\supersecretfolder\supersecretfile.php

Here, again, Z: is mapped as network folder for \\CFSERVER\htdocs, and CFSERVER is the hostname of the machine located at 192.168.0.222

{
  "now": "2020/05/18 18:41:06 +0200",
  "version": "13.0.7",
  "plugin": "vscode/1.45.1 vscode-wakatime/4.0.0",
  "time": 1589820066.6484404,
  "caller": "wakatime\\api.py",
  "lineno": 45,
  "is_write": true,
  "file": "\\\\CFSERVER\\htdocs\\supersecretfolder\\supersecretfile.php",
  "level": "DEBUG",
  "message": "Sending heartbeats to api at https://api.wakatime.com/api/v1/users/current/heartbeats.bulk"
}

I hope this helps in some way! If you need further clarifications or want me to test something else I’ll do so as soon as I am able to.

1reaction
alanhamlettcommented, Oct 2, 2018

Related to wakatime/wakatime#72 and wakatime/wakatime-mode#27.

Read more comments on GitHub >

github_iconTop Results From Across the Web

SSHFS: How to Mount Remote File Systems Over SSH
SSHFS mounts a remote file system locally using the secure SSH file ... the menu on the left pane and select the option...
Read more >
Which File Transfer Method Is Best for Your Home Network?
SFTP is a better option for transferring files from or to locations outside of your home. But that doesn't mean you must use...
Read more >
Mapping Network Drive Over SSH in Windows - Makerlab - HKU
1. Clicks mouse right button on "This PC" in file explorer, selects "Map network drive..." on pop menu.
Read more >
NetDrive - The Network Drive for Windows (FTP, SFTP ...
Share your NAS easily with anyone as virtual drive. SFTP to securely transfer files. NetDrive supports secure file transfer by SFTP (SSH File...
Read more >
How To Use SFTP to Securely Transfer Files with a Remote ...
SFTP is a secure way to transfer files between local and remote servers. Much more secure than FTP, this protocol uses an SSH...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found