vapor / fluent-mysql-driver

🖋🐬 Swift ORM (queries, models, relations, etc) built on MySQL.
MIT License
76 stars 52 forks source link

error: extra argument 'requestTimeout' in call requestTimeout: self.connectionPoolTimeout, #197

Closed oprisk closed 4 years ago

oprisk commented 4 years ago

Invalid Call: /Users/paolo/mtgDEV/_Server/test/TestServer/myProject/.build/checkouts/fluent-mysql-driver/Sources/FluentMySQLDriver/FluentMySQLConfiguration.swift:130:34: error: extra argument 'requestTimeout' in call requestTimeout: self.connectionPoolTimeout,


[1588/1619] Compiling FluentMySQLDriver FluentMySQLDatabase.swift

-----------------
Package.swift:
// swift-tools-version:5.2
import PackageDescription

let package = Package(
    name: "myProject",
    platforms: [
       .macOS(.v10_15)
    ],
    dependencies: [
        // 💧 A server-side Swift web framework.
        .package(url: "https://github.com/vapor/vapor.git", from: "4.14.0"),
        .package(url: "https://github.com/vapor/leaf.git", from: "4.0.0-rc"),
        .package(url: "https://github.com/vapor/fluent.git", from: "4.0.0"),
        .package(url: "https://github.com/vapor/fluent-mysql-driver.git", from: "4.0.0")
    ],
    targets: [
        .target(name: "App", dependencies: [
            .product(name: "Leaf", package: "leaf"),
            .product(name: "Fluent", package: "fluent"),
            .product(name: "FluentMySQLDriver", package: "fluent-mysql-driver"),
            .product(name: "Vapor", package: "vapor"),
        ]),
        .target(name: "Run", dependencies: ["App"]),
        .testTarget(name: "AppTests", dependencies: [
            .target(name: "App"),
            .product(name: "XCTVapor", package: "vapor"),
        ])
    ]
)
0xTim commented 4 years ago

If you update to the latest package versions does this error go away?

oprisk commented 4 years ago

Sorry for the delay. I updated to version 4.0.0-rc and error went away: from: .package(url: "https://github.com/vapor/fluent-mysql-driver.git", from: "4.0.0") to: .package(url: "https://github.com/vapor/fluent-sqlite-driver.git", from: "4.0.0-rc")

Presumably, "-rc" is the latest beta?

0xTim commented 4 years ago

Are you switching to SQLite? There aren't any betas any more for the Fluent stuff so just 4.0.0 should work after a package update (swift package update from the command line)

oprisk commented 4 years ago

The issue is with MySQL driver, (disregard SQLite, it works just fine using "-rc" release, but not 4.0.0.)

I tested both MySQLdriver 4.0.0 and 4.0.0-rc, with the same error: /Users/paolo/_MtgDEV/_Server/MtgServer/.build/checkouts/fluent-mysql-driver/Sources/FluentMySQLDriver/FluentMySQLConfiguration.swift:130:34: error: extra argument 'requestTimeout' in call requestTimeout: self.connectionPoolTimeout,

I'm able to comment the extra parameter in the call, provided the project is opened via Xcode project, unable to change package opening the project in Xcode opening the package.swift (as they are dynamically linked packages)

0xTim commented 4 years ago

Can you provide your package.resolved?

oprisk commented 4 years ago

