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.

Import failing and rolling back due to whitespace error (2.0.0-rc5)

See original GitHub issue

@evocateur, could you please suggest a work around for this or help me find someone who can?

lerna import is reporting a git error and rolling back changes, the second part seems unfortunate because git gives instructions for fixing the problem using git am continue or skip, but that doesn’t seem possible by the time lerna has stopped… See message below…

Updated: It looks like the commit causing the problem for lerna import is one months ago where I unfortunately lost the newline at the end of a .gitignore file. The next commit fixes the problem, and the current version of that directory doesn’t even have the file present anymore. However it is blocking lerna import from operating.

Expected Behavior

Import operation should be robust to whitespace issues, or should at least give the user a chance to fix-up any git merge problems and continue. (I recognize the newline error may be generated by git not lerna. )

Current Behavior

Instead, the command is aborting and rolling back, it displays this message:

lerna ERR! execute callback with error
lerna ERR! execute  Failed to apply commit 7c728ce.
lerna ERR! execute Error: Command failed: git am -3
lerna ERR! execute .git/rebase-apply/patch:87: new blank line at EOF.
lerna ERR! execute +
lerna ERR! execute warning: 1 line adds whitespace errors.
lerna ERR! execute error: Failed to merge in the changes.
lerna ERR! execute Applying: Fixup gitignore to allow tests writtenin JavaScript
lerna ERR! execute Using index info to reconstruct a base tree...
lerna ERR! execute M    "packages\\tool/.gitignore"
lerna ERR! execute Falling back to patching base and 3-way merge...
lerna ERR! execute Auto-merging packages\tool/.gitignore
lerna ERR! execute CONFLICT (content): Merge conflict in packages\tool/.gitignore
lerna ERR! execute Patch failed at 0001 Fixup gitignore to allow tests writtenin JavaScript
lerna ERR! execute The copy of the patch that failed is found in: .git/rebase-apply/patch
lerna ERR! execute When you have resolved this problem, run "git am --continue".
lerna ERR! execute If you prefer to skip this patch, run "git am --skip" instead.
lerna ERR! execute To restore the original branch and stop patching, run "git am --abort".
lerna ERR! execute
lerna ERR! execute Rolling back to previous HEAD (commit 5df9d8e4952921e54c4709f55e30f525d9f49539).

Possible Solution

It seems like I could skip the failing patch, but lerna’s decision to roll-back isn’t helping.

Steps to Reproduce (for bugs)

npm install -g lerna
git clone https://github.com/tunnelvisionlabs/antlr4ts.git
git init a4
cd a4
lerna init
git add .
git commit -m "initial commit"
lerna import ../antlr4ts/tool
lerna.json

{
  "lerna": "2.0.0-rc.5",
  "packages": [
    "packages/*"
  ],
  "version": "0.0.0"
}

lerna-debug.log

0 silly input [ '..\\antlr4ts\\tool' ]
1 silly flags { _: [ 'import' ],
1 silly flags   sort: true,
1 silly flags   concurrency: 4,
1 silly flags   pathToRepo: '..\\antlr4ts\\tool' }
2 verbose rootPath C:\code\a4t
3 info version 2.0.0-rc.5
4 silly isInitialized
5 silly isInitialized true
6 silly existsSync C:\code\a4t\VERSION
7 silly initialize attempt
8 silly statSync C:\code\antlr4ts\tool
9 silly existsSync C:\code\a4t\packages\tool
10 silly getCurrentSHA
11 verbose getCurrentSHA 5df9d8e4952921e54c4709f55e30f525d9f49539
12 info About to import 839 commits from ..\antlr4ts\tool into packages\tool
13 silly initialize success
14 silly execute attempt
15 info b6e8e74
16 info eeab44a
17 info 1afddd2
18 info d80d2d8
19 info accde09
20 info 5999d62
21 info af23610
22 info 31c64c9
23 info c9b4a64
24 info 5918a03
25 info 9fd43f1
26 info ea9fb85
27 info fce51df
28 info 64dc537
29 info b9483a7
30 info 5a873d1
31 info 6bdde7e
32 info 6ccd725
33 info 1eaf015
34 info fe7abec
35 info 943b9f1
36 info a9d0e99
37 info 7c728ce
38 error execute callback with error
38 error execute  Failed to apply commit 7c728ce.
38 error execute Error: Command failed: git am -3
38 error execute .git/rebase-apply/patch:87: new blank line at EOF.
38 error execute +
38 error execute warning: 1 line adds whitespace errors.
38 error execute error: Failed to merge in the changes.
38 error execute Applying: Fixup gitignore to allow tests writtenin JavaScript
38 error execute Using index info to reconstruct a base tree...
38 error execute M	"packages\\tool/.gitignore"
38 error execute Falling back to patching base and 3-way merge...
38 error execute Auto-merging packages\tool/.gitignore
38 error execute CONFLICT (content): Merge conflict in packages\tool/.gitignore
38 error execute Patch failed at 0001 Fixup gitignore to allow tests writtenin JavaScript
38 error execute The copy of the patch that failed is found in: .git/rebase-apply/patch
38 error execute When you have resolved this problem, run "git am --continue".
38 error execute If you prefer to skip this patch, run "git am --skip" instead.
38 error execute To restore the original branch and stop patching, run "git am --abort".
38 error execute
38 error execute Rolling back to previous HEAD (commit 5df9d8e4952921e54c4709f55e30f525d9f49539).

