Discussion:
git status --porcelain error?
René J.V. Bertin
2016-12-28 10:19:28 UTC
Permalink
Hi,
Command finished with error FailedToStart.
/opt/local/site-ports> git status --porcelain -- /opt/local/site-ports
That command completes without issues when I execute it myself in the indicated directory.

Any idea what this means? Can I just ignore it? Not entirely it would seem: when it occurs via the in-document context menu it usually means the intended operation indeed failed or was never executed because the git status command failed. The few times this happened to me I could achieve the intended result through the equivalent context menu in the project manager.

Thanks,
R.
Kevin Funk
2016-12-29 16:43:49 UTC
Permalink
Hi,
I've begun seeing an error or warning on my Linux system that appears in the
version control toolview, after certain git operations but sometimes also when
Command finished with error FailedToStart.
/opt/local/site-ports> git status --porcelain -- /opt/local/site-ports
That command completes without issues when I execute it myself in the indicated directory.
Please debug.

The error message comes from dvcsjob.cpp in kdevplatform.git:
DVcsJob::slotProcessError( QProcess::ProcessError err )

FailedToStart means [1]:
"The process failed to start. Either the invoked program is missing, or you
may have insufficient permissions to invoke the program."

HTH,
Kevin

PS: Haven't seen this issue myself (or in bug reports).

[1] http://doc.qt.io/qt-5/qprocess.html#ProcessError-enum
when it occurs via the in-document context menu it usually means the
intended operation indeed failed or was never executed because the git
status command failed. The few times this happened to me I could achieve
the intended result through the equivalent context menu in the project
manager.
Thanks,
R.
--
Kevin Funk | ***@kde.org | http://kfunk.org
René J.V. Bertin
2017-01-09 10:32:42 UTC
Permalink
Post by Kevin Funk
Please debug.
DVcsJob::slotProcessError( QProcess::ProcessError err )
I just tried because of a variant I got ... for a while:

Command finished with error FailedToStart.
/opt/local/site-ports/devel/Vc> git stash list

Except that by the time I attached the debugger, it finally loaded all symbol tables and I got a breakpoint set, the issue had resolved itself like a true Heisenbug.

I see that the error handler can output much more detailed information via qCDebug(), I'll turn that into q[C]Warning() locally to ensure I always get to see it on the calling terminal. But maybe that info should be shown in the VCS toolview?
Kevin Funk
2017-01-09 11:46:16 UTC
Permalink
Post by Kevin Funk
Please debug.
DVcsJob::slotProcessError( QProcess::ProcessError err )
Command finished with error FailedToStart.
/opt/local/site-ports/devel/Vc> git stash list
Except that by the time I attached the debugger, it finally loaded all
symbol tables and I got a breakpoint set, the issue had resolved itself
like a true Heisenbug.
I see that the error handler can output much more detailed information via
qCDebug(), I'll turn that into q[C]Warning() locally to ensure I always get
to see it on the calling terminal. But maybe that info should be shown in
the VCS toolview?
I don't think that's necessary. Showing the git output as-is is already quite
verbose.

What /could/ make sense is to elaborate what `FailedToStart` means for the
user...

Patches welcome.

Cheers,
Kevin
--
Kevin Funk | ***@kde.org | http://kfunk.org
René J.V. Bertin
2017-01-09 13:34:53 UTC
Permalink
Post by Kevin Funk
I don't think that's necessary. Showing the git output as-is is already quite
verbose.
I was thinking about something like this:

@@ -244,8 +244,8 @@ void DVcsJob::slotProcessError( QProcess::ProcessError err )
qCDebug(VCS) << "Found an error while running" << displayCommand << ":" << errorValue
<< "Exit code is:" << d->childproc->exitCode();
qCDebug(VCS) << "Error:" << completeErrorText;
- displayOutput(QString::fromLocal8Bit(d->errorOutput));
- d->model->appendLine(i18n("Command finished with error %1.", errorValue));
+// displayOutput(QString::fromLocal8Bit(d->errorOutput));
+ d->model->appendLine(i18n("%1 (%2).", completeErrorText, errorValue));

if(verbosity()==Silent) {
setVerbosity(Verbose);
Post by Kevin Funk
What /could/ make sense is to elaborate what `FailedToStart` means for the
user...
Yeah, but that's not going to tell *me* anything. I don't need hints what the error means but why it happens ;)
Kevin Funk
2017-01-09 14:55:45 UTC
Permalink
Post by René J.V. Bertin
Post by Kevin Funk
I don't think that's necessary. Showing the git output as-is is already
quite verbose.
@@ -244,8 +244,8 @@ void DVcsJob::slotProcessError( QProcess::ProcessError
err ) qCDebug(VCS) << "Found an error while running" << displayCommand <<
":" << errorValue << "Exit code is:" << d->childproc->exitCode();
qCDebug(VCS) << "Error:" << completeErrorText;
- displayOutput(QString::fromLocal8Bit(d->errorOutput));
- d->model->appendLine(i18n("Command finished with error %1.",
errorValue)); +//
displayOutput(QString::fromLocal8Bit(d->errorOutput));
+ d->model->appendLine(i18n("%1 (%2).", completeErrorText, errorValue));
if(verbosity()==Silent) {
setVerbosity(Verbose);
Hmm, that actually makes sense yep. I guess it's an oversight that
`completeErrorText` is not shown in the UI. It's an translated string after
all.

Will apply that later.
Post by René J.V. Bertin
Post by Kevin Funk
What /could/ make sense is to elaborate what `FailedToStart` means for the
user...
Yeah, but that's not going to tell *me* anything. I don't need hints what
the error means but why it happens ;)
Just showing "FailedToStart doesn't really help the user though. It needs be
more descriptive.