McBkPaolo.local /Users/paolo/_MtgDEV/_Server/MtgServer % swift package resolve Fetching https://github.com/apple/swift-nio.git Fetching https://github.com/vapor/fluent-sqlite-driver.git Fetching https://github.com/vapor/routing-kit.git Fetching https://github.com/apple/swift-nio-ssl.git Fetching https://github.com/apple/swift-metrics.git Fetching https://github.com/apple/swift-nio-extras.git Fetching https://github.com/apple/swift-log.git Fetching https://github.com/apple/swift-crypto.git Fetching https://github.com/vapor/leaf-kit.git Fetching https://github.com/vapor/fluent-kit.git Fetching https://github.com/vapor/sqlite-nio.git Fetching https://github.com/swift-server/swift-backtrace.git Fetching https://github.com/vapor/websocket-kit.git Fetching https://github.com/swift-server/async-http-client.git Fetching https://github.com/vapor/vapor.git Fetching https://github.com/vapor/async-kit.git Fetching https://github.com/vapor/console-kit.git Fetching https://github.com/vapor/fluent.git Fetching https://github.com/vapor/leaf.git Fetching https://github.com/apple/swift-nio-http2.git Fetching https://github.com/vapor/sql-kit.git Fetching https://github.com/vapor/sqlite-kit.git Fetching https://github.com/vapor/fluent-mysql-driver.git Fetching https://github.com/vapor/mysql-kit.git Fetching https://github.com/vapor/mysql-nio.git Cloning https://github.com/vapor/mysql-kit.git Resolving https://github.com/vapor/mysql-kit.git at 4.1.0 Cloning https://github.com/vapor/mysql-nio.git Resolving https://github.com/vapor/mysql-nio.git at 1.3.2 Cloning https://github.com/vapor/routing-kit.git Resolving https://github.com/vapor/routing-kit.git at 4.1.0 Cloning https://github.com/apple/swift-crypto.git Resolving https://github.com/apple/swift-crypto.git at 1.0.2 Cloning https://github.com/vapor/websocket-kit.git Resolving https://github.com/vapor/websocket-kit.git at 2.1.0 Cloning https://github.com/vapor/fluent-mysql-driver.git Resolving https://github.com/vapor/fluent-mysql-driver.git at 4.0.0-rc.2.2 Cloning https://github.com/apple/swift-nio-ssl.git Resolving https://github.com/apple/swift-nio-ssl.git at 2.7.5 Cloning https://github.com/vapor/console-kit.git Resolving https://github.com/vapor/console-kit.git at 4.1.1 Cloning https://github.com/vapor/fluent-kit.git Resolving https://github.com/vapor/fluent-kit.git at 1.0.2 Cloning https://github.com/swift-server/swift-backtrace.git Resolving https://github.com/swift-server/swift-backtrace.git at 1.2.0 Cloning https://github.com/vapor/vapor.git Resolving https://github.com/vapor/vapor.git at 4.14.0 Cloning https://github.com/apple/swift-nio-extras.git Resolving https://github.com/apple/swift-nio-extras.git at 1.5.1 Cloning https://github.com/apple/swift-log.git Resolving https://github.com/apple/swift-log.git at 1.2.0 Cloning https://github.com/vapor/leaf-kit.git Resolving https://github.com/vapor/leaf-kit.git at 1.0.0-rc.1.13 Cloning https://github.com/vapor/fluent.git Resolving https://github.com/vapor/fluent.git at 4.0.0 Cloning https://github.com/apple/swift-nio.git Resolving https://github.com/apple/swift-nio.git at 2.18.0 Cloning https://github.com/vapor/async-kit.git Resolving https://github.com/vapor/async-kit.git at 1.1.1 Cloning https://github.com/apple/swift-nio-http2.git Resolving https://github.com/apple/swift-nio-http2.git at 1.12.2 Cloning https://github.com/vapor/leaf.git Resolving https://github.com/vapor/leaf.git at 4.0.0-rc.1.3 Cloning https://github.com/apple/swift-metrics.git Resolving https://github.com/apple/swift-metrics.git at 2.0.0 Cloning https://github.com/swift-server/async-http-client.git Resolving https://github.com/swift-server/async-http-client.git at 1.1.1 Cloning https://github.com/vapor/sql-kit.git Resolving https://github.com/vapor/sql-kit.git at 3.5.0 McBkPaolo.local /Users/paolo/_MtgDEV/_Server/MtgServer % swift build
zsh: correct 'build' to '.build' [nyae]? n /Users/paolo/_MtgDEV/_Server/MtgServer/.build/checkouts/swift-crypto/Sources/Crypto/Util/BoringSSL/ArbitraryPrecisionInteger_boring.swift:196:13: warning: variable 'bnCtx' was never mutated; consider changing to 'let' constant var bnCtx = CCryptoBoringSSL_BN_CTX_new()!


        let
/Users/paolo/_MtgDEV/_Server/MtgServer/.build/checkouts/swift-crypto/Sources/Crypto/Util/BoringSSL/ArbitraryPrecisionInteger_boring.swift:196:13: warning: variable 'bnCtx' was never mutated; consider changing to 'let' constant
        var bnCtx = CCryptoBoringSSL_BN_CTX_new()!
        ~~~ ^
        let
