codecov / codecov-exe

.exe report uploader for Codecov https://codecov.io
MIT License
25 stars 21 forks source link

[Fatal] Illegal characters in path. #28

Closed leonard-thieu closed 6 years ago

leonard-thieu commented 7 years ago

I get the following error when building on AppVeyor:

codecov --file results.xml
              _____          _
             / ____|        | |
            | |     ___   __| | ___  ___ _____   __
            | |    / _ \ / _  |/ _ \/ __/ _ \ \ / /
            | |___| (_) | (_| |  __/ (_| (_) \ V /
             \_____\___/ \____|\___|\___\___/ \_/
                                         exe-1.0.1

2017-08-18 12:40:35 [Information] AppVeyor detected.
2017-08-18 12:40:35 [Information] Git detected.
2017-08-18 12:40:35 [Information] Project root: C:\projects\toofz-necrodancer-leaderboards
2017-08-18 12:40:35 [Fatal] Illegal characters in path.
   at System.IO.PathHelper.Normalize(String path, Boolean checkInvalidCharacters, Boolean expandShortPaths)
   at System.IO.Path.GetFullPath(String path)
   at Codecov.Utilities.FileSystem.NormalizedPath(String path) in C:\Users\Administrator\github\codecov-exe\Source\Codecov\Utilities\FileSystem.cs:line 15
   at System.Linq.Enumerable.<>c__DisplayClass151_0`3.<CombineSelectors>b__0(TSource x)
   at System.Linq.Enumerable.SelectArrayIterator`2.MoveNext()
   at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable`1 source, Func`2 predicate)
   at Codecov.Yaml.Yaml.LoadFileName() in C:\Users\Administrator\github\codecov-exe\Source\Codecov\Yaml\Yaml.cs:line 23
   at System.Lazy`1.CreateValue()
   at System.Lazy`1.LazyInitValue()
   at Codecov.Program.UploadFacade.Uploader() in C:\Users\Administrator\github\codecov-exe\Source\Codecov\Program\UploadFacade.cs:line 93
   at Codecov.Program.Run.Runner(IEnumerable`1 args) in C:\Users\Administrator\github\codecov-exe\Source\Codecov\Program\Run.cs:line 20

Full build log: https://ci.appveyor.com/project/leonard-thieu/toofz-necrodancer-leaderboards/build/3.0.8.46

I'm not sure I understand why this is happening. I have another project set up fairly similarly without an issues.

larzw commented 7 years ago

Thanks @leonard-thieu for reporting this...I'll take a peek... As a quick fix you may want to try a project root path C:\projects\toofz-necrodancer-leaderboards that does not have any special characters like dash...that MAY fix the error.

larzw commented 7 years ago

and maybe try upgrading to a new codecov-exe version? That may work too

leonard-thieu commented 7 years ago

I didn't try a project root without a dash, however, I've had it work in a different project that has a dash.

codecov --file results.xml
              _____          _
             / ____|        | |
            | |     ___   __| | ___  ___ _____   __
            | |    / _ \ / _  |/ _ \/ __/ _ \ \ / /
            | |___| (_) | (_| |  __/ (_| (_) \ V /
             \_____\___/ \____|\___|\___\___/ \_/
                                         exe-1.0.1

2017-08-18 10:14:57 [Information] AppVeyor detected.
2017-08-18 10:14:58 [Information] Git detected.
2017-08-18 10:14:58 [Information] Project root: C:\projects\toofz-necrodancer-core
2017-08-18 10:14:58 [Information] Yaml not found, that's ok! Learn more at http://docs.codecov.io/docs/codecov-yaml
2017-08-18 10:14:58 [Information] Reading reports.
2017-08-18 10:14:58 [Information] results.xml
2017-08-18 10:14:58 [Information] Uploading Reports.
2017-08-18 10:14:58 [Information] url: https://codecov.io
2017-08-18 10:14:58 [Information] query: https://codecov.io/upload/v4?branch=codecov&commit=28eec5e6b058ac7288a2160ff309117375c1cc8d&build=4a3ae9ubl12nofbr&tag=&pr=&name=&flags=&slug=leonard-thieu%2Ftoofz-necrodancer-core&token=&package=exe-1.0.1&build_url=&yaml=&job=leonard-thieu%2Ftoofz-necrodancer-core%2F2.1.1.50&service=appveyor
2017-08-18 10:14:58 [Information] Pinging Codecov
2017-08-18 10:15:00 [Information] Uploading to S3 https://codecov.s3.amazonaws.com
2017-08-18 10:15:00 [Information] View reports at: https://codecov.io/github/leonard-thieu/toofz-necrodancer-core/commit/28eec5e6b058ac7288a2160ff309117375c1cc8d

I've also tried with the latest version but still get the same error.

codecov --file results.xml
              _____          _
             / ____|        | |
            | |     ___   __| | ___  ___ _____   __
            | |    / _ \ / _  |/ _ \/ __/ _ \ \ / /
            | |___| (_) | (_| |  __/ (_| (_) \ V /
             \_____\___/ \____|\___|\___\___/ \_/
                                         exe-1.0.3

2017-08-18 16:00:10 [Information] AppVeyor detected.
2017-08-18 16:00:10 [Information] Git detected.
2017-08-18 16:00:10 [Information] Project root: C:\projects\toofz-necrodancer-leaderboards
2017-08-18 16:00:10 [Fatal] Illegal characters in path.
   at System.IO.PathHelper.Normalize(String path, Boolean checkInvalidCharacters, Boolean expandShortPaths)
   at System.IO.Path.GetFullPath(String path)
   at Codecov.Utilities.FileSystem.NormalizedPath(String path) in C:\Users\larz\github\codecov-exe\Source\Codecov\Utilities\FileSystem.cs:line 15
   at System.Linq.Enumerable.<>c__DisplayClass151_0`3.<CombineSelectors>b__0(TSource x)
   at System.Linq.Enumerable.SelectArrayIterator`2.MoveNext()
   at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable`1 source, Func`2 predicate)
   at Codecov.Yaml.Yaml.LoadFileName() in C:\Users\larz\github\codecov-exe\Source\Codecov\Yaml\Yaml.cs:line 23
   at System.Lazy`1.CreateValue()
   at System.Lazy`1.LazyInitValue()
   at Codecov.Program.UploadFacade.Uploader() in C:\Users\larz\github\codecov-exe\Source\Codecov\Program\UploadFacade.cs:line 93
   at Codecov.Program.Run.Runner(IEnumerable`1 args) in C:\Users\larz\github\codecov-exe\Source\Codecov\Program\Run.cs:line 20
larzw commented 7 years ago

@leonard-thieu,

Thanks for trying it out! I'll try to get around to looking at it on Sunday.

leonard-thieu commented 6 years ago

I can workaround the issue by adding an empty codecov.yaml file to the project root. However, that introduces another error:

              _____          _
             / ____|        | |
            | |     ___   __| | ___  ___ _____   __
            | |    / _ \ / _  |/ _ \/ __/ _ \ \ / /
            | |___| (_) | (_| |  __/ (_| (_) \ V /
             \_____\___/ \____|\___|\___\___/ \_/
                                         exe-1.0.3

2017-09-19 13:05:19 [Information] AppVeyor detected.
2017-09-19 13:05:20 [Information] Git detected.
2017-09-19 13:05:20 [Information] Project root: C:\projects\toofz-necrodancer-leaderboards-entityframework
2017-09-19 13:05:20 [Information] Reading reports.
2017-09-19 13:05:20 [Fatal] No Report detected.
   at Codecov.Coverage.Tool.Coverage.LoadReportFile() in C:\Users\larz\github\codecov-exe\Source\Codecov\Coverage\Tool\Coverage.cs:line 29
   at System.Lazy`1.CreateValue()
   at System.Lazy`1.LazyInitValue()
   at Codecov.Program.UploadFacade.Uploader() in C:\Users\larz\github\codecov-exe\Source\Codecov\Program\UploadFacade.cs:line 99
   at Codecov.Program.Run.Runner(IEnumerable`1 args) in C:\Users\larz\github\codecov-exe\Source\Codecov\Program\Run.cs:line 20
larzw commented 6 years ago

@leonard-thieu,

Thanks, sorry I have not gotten a change to look at it yet. I'll try and get around to it soon.

larzw commented 6 years ago

@leonard-thieu

Are you in a position to do a PR for this?

leonard-thieu commented 6 years ago

Not really. I don't understand what's causing the issues.

larzw commented 6 years ago

@leonard-thieu,

Unfortunately I'm not able to re-create it...Can you setup a simple repository that re-creates it..Then I can clone it and take a peek...Thanks!

leonard-thieu commented 6 years ago

I haven't been able to reproduce it locally, only on AppVeyor. This is the repository that's affected https://github.com/leonard-thieu/toofz-leaderboards-core-data

leonard-thieu commented 6 years ago

I think you may have cloned the wrong repo.

larzw commented 6 years ago

@leonard-thieu,

I see the problem, in codecov-exe I run the command:

git ls-tree --full-tree -r HEAD --name-only

this returns a list of files in your git repository (ignoring certain files specified in the .gitignore). This is very similar to how codecov bash does it

git ls-files

and it produces the same output that mine does.

However, for some reason this command produces

"toofz.NecroDancer.Leaderboards.Data/Migrations/201707172139340_LimeZinc\357\273\277AfghanHound.Designer.cs"
"toofz.NecroDancer.Leaderboards.Data/Migrations/201707172139340_LimeZinc\357\273\277AfghanHound.cs"
"toofz.NecroDancer.Leaderboards.Data/Migrations/201707172139340_LimeZinc\357\273\277AfghanHound.resx"

when in fact this command should have returned

"toofz.NecroDancer.Leaderboards.Data/Migrations/201707172139340_LimeZincAfghanHound.Designer.cs"
"toofz.NecroDancer.Leaderboards.Data/Migrations/201707172139340_LimeZincAfghanHound.cs"
"toofz.NecroDancer.Leaderboards.Data/Migrations/201707172139340_LimeZincAfghanHound.resx"

notice the extra \357\273\277 that was added to the path.

so there is something strange with those files and how git it returning a path. I don't think it's something wrong with the uploader.

If it were me I would mess with those files and run the command git ls-tree --full-tree -r HEAD --name-only. When the output shows the correct path, the uploader will work...Sorry I don't have a better solution for you and that this took so long to get resolved 😄 . Let me know if there is anything else I can do to help!

leonard-thieu commented 6 years ago

I'm not sure how a BOM got into the file name but removing it does resolve the issue. Thanks for figuring this out!