Context

Blocking even evaluating if lerna can help me.

Your Environment

Executable Version
lerna --version 2.0.0-rc.5
npm --version 5.0.3
yarn --version n/a
node --version v6.10.3
OS Version
Windows 10 1703 (OS Build 15063.322)

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:12
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

8reactions
nruhecommented, Jun 19, 2017

I’m getting a similar issue that is likely related.

lerna info 0157346 
lerna ERR! execute callback with error
lerna ERR! execute  Failed to apply commit 0157346.
lerna ERR! execute Error: Command failed: git am -3
lerna ERR! execute .git/rebase-apply/patch:142: space before tab in indent.
lerna ERR! execute   	promise: ApiKeyApi.createKey(token)
lerna ERR! execute warning: 1 line adds whitespace errors.
lerna ERR! execute error: Failed to merge in the changes.
lerna ERR! execute Applying: Wrk in progress... Able to call external APIs to get tokens, but not really hooked up to auth0.
lerna ERR! execute Using index info to reconstruct a base tree...
lerna ERR! execute M	projects/demo-app/src/routes/index.js
lerna ERR! execute Falling back to patching base and 3-way merge...
lerna ERR! execute Auto-merging projects/demo-app/src/routes/index.js
lerna ERR! execute CONFLICT (content): Merge conflict in projects/demo-app/src/routes/index.js
lerna ERR! execute Patch failed at 0001 Wrk in progress... Able to call external APIs to get tokens, but not really hooked up to auth0.
lerna ERR! execute The copy of the patch that failed is found in: .git/rebase-apply/patch
lerna ERR! execute When you have resolved this problem, run "git am --continue".
lerna ERR! execute If you prefer to skip this patch, run "git am --skip" instead.
lerna ERR! execute To restore the original branch and stop patching, run "git am --abort".
lerna ERR! execute 
lerna ERR! execute Rolling back to previous HEAD (commit 879cfa3947637f92fefd0c80917f3315236c374b).
0reactions
lock[bot]commented, Apr 3, 2019

This thread has been automatically locked because there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Read more comments on GitHub >

github_iconTop Results From Across the Web

git - What does "1 line adds whitespace errors" mean when ...
I'm editing some markdown files of a cloned remote repository, and wanted to test creating and applying patches from one branch to another....
Read more >
After a failed space import, it's not possible to re-import ...
Problem. After a space import times out fails, or the space information becomes corrupted in the database, the space and content cannot be ......
Read more >
Import delimited gets leading spaces wrong - Statalist
I am using -import delimited- to import a file with whitespace separating values. As far as I can tell, any leading whitespace is ......
Read more >
trailing-whitespace / C0303 - Pylint 2.16.0-dev documentation
Used when there is whitespace between the end of a line and the newline. Problematic code: print("Hello") # [trailing-whitespace] # ^^^ trailing whitespaces....
Read more >
<Error>: Spaces are not allowed in a name… LM_44127
LM_44127 : Failed to prepare the task” when importing and running a ... These errors occur when the column names in the Excel...
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