/Users/paolo/_MtgDEV/_Server/MtgServer/.build/checkouts/swift-crypto/Sources/Crypto/Util/BoringSSL/ArbitraryPrecisionInteger_boring.swift:196:13: warning: variable 'bnCtx' was never mutated; consider changing to 'let' constant
        var bnCtx = CCryptoBoringSSL_BN_CTX_new()!
        ~~~ ^
        let
/Users/paolo/_MtgDEV/_Server/MtgServer/.build/checkouts/swift-crypto/Sources/Crypto/Util/BoringSSL/ArbitraryPrecisionInteger_boring.swift:196:13: warning: variable 'bnCtx' was never mutated; consider changing to 'let' constant
        var bnCtx = CCryptoBoringSSL_BN_CTX_new()!
        ~~~ ^
        let
/Users/paolo/_MtgDEV/_Server/MtgServer/.build/checkouts/swift-crypto/Sources/Crypto/Util/BoringSSL/ArbitraryPrecisionInteger_boring.swift:196:13: warning: variable 'bnCtx' was never mutated; consider changing to 'let' constant
        var bnCtx = CCryptoBoringSSL_BN_CTX_new()!
        ~~~ ^
        let
/Users/paolo/_MtgDEV/_Server/MtgServer/.build/checkouts/swift-crypto/Sources/Crypto/Util/BoringSSL/ArbitraryPrecisionInteger_boring.swift:196:13: warning: variable 'bnCtx' was never mutated; consider changing to 'let' constant
        var bnCtx = CCryptoBoringSSL_BN_CTX_new()!
        ~~~ ^
        let
/Users/paolo/_MtgDEV/_Server/MtgServer/.build/checkouts/fluent-mysql-driver/Sources/FluentMySQLDriver/FluentMySQLConfiguration.swift:130:34: error: extra argument 'requestTimeout' in call
            requestTimeout: self.connectionPoolTimeout,
                            ~~~~~^~~~~~~~~~~~~~~~~~~~~
/Users/paolo/_MtgDEV/_Server/MtgServer/.build/checkouts/fluent-mysql-driver/Sources/FluentMySQLDriver/FluentMySQLConfiguration.swift:130:34: error: extra argument 'requestTimeout' in call
            requestTimeout: self.connectionPoolTimeout,
                            ~~~~~^~~~~~~~~~~~~~~~~~~~~
[1524/1617] Compiling FluentMySQLDriver FluentMySQLDatabase.swift
oprisk commented 4 years ago

disregard, out of sync with Xcode compile, re-running again

0xTim commented 4 years ago

Run swift package update - you're pulling in an old version of Fluent MySQL Driver, you want 4.0.0 https://github.com/vapor/fluent-mysql-driver/releases/tag/4.0.0

oprisk commented 4 years ago

I ran swift package reset, swift package resolve, swift build I will redo with swift package update

oprisk commented 4 years ago

without package update:

