Closed mfkl closed 5 years ago
Thanks - it looks like the result message being returned is failing to deserialize. That explains why the site is still published - if it's just the response that's not in the expected format than the site has already been pushed. My guess is that Netlify recently changed their JSON contract and NetlifySharp needs to adapt.
@mfkl Strange, I've just tried to reproduce it but failed. Could it possibly be an incompatible version of Newtonsoft.JSON
package? Perhaps, if you include it as #addin
explicitly and Cake pulls incorrect version... Just a thought. Besides, the current version of Netlify open API was released back in April, so it's unlikely to be a changed JSON contract, right?
so it's unlikely to be a changed JSON contract, right?
Probably right. And you could be on to something with different versions of Newtonsoft. I'm going to be updating NetlifySharp soon(ish) for integration directly into Statiq so I'll probably up the version or switch to in-the-box JSON serialization.
Anyway, I'm glad you're back up and running. I'll close the issue but feel free to reopen or open a new one if it looks like it's breaking again.
Whops - just noticed the comment was from a different user! Thanks @yansklyarenko for trying to do a repro, I was also unable to reproduce so that checks out.
@mfkl Are you still getting failures? If so (and it wasn't something temporarily wrong with their API), I'll keep digging. Any indication a Newtonsoft version difference might be part of it as @yansklyarenko suggested?
Hey,
Yep, still hitting this.
My CI looks like
dotnet tool install -g Cake.Tool
dotnet cake build.cake --target=Publish-Site
I don't use JSON yet in my Wyam script, just
#n Wyam.Yaml
#n Wyam.Markdown
#n Wyam.Razor
My config.wyam.packages.xml
looks like this (and does contain a Newtonsoft reference)
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Wyam.Yaml" version="2.1.2" targetFramework="netcoreapp2.1">
<package id="YamlDotNet" version="4.3.1" targetFramework="netcoreapp2.1" />
</package>
<package id="Wyam.Markdown" version="2.1.2" targetFramework="netcoreapp2.1">
<package id="Markdig" version="0.15.4" targetFramework="netcoreapp2.1" />
</package>
<package id="Wyam.Razor" version="2.1.2" targetFramework="netcoreapp2.1">
<package id="Microsoft.AspNetCore.Cryptography.Internal" version="2.1.1" targetFramework="netcoreapp2.1" />
<package id="Microsoft.AspNetCore.DataProtection.Abstractions" version="2.1.1" targetFramework="netcoreapp2.1" />
<package id="Microsoft.AspNetCore.Diagnostics.Abstractions" version="2.1.1" targetFramework="netcoreapp2.1" />
<package id="Microsoft.AspNetCore.Razor.Language" version="2.1.1" targetFramework="netcoreapp2.1" />
<package id="Microsoft.CodeAnalysis.Analyzers" version="1.1.0" targetFramework="netcoreapp2.1" />
<package id="Microsoft.CSharp" version="4.5.0" targetFramework="netcoreapp2.1" />
<package id="Microsoft.DiaSymReader.Native" version="1.7.0" targetFramework="netcoreapp2.1" />
<package id="Microsoft.Extensions.DependencyInjection.Abstractions" version="2.1.1" targetFramework="netcoreapp2.1" />
<package id="Microsoft.Extensions.DependencyInjection" version="2.1.1" targetFramework="netcoreapp2.1" />
<package id="Microsoft.Extensions.FileSystemGlobbing" version="2.1.1" targetFramework="netcoreapp2.1" />
<package id="Microsoft.Extensions.Localization.Abstractions" version="2.1.1" targetFramework="netcoreapp2.1" />
<package id="Microsoft.Extensions.Logging.Abstractions" version="2.1.1" targetFramework="netcoreapp2.1" />
<package id="Microsoft.Extensions.ObjectPool" version="2.1.1" targetFramework="netcoreapp2.1" />
<package id="Newtonsoft.Json" version="11.0.2" targetFramework="netcoreapp2.1" />
<package id="Microsoft.AspNetCore.JsonPatch" version="2.1.1" targetFramework="netcoreapp2.1" />
<package id="Newtonsoft.Json.Bson" version="1.0.1" targetFramework="netcoreapp2.1" />
<package id="System.AppContext" version="4.3.0" targetFramework="netcoreapp2.1" />
<package id="System.Buffers" version="4.5.0" targetFramework="netcoreapp2.1" />
<package id="System.Collections" version="4.3.0" targetFramework="netcoreapp2.1" />
<package id="System.Collections.Concurrent" version="4.3.0" targetFramework="netcoreapp2.1" />
<package id="System.Collections.Immutable" version="1.3.1" targetFramework="netcoreapp2.1" />
<package id="System.ComponentModel.Annotations" version="4.5.0" targetFramework="netcoreapp2.1" />
<package id="System.Console" version="4.3.0" targetFramework="netcoreapp2.1" />
<package id="System.Diagnostics.Debug" version="4.3.0" targetFramework="netcoreapp2.1" />
<package id="System.Diagnostics.DiagnosticSource" version="4.5.1" targetFramework="netcoreapp2.1" />
<package id="System.Diagnostics.FileVersionInfo" version="4.3.0" targetFramework="netcoreapp2.1" />
<package id="System.Diagnostics.StackTrace" version="4.3.0" targetFramework="netcoreapp2.1" />
<package id="System.Diagnostics.Tools" version="4.3.0" targetFramework="netcoreapp2.1" />
<package id="System.Dynamic.Runtime" version="4.3.0" targetFramework="netcoreapp2.1" />
<package id="System.Globalization" version="4.3.0" targetFramework="netcoreapp2.1" />
<package id="System.IO" version="4.3.0" targetFramework="netcoreapp2.1" />
<package id="System.IO.Compression" version="4.3.0" targetFramework="netcoreapp2.1" />
<package id="System.IO.FileSystem.Primitives" version="4.3.0" targetFramework="netcoreapp2.1" />
<package id="System.IO.FileSystem" version="4.3.0" targetFramework="netcoreapp2.1" />
<package id="System.Linq" version="4.3.0" targetFramework="netcoreapp2.1" />
<package id="System.Linq.Expressions" version="4.3.0" targetFramework="netcoreapp2.1" />
<package id="System.Numerics.Vectors" version="4.4.0" targetFramework="netcoreapp2.1" />
<package id="System.Reflection" version="4.3.0" targetFramework="netcoreapp2.1" />
<package id="System.Reflection.Metadata" version="1.4.2" targetFramework="netcoreapp2.1" />
<package id="System.Resources.ResourceManager" version="4.3.0" targetFramework="netcoreapp2.1" />
<package id="System.Runtime" version="4.3.0" targetFramework="netcoreapp2.1" />
<package id="System.Runtime.CompilerServices.Unsafe" version="4.5.1" targetFramework="netcoreapp2.1" />
<package id="System.Memory" version="4.5.1" targetFramework="netcoreapp2.1" />
<package id="Microsoft.Extensions.Primitives" version="2.1.1" targetFramework="netcoreapp2.1" />
<package id="Microsoft.AspNetCore.Http.Features" version="2.1.1" targetFramework="netcoreapp2.1" />
<package id="Microsoft.AspNetCore.ResponseCaching.Abstractions" version="2.1.1" targetFramework="netcoreapp2.1" />
<package id="Microsoft.Extensions.Caching.Abstractions" version="2.1.1" targetFramework="netcoreapp2.1" />
<package id="Microsoft.Extensions.Configuration.Abstractions" version="2.1.1" targetFramework="netcoreapp2.1" />
<package id="Microsoft.AspNetCore.Hosting.Server.Abstractions" version="2.1.1" targetFramework="netcoreapp2.1" />
<package id="Microsoft.Extensions.FileProviders.Abstractions" version="2.1.1" targetFramework="netcoreapp2.1" />
<package id="Microsoft.Extensions.FileProviders.Composite" version="2.1.1" targetFramework="netcoreapp2.1" />
<package id="Microsoft.Extensions.FileProviders.Physical" version="2.1.1" targetFramework="netcoreapp2.1" />
<package id="Microsoft.Extensions.Hosting.Abstractions" version="2.1.1" targetFramework="netcoreapp2.1" />
<package id="Microsoft.Extensions.Options" version="2.1.1" targetFramework="netcoreapp2.1" />
<package id="Microsoft.AspNetCore.Authorization" version="2.1.1" targetFramework="netcoreapp2.1" />
<package id="Microsoft.Extensions.Caching.Memory" version="2.1.1" targetFramework="netcoreapp2.1" />
<package id="Microsoft.Extensions.Localization" version="2.1.1" targetFramework="netcoreapp2.1" />
<package id="Microsoft.Net.Http.Headers" version="2.1.1" targetFramework="netcoreapp2.1" />
<package id="System.Runtime.Extensions" version="4.3.0" targetFramework="netcoreapp2.1" />
<package id="System.Runtime.InteropServices" version="4.3.0" targetFramework="netcoreapp2.1" />
<package id="System.Runtime.InteropServices.RuntimeInformation" version="4.3.0" targetFramework="netcoreapp2.1" />
<package id="Microsoft.DotNet.PlatformAbstractions" version="2.1.0" targetFramework="netcoreapp2.1" />
<package id="Microsoft.Extensions.DependencyModel" version="2.1.0" targetFramework="netcoreapp2.1" />
<package id="System.Runtime.Numerics" version="4.3.0" targetFramework="netcoreapp2.1" />
<package id="System.Security.Cryptography.Encoding" version="4.3.0" targetFramework="netcoreapp2.1" />
<package id="System.Security.Cryptography.Primitives" version="4.3.0" targetFramework="netcoreapp2.1" />
<package id="System.Security.Cryptography.Algorithms" version="4.3.0" targetFramework="netcoreapp2.1" />
<package id="System.Security.Cryptography.X509Certificates" version="4.3.0" targetFramework="netcoreapp2.1" />
<package id="System.Security.Principal.Windows" version="4.5.0" targetFramework="netcoreapp2.1" />
<package id="System.Security.AccessControl" version="4.5.0" targetFramework="netcoreapp2.1" />
<package id="Microsoft.Win32.Registry" version="4.5.0" targetFramework="netcoreapp2.1" />
<package id="System.Security.Permissions" version="4.5.0" targetFramework="netcoreapp2.1" />
<package id="System.Security.Cryptography.Xml" version="4.5.0" targetFramework="netcoreapp2.1" />
<package id="System.Text.Encoding" version="4.3.0" targetFramework="netcoreapp2.1" />
<package id="System.Text.Encoding.CodePages" version="4.3.0" targetFramework="netcoreapp2.1" />
<package id="System.Text.Encoding.Extensions" version="4.3.0" targetFramework="netcoreapp2.1" />
<package id="System.Text.Encodings.Web" version="4.5.0" targetFramework="netcoreapp2.1" />
<package id="Microsoft.AspNetCore.Html.Abstractions" version="2.1.1" targetFramework="netcoreapp2.1" />
<package id="Microsoft.AspNetCore.Http.Abstractions" version="2.1.1" targetFramework="netcoreapp2.1" />
<package id="Microsoft.AspNetCore.Authentication.Abstractions" version="2.1.1" targetFramework="netcoreapp2.1" />
<package id="Microsoft.AspNetCore.Authorization.Policy" version="2.1.1" targetFramework="netcoreapp2.1" />
<package id="Microsoft.AspNetCore.Hosting.Abstractions" version="2.1.1" targetFramework="netcoreapp2.1" />
<package id="Microsoft.AspNetCore.DataProtection" version="2.1.1" targetFramework="netcoreapp2.1" />
<package id="Microsoft.AspNetCore.Http.Extensions" version="2.1.1" targetFramework="netcoreapp2.1" />
<package id="Microsoft.AspNetCore.Razor" version="2.1.1" targetFramework="netcoreapp2.1" />
<package id="Microsoft.AspNetCore.Razor.Runtime" version="2.1.1" targetFramework="netcoreapp2.1" />
<package id="Microsoft.AspNetCore.Routing.Abstractions" version="2.1.1" targetFramework="netcoreapp2.1" />
<package id="Microsoft.AspNetCore.Mvc.Abstractions" version="2.1.3" targetFramework="netcoreapp2.1" />
<package id="Microsoft.AspNetCore.Routing" version="2.1.1" targetFramework="netcoreapp2.1" />
<package id="Microsoft.AspNetCore.WebUtilities" version="2.1.1" targetFramework="netcoreapp2.1" />
<package id="Microsoft.AspNetCore.Antiforgery" version="2.1.1" targetFramework="netcoreapp2.1" />
<package id="Microsoft.AspNetCore.Http" version="2.1.1" targetFramework="netcoreapp2.1" />
<package id="Microsoft.AspNetCore.Authentication.Core" version="2.1.1" targetFramework="netcoreapp2.1" />
<package id="Microsoft.Extensions.WebEncoders" version="2.1.1" targetFramework="netcoreapp2.1" />
<package id="System.Threading" version="4.3.0" targetFramework="netcoreapp2.1" />
<package id="System.Threading.Tasks" version="4.3.0" targetFramework="netcoreapp2.1" />
<package id="System.Threading.Tasks.Extensions" version="4.5.1" targetFramework="netcoreapp2.1" />
<package id="Microsoft.AspNetCore.Mvc.Core" version="2.1.3" targetFramework="netcoreapp2.1" />
<package id="Microsoft.AspNetCore.Mvc.DataAnnotations" version="2.1.3" targetFramework="netcoreapp2.1" />
<package id="Microsoft.AspNetCore.Mvc.Formatters.Json" version="2.1.3" targetFramework="netcoreapp2.1" />
<package id="Microsoft.AspNetCore.Mvc.ViewFeatures" version="2.1.3" targetFramework="netcoreapp2.1" />
<package id="System.Threading.Tasks.Parallel" version="4.3.0" targetFramework="netcoreapp2.1" />
<package id="System.Threading.Thread" version="4.3.0" targetFramework="netcoreapp2.1" />
<package id="System.ValueTuple" version="4.3.0" targetFramework="netcoreapp2.1" />
<package id="System.Xml.ReaderWriter" version="4.3.0" targetFramework="netcoreapp2.1" />
<package id="System.Xml.XDocument" version="4.3.0" targetFramework="netcoreapp2.1" />
<package id="System.Xml.XmlDocument" version="4.3.0" targetFramework="netcoreapp2.1" />
<package id="System.Xml.XPath" version="4.3.0" targetFramework="netcoreapp2.1" />
<package id="System.Xml.XPath.XDocument" version="4.3.0" targetFramework="netcoreapp2.1" />
<package id="Microsoft.CodeAnalysis.Common" version="2.8.0" targetFramework="netcoreapp2.1" />
<package id="Microsoft.CodeAnalysis.CSharp" version="2.8.0" targetFramework="netcoreapp2.1" />
<package id="Microsoft.CodeAnalysis.Razor" version="2.1.1" targetFramework="netcoreapp2.1" />
<package id="Microsoft.AspNetCore.Mvc.Razor.Extensions" version="2.1.1" targetFramework="netcoreapp2.1" />
<package id="Microsoft.AspNetCore.Mvc.Razor" version="2.1.3" targetFramework="netcoreapp2.1" />
<package id="Microsoft.AspNetCore.Mvc.RazorPages" version="2.1.3" targetFramework="netcoreapp2.1" />
</package>
</packages>
@mfkl I still suspect there's something wrong with the versions being used.
When you install Cake like dotnet tool install -g Cake.Tool
, it pulls down the latest Cake, which is 0.35.0 at the moment. On the other hand, Wyam was modified to target Cake 0.33.0 only in version 2.2.5. However, your packages.xml
clearly indicates that you're using Wyam 2.1.2.
I have no idea where it goes wrong in your case, but I would try updating Wyam to something higher than 2.2.5 or pin the version of Cake to something older.
In my case, it's Cake v0.33.0 and Wyam v2.2.7, and it works just fine.
Thanks for your help @yansklyarenko, I'll try this and report back tomorrow.
For the record, the reason I was installing it this way was because of https://github.com/Wyamio/Wyam/issues/858
Ugh. Yeah, that NuGet bug in Wyam has been a pain. Since the last comment on that issue there's been a couple more patch releases to try and resolve it once and for all - latest Wyam is now 2.2.9.
With regard to NetlifySharp I'm likely going to port it to the new System.Text.Json
serialization soon if I can - that should eliminate any version clashes with Newtonsoft in Cake.
Looking forward, deployment is a core concept in Statiq. You'll be able to deploy a Statiq generated site to a number of static hosts (including Netlify) out of the box using the CLI. Something to look forward to :).
Well, no luck here, still hitting the nuget issues with cake 0.35.0 and wyam 2.2.9.
error CS0012: The type 'Stream' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.IO, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.
error CS0012: The type 'Task<>' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Threading.Tasks, Version=4.0.10.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.
I'll stick to my hacky workaround I guess. Thanks anyway.
Hello,
Opening this on GitHub as you said on Gitter.
The stack I get is
My cake script looks just like yours
The weird part is that while this blows up on the CI, the website seems to still be updated. Current workaround is just to add a try/catch but it seems fishy ^^