I'll look into it.

Thanks,
Kevin
--
Kevin Funk | ***@kde.org | http://kfunk.org
René J.V. Bertin
2017-01-09 15:21:23 UTC
Permalink
Post by Kevin Funk
Hmm, that actually makes sense yep. I guess it's an oversight that
`completeErrorText` is not shown in the UI. It's an translated string after
all.
Good error reporting is an art to often gets overlooked because it is neither "cool" nor crucial for the code authors themselves ;)

Translated indeed. I don't know what goes on with Qt5's regional settings but I regularly get French git errors in KDevelop. Which just shouldn't happen. French is for talking to my wife, neighbours and supermarket cashiers, I expect my computers to converse in a civilised language ;)
Post by Kevin Funk
Post by René J.V. Bertin
Post by Kevin Funk
What /could/ make sense is to elaborate what `FailedToStart` means for the
user...
Yeah, but that's not going to tell *me* anything. I don't need hints what
the error means but why it happens ;)
Just showing "FailedToStart doesn't really help the user though. It needs be
more descriptive.
Well, yes, the one thing doesn't exclude the other but maybe the complete error text will already contain sufficient explanation if you replace FailedToStart c.s. with concise versions in a more natural language. I have no idea ATM.

R.
René J.V. Bertin
2017-01-12 08:59:04 UTC
Permalink
On Monday January 9 2017 15:55:45 Kevin Funk wrote:

Hi,
Post by Kevin Funk
Hmm, that actually makes sense yep. I guess it's an oversight that
`completeErrorText` is not shown in the UI. It's an translated string after
all.
Will apply that later.
Post by Kevin Funk
What /could/ make sense is to elaborate what `FailedToStart` means for the
user...
They've been seeming to hide sinc I increased the error message detail, but I just had one of those errors:

Process 'git ls-files -c -- /home/bertin/work/src/Scratch/KDE/KF5/kdewin-git/tools/png2ico/png2ico.cpp' exited with status 0
(FailedToStart).
/home/bertin/work/src/Scratch/KDE/KF5/kdewin-git/tools/png2ico> git ls-files -c -- /home/bertin/work/src/Scratch/KDE/KF5/kdewin-git/tools/png2ico/png2ico.cpp


Not sure the extra detail is going to help us here.

It does give me a rather wild hunch though, based on the context where I got the error: I used Ctrl+B to build a project (or at least that was my intention) and got the output above instead.
You may have seen that I'm having issues with event handling on Mac (related to the context menu, but I also get a rather frequent message about some other process modifying a file when I just saved it, which is most likely a result of 2 save actions in rapid succession).
This vcs error occurs only on Linux, but couldn't it also be the result of attempting the same command twice in rapid succession and something in the job code cannot handle that, detects some kind of error condition and assumes the vcs command went wrong while in fact something else happened?
Which could ultimately be the result of something as down-to-earth of checking errno somewhere without having reset it before calling the function that supposedly set it.

R
René J.V. Bertin
2017-03-05 09:53:29 UTC
Permalink
On Monday January 9 2017 15:55:45 Kevin Funk wrote:

Hi,
Post by Kevin Funk
Just showing "FailedToStart doesn't really help the user though. It needs be
more descriptive.
I'll look into it.
Any progress on this? I've had another episode yesterday with inexplicable FailedToStart errors that started appearing *systematically* in a running session in which I'd been able to use the patchreview plugin normally up to a certain point. No idea what triggered it (something not closed/released correctly from the patchreview plugin?) but it got to a point where the VCS toolview would pop open even after every save in the regular code area.

R.
René J.V. Bertin
2017-03-05 10:06:31 UTC
Permalink
In fact, shouldn't DVcsJob::start() call waitForStarted() with an appropriately short timeout after calling d->childproc->start()?
René J.V. Bertin
2017-03-06 10:37:42 UTC
Permalink
Post by René J.V. Bertin
In fact, shouldn't DVcsJob::start() call waitForStarted() with an appropriately short timeout after calling d->childproc->start()?
That doesn't seem to make a difference.

I've now modified the dvcsjob code to output both the stdout and stderr of the git subprocess via qCWarning(), and this is what I see:

kdevplatform.vcs: Found an error while running "git ls-files -- kclock.h" : "FailedToStart" Exit code is: 0
kdevplatform.vcs: Error: "Process 'git ls-files -- kclock.h' exited with status 0\n\"\"\n\"\""

I guess I should check for errors from waitForStarted() and see if that tells me more.

I *think* I've also seen a case yesterday where the issue resolved itself after a while, without restarting KDevelop. You'd almost start thinking something is wrong with my system, but then other QProcess calls should fail too for no apparent reason and I have no evidence of that whatsoever.

R.
René J.V. Bertin
2017-03-06 13:53:05 UTC
Permalink
Post by René J.V. Bertin
I guess I should check for errors from waitForStarted() and see if that tells me more.
*That* helped:

kdevplatform.vcs: "DVCSJob::start: git ls-files -- kclock.cpp failed to start: Resource error (fork failure): Cannot allocate memory"

WTH? htop reports

Mem[|||||||||||||||||||||||||||||||||||||6955/7899MB]
Swp[||||1151/16383MB]

which looks pretty normal. I do run with overcommit turned off (overcommit_memory=2 and overcommit_ratio=80) but you'd say that other fork() operations should fail too if there were really a memory issue...

R.

Loading...