McBkPaolo.local /Users/paolo/_MtgDEV/_Server/MtgServer % swift package reset
McBkPaolo.local /Users/paolo/_MtgDEV/_Server/MtgServer % swift package resolve Fetching https://github.com/vapor/leaf.git Fetching https://github.com/vapor/vapor.git Fetching https://github.com/apple/swift-nio-ssl.git Fetching https://github.com/apple/swift-metrics.git Fetching https://github.com/apple/swift-nio-http2.git Fetching https://github.com/vapor/leaf-kit.git Fetching https://github.com/vapor/fluent-mysql-driver.git Fetching https://github.com/vapor/mysql-kit.git Fetching https://github.com/vapor/console-kit.git Fetching https://github.com/vapor/mysql-nio.git Fetching https://github.com/vapor/sql-kit.git Fetching https://github.com/vapor/fluent.git Fetching https://github.com/apple/swift-crypto.git Fetching https://github.com/swift-server/swift-backtrace.git Fetching https://github.com/apple/swift-log.git Fetching https://github.com/vapor/websocket-kit.git Fetching https://github.com/apple/swift-nio.git Fetching https://github.com/vapor/routing-kit.git Fetching https://github.com/apple/swift-nio-extras.git Fetching https://github.com/vapor/async-kit.git Fetching https://github.com/swift-server/async-http-client.git Fetching https://github.com/vapor/fluent-kit.git Cloning https://github.com/swift-server/async-http-client.git Resolving https://github.com/swift-server/async-http-client.git at 1.1.1 Cloning https://github.com/vapor/leaf.git Resolving https://github.com/vapor/leaf.git at 4.0.0-rc.1.3 Cloning https://github.com/apple/swift-crypto.git Resolving https://github.com/apple/swift-crypto.git at 1.0.2 Cloning https://github.com/vapor/console-kit.git Resolving https://github.com/vapor/console-kit.git at 4.1.1 Cloning https://github.com/vapor/sql-kit.git Resolving https://github.com/vapor/sql-kit.git at 3.5.0 Cloning https://github.com/vapor/fluent.git Resolving https://github.com/vapor/fluent.git at 4.0.0 Cloning https://github.com/vapor/mysql-nio.git Resolving https://github.com/vapor/mysql-nio.git at 1.3.2 Cloning https://github.com/apple/swift-nio-extras.git Resolving https://github.com/apple/swift-nio-extras.git at 1.5.1 Cloning https://github.com/vapor/vapor.git Resolving https://github.com/vapor/vapor.git at 4.14.0 Cloning https://github.com/apple/swift-nio.git Resolving https://github.com/apple/swift-nio.git at 2.18.0 Cloning https://github.com/vapor/websocket-kit.git Resolving https://github.com/vapor/websocket-kit.git at 2.1.0 Cloning https://github.com/vapor/routing-kit.git Resolving https://github.com/vapor/routing-kit.git at 4.1.0 Cloning https://github.com/apple/swift-metrics.git Resolving https://github.com/apple/swift-metrics.git at 2.0.0 Cloning https://github.com/swift-server/swift-backtrace.git Resolving https://github.com/swift-server/swift-backtrace.git at 1.2.0 Cloning https://github.com/vapor/leaf-kit.git Resolving https://github.com/vapor/leaf-kit.git at 1.0.0-rc.1.13 Cloning https://github.com/vapor/fluent-mysql-driver.git Resolving https://github.com/vapor/fluent-mysql-driver.git at 4.0.0 Cloning https://github.com/vapor/mysql-kit.git Resolving https://github.com/vapor/mysql-kit.git at 4.1.0 Cloning https://github.com/vapor/async-kit.git Resolving https://github.com/vapor/async-kit.git at 1.1.1 Cloning https://github.com/vapor/fluent-kit.git Resolving https://github.com/vapor/fluent-kit.git at 1.7.3 Cloning https://github.com/apple/swift-nio-ssl.git Resolving https://github.com/apple/swift-nio-ssl.git at 2.7.5 Cloning https://github.com/apple/swift-nio-http2.git Resolving https://github.com/apple/swift-nio-http2.git at 1.12.2 Cloning https://github.com/apple/swift-log.git Resolving https://github.com/apple/swift-log.git at 1.2.0 McBkPaolo.local /Users/paolo/_MtgDEV/_Server/MtgServer % swift build zsh: correct 'build' to '.build' [nyae]? n /Users/paolo/_MtgDEV/_Server/MtgServer/.build/checkouts/swift-crypto/Sources/Crypto/Util/BoringSSL/ArbitraryPrecisionInteger_boring.swift:196:13: warning: variable 'bnCtx' was never mutated; consider changing to 'let' constant var bnCtx = CCryptoBoringSSL_BN_CTX_new()!


        let
/Users/paolo/_MtgDEV/_Server/MtgServer/.build/checkouts/swift-crypto/Sources/Crypto/Util/BoringSSL/ArbitraryPrecisionInteger_boring.swift:196:13: warning: variable 'bnCtx' was never mutated; consider changing to 'let' constant
        var bnCtx = CCryptoBoringSSL_BN_CTX_new()!
        ~~~ ^
        let
/Users/paolo/_MtgDEV/_Server/MtgServer/.build/checkouts/swift-crypto/Sources/Crypto/Util/BoringSSL/ArbitraryPrecisionInteger_boring.swift:196:13: warning: variable 'bnCtx' was never mutated; consider changing to 'let' constant
        var bnCtx = CCryptoBoringSSL_BN_CTX_new()!
        ~~~ ^
        let
/Users/paolo/_MtgDEV/_Server/MtgServer/.build/checkouts/swift-crypto/Sources/Crypto/Util/BoringSSL/ArbitraryPrecisionInteger_boring.swift:196:13: warning: variable 'bnCtx' was never mutated; consider changing to 'let' constant
        var bnCtx = CCryptoBoringSSL_BN_CTX_new()!
        ~~~ ^
        let
/Users/paolo/_MtgDEV/_Server/MtgServer/.build/checkouts/swift-crypto/Sources/Crypto/Util/BoringSSL/ArbitraryPrecisionInteger_boring.swift:196:13: warning: variable 'bnCtx' was never mutated; consider changing to 'let' constant
        var bnCtx = CCryptoBoringSSL_BN_CTX_new()!
        ~~~ ^
        let
/Users/paolo/_MtgDEV/_Server/MtgServer/.build/checkouts/swift-crypto/Sources/Crypto/Util/BoringSSL/ArbitraryPrecisionInteger_boring.swift:196:13: warning: variable 'bnCtx' was never mutated; consider changing to 'let' constant
        var bnCtx = CCryptoBoringSSL_BN_CTX_new()!
        ~~~ ^
        let
/Users/paolo/_MtgDEV/_Server/MtgServer/.build/checkouts/fluent-mysql-driver/Sources/FluentMySQLDriver/FluentMySQLConfiguration.swift:130:34: error: extra argument 'requestTimeout' in call
            requestTimeout: self.connectionPoolTimeout,
                            ~~~~~^~~~~~~~~~~~~~~~~~~~~
/Users/paolo/_MtgDEV/_Server/MtgServer/.build/checkouts/fluent-mysql-driver/Sources/FluentMySQLDriver/FluentMySQLConfiguration.swift:130:34: error: extra argument 'requestTimeout' in call
            requestTimeout: self.connectionPoolTimeout,
                            ~~~~~^~~~~~~~~~~~~~~~~~~~~
[1549/1619] Compiling Vapor JSONCoder+Custom.swift
McBkPaolo.local /Users/paolo/_MtgDEV/_Server/MtgServer % 
oprisk commented 4 years ago

The swift package update compiles correctly, without error Not sure what originally caused the issue, instance of package manager bug?

oprisk commented 4 years ago

this is the package.swift:

// swift-tools-version:5.2 import PackageDescription

let package = Package( name: "MtgServer", platforms: [ .macOS(.v10_15) ], dependencies: [ // 💧 A server-side Swift web framework. .package(url: "https://github.com/vapor/vapor.git", from: "4.14.0"), .package(url: "https://github.com/vapor/leaf.git", from: "4.0.0-rc"), .package(url: "https://github.com/vapor/fluent.git", from: "4.0.0"), .package(url: "https://github.com/vapor/fluent-mysql-driver.git", from: "4.0.0") ], targets: [ .target(name: "App", dependencies: [ .product(name: "Leaf", package: "leaf"), .product(name: "Fluent", package: "fluent"), .product(name: "FluentMySQLDriver", package: "fluent-mysql-driver"), .product(name: "Vapor", package: "vapor"), ]), .target(name: "Run", dependencies: ["App"]), .testTarget(name: "AppTests", dependencies: [ .target(name: "App"), .product(name: "XCTVapor", package: "vapor"), ]) ] )

oprisk commented 4 years ago

Thank-you for the assistance

0xTim commented 4 years ago

The bug was caused by an update somewhere that FluentMySQL didn't specify when it should have done. Until you run a package update it will stick with the versions in the resolved file (which in your case were out of date). Glad it's working!

grundoon commented 4 years ago

I'm a little troubled by the fact that your swift-nio (thus swift-nio-ssl and swift-nio-http2 as well) are still months out of date.

oprisk commented 4 years ago

how can I force to pull the latest, if swift package update is not doing this?

grundoon commented 4 years ago

It really should be (and that's a problem) I think... but I'd try blowing away the build and DerivedData directories, and manually changing NIO to from: "2.23.0" in vapor/Package.swift.

oprisk commented 4 years ago

using MacBook, running on Big Sur latest beta deleted project build folder cleaned ~/Library/Developer/Xcode/DerivedData ran package reset, update

-- it did pull NIO 2.23.0, see below:

McBkPaolo.local /Users/paolo/_MtgDEV/_Server/MtgServer % swift package reset McBkPaolo.local /Users/paolo/_MtgDEV/_Server/MtgServer % swift package update Fetching https://github.com/vapor/fluent.git Fetching https://github.com/vapor/fluent-mysql-driver.git Fetching https://github.com/vapor/leaf.git Fetching https://github.com/vapor/vapor.git Fetching https://github.com/apple/swift-log.git Fetching https://github.com/vapor/fluent-kit.git Fetching https://github.com/vapor/mysql-kit.git Fetching https://github.com/apple/swift-crypto.git Fetching https://github.com/vapor/async-kit.git Fetching https://github.com/vapor/sql-kit.git Fetching https://github.com/vapor/mysql-nio.git Fetching https://github.com/vapor/leaf-kit.git Fetching https://github.com/apple/swift-nio.git Fetching https://github.com/apple/swift-nio-ssl.git Fetching https://github.com/apple/swift-metrics.git Fetching https://github.com/swift-server/swift-backtrace.git Fetching https://github.com/apple/swift-nio-extras.git Fetching https://github.com/apple/swift-nio-http2.git Fetching https://github.com/vapor/console-kit.git Fetching https://github.com/swift-server/async-http-client.git Fetching https://github.com/vapor/websocket-kit.git Fetching https://github.com/vapor/routing-kit.git Fetching https://github.com/apple/swift-nio-transport-services.git Cloning https://github.com/vapor/sql-kit.git Resolving https://github.com/vapor/sql-kit.git at 3.7.0 Cloning https://github.com/vapor/fluent.git Resolving https://github.com/vapor/fluent.git at 4.0.0 Cloning https://github.com/apple/swift-nio.git Resolving https://github.com/apple/swift-nio.git at 2.23.0 Cloning https://github.com/apple/swift-nio-transport-services.git Resolving https://github.com/apple/swift-nio-transport-services.git at 1.9.0 Cloning https://github.com/vapor/console-kit.git Resolving https://github.com/vapor/console-kit.git at 4.2.3 Cloning https://github.com/vapor/leaf-kit.git Resolving https://github.com/vapor/leaf-kit.git at 1.0.0-rc.1.17 Cloning https://github.com/swift-server/swift-backtrace.git Resolving https://github.com/swift-server/swift-backtrace.git at 1.2.0 Cloning https://github.com/vapor/fluent-mysql-driver.git Resolving https://github.com/vapor/fluent-mysql-driver.git at 4.0.0 Cloning https://github.com/apple/swift-nio-http2.git Resolving https://github.com/apple/swift-nio-http2.git at 1.15.0 Cloning https://github.com/apple/swift-nio-ssl.git Resolving https://github.com/apple/swift-nio-ssl.git at 2.9.2 Cloning https://github.com/apple/swift-crypto.git Resolving https://github.com/apple/swift-crypto.git at 1.1.2 Cloning https://github.com/vapor/mysql-nio.git Resolving https://github.com/vapor/mysql-nio.git at 1.3.2 Cloning https://github.com/swift-server/async-http-client.git Resolving https://github.com/swift-server/async-http-client.git at 1.2.1 Cloning https://github.com/vapor/routing-kit.git Resolving https://github.com/vapor/routing-kit.git at 4.2.0 Cloning https://github.com/vapor/fluent-kit.git Resolving https://github.com/vapor/fluent-kit.git at 1.7.3 Cloning https://github.com/vapor/leaf.git Resolving https://github.com/vapor/leaf.git at 4.0.0-rc.1.4 Cloning https://github.com/vapor/websocket-kit.git Resolving https://github.com/vapor/websocket-kit.git at 2.1.1 Cloning https://github.com/apple/swift-nio-extras.git Resolving https://github.com/apple/swift-nio-extras.git at 1.7.0 Cloning https://github.com/vapor/vapor.git Resolving https://github.com/vapor/vapor.git at 4.32.0 Cloning https://github.com/vapor/async-kit.git Resolving https://github.com/vapor/async-kit.git at 1.2.0 Cloning https://github.com/apple/swift-log.git Resolving https://github.com/apple/swift-log.git at 1.4.0 Cloning https://github.com/vapor/mysql-kit.git Resolving https://github.com/vapor/mysql-kit.git at 4.1.0 Cloning https://github.com/apple/swift-metrics.git Resolving https://github.com/apple/swift-metrics.git at 2.0.0