ZenVoich / mops

Package manager for the Motoko programming language
https://mops.one
MIT License
36 stars 3 forks source link

Not pulling archive to look for file #161

Closed skilesare closed 10 months ago

skilesare commented 10 months ago

This particular package has been causing some issues more and more. I don't know if the file used to be hosted not in an archive before and is now in an archive, or if something happened in how mops handles these.

mo-0.5.7-20210211 is definitely a version at @kritzcreek's repo(https://github.com/kritzcreek/vessel-package-set/releases/tag/mo-0.5.7-20210211) and when I download the archive, the package-set.dhall file is in it.

If the direct link fails, shouldn't it download the archive and extract it?

Problem File: https://github.com/kritzcreek/vessel-package-set/releases/download/mo-0.5.7-20210211/package-set.dhall

dhall-to-json error: Error: Command failed with exit code 1: dhall-to-json --file /Users/afat/Dropbox/development/origyn/code/origyn_nft/.mops/_github/matchers@v1.2.0/package-set.dhall

Error: Remote file not found

HTTP status code: 404

URL: https://github.com/kritzcreek/vessel-package-set/releases/download/mo-0.5.7-20210211/package-set.dhall

Message:

1│ 
2│ 
3│ 
4│ 
5│ 
6│ 
7│ <!DOCTYPE html>
…│ <html lang="en" data-color-mode="auto" data-light-theme="light" data-dark-theme="dark"  data-a11y-animated-images="system" data-a11y-link-underlines="true">

    at makeError (file:///Users/afat/.nvm/versions/node/v16.19.0/lib/node_modules/ic-mops/node_modules/execa/lib/error.js:59:11)
    at handlePromise (file:///Users/afat/.nvm/versions/node/v16.19.0/lib/node_modules/ic-mops/node_modules/execa/index.js:124:26)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async dhallFileToJson (file:///Users/afat/.nvm/versions/node/v16.19.0/lib/node_modules/ic-mops/dist/vessel.js:17:19)
    at async Promise.all (index 1)
    at async readVesselConfig (file:///Users/afat/.nvm/versions/node/v16.19.0/lib/node_modules/ic-mops/dist/vessel.js:38:39)
    at async installFromGithub (file:///Users/afat/.nvm/versions/node/v16.19.0/lib/node_modules/ic-mops/dist/vessel.js:146:20)
    at async installFromGithub (file:///Users/afat/.nvm/versions/node/v16.19.0/lib/node_modules/ic-mops/dist/vessel.js:150:17)
    at async installAll (file:///Users/afat/.nvm/versions/node/v16.19.0/lib/node_modules/ic-mops/dist/commands/install-all.js:18:13)
    at async Command.<anonymous> (file:///Users/afat/.nvm/versions/node/v16.19.0/lib/node_modules/ic-mops/dist/cli.js:136:5) {
  shortMessage: 'Command failed with exit code 1: dhall-to-json --file /Users/afat/Dropbox/development/origyn/code/origyn_nft/.mops/_github/matchers@v1.2.0/package-set.dhall',
  command: 'dhall-to-json --file /Users/afat/Dropbox/development/origyn/code/origyn_nft/.mops/_github/matchers@v1.2.0/package-set.dhall',
  escapedCommand: 'dhall-to-json --file "/Users/afat/Dropbox/development/origyn/code/origyn_nft/.mops/_github/matchers@v1.2.0/package-set.dhall"',
  exitCode: 1,
  signal: undefined,
  signalDescription: undefined,
  stdout: '',
  stderr: '\n' +
    '\n' +
    '\x1B[1;31mError\x1B[0m: Remote file not found\n' +
    '\n' +
    'HTTP status code: 404\n' +
    '\n' +
    'URL: https://github.com/kritzcreek/vessel-package-set/releases/download/mo-0.5.7-20210211/package-set.dhall\n' +
    '\n' +
    'Message:\n' +
    '\n' +
    '1│ \n' +
    '2│ \n' +
    '3│ \n' +
    '4│ \n' +
    '5│ \n' +
    '6│ \n' +
    '7│ <!DOCTYPE html>\n' +
    '…│ <html lang="en" data-color-mode="auto" data-light-theme="light" data-dark-theme="dark"  data-a11y-animated-images="system" data-a11y-link-underlines="true">\n',
  failed: true,
  timedOut: false,
  isCanceled: false,
  killed: false
}
node:internal/process/promises:279
            triggerUncaughtException(err, true /* fromPromise */);
            ^

HTTPError: Response code 404 (Not Found)
    at Request._onResponseBase (file:///Users/afat/.nvm/versions/node/v16.19.0/lib/node_modules/ic-mops/node_modules/got/dist/source/core/index.js:706:31)
    at Request._onResponse (file:///Users/afat/.nvm/versions/node/v16.19.0/lib/node_modules/ic-mops/node_modules/got/dist/source/core/index.js:768:24)
    at ClientRequest.<anonymous> (file:///Users/afat/.nvm/versions/node/v16.19.0/lib/node_modules/ic-mops/node_modules/got/dist/source/core/index.js:786:23)
    at Object.onceWrapper (node:events:628:26)
    at ClientRequest.emit (node:events:525:35)
    at HTTPParser.parserOnIncomingClient (node:_http_client:693:27)
    at HTTPParser.parserOnHeadersComplete (node:_http_common:128:17)
    at TLSSocket.socketOnData (node:_http_client:534:22)
    at TLSSocket.emit (node:events:513:28)
    at addChunk (node:internal/streams/readable:315:12) {
  input: undefined,
  code: 'ERR_NON_2XX_3XX_RESPONSE',
  timings: {
    start: 1698072410813,
    socket: 1698072410813,
    lookup: 1698072410834,
    connect: 1698072410877,
    secureConnect: 1698072410924,
    upload: 1698072410924,
    response: 1698072411030,
    end: 1698072411033,
    error: undefined,
    abort: undefined,
    phases: {
      wait: 0,
      dns: 21,
      tcp: 43,
      tls: 47,
      request: 0,
      firstByte: 106,
      download: 3,
      total: 220
    }
  },
  options: Options {
    _unixOptions: undefined,
    _internals: {
      request: undefined,
      agent: { http: undefined, https: undefined, http2: undefined },
      h2session: undefined,
      decompress: true,
      timeout: {
        connect: undefined,
        lookup: undefined,
        read: undefined,
        request: undefined,
        response: undefined,
        secureConnect: undefined,
        send: undefined,
        socket: undefined
      },
      prefixUrl: '',
      body: undefined,
      form: undefined,
      json: undefined,
      cookieJar: undefined,
      ignoreInvalidCookies: false,
      searchParams: undefined,
      dnsLookup: undefined,
      dnsCache: undefined,
      context: {},
      hooks: {
        init: [],
        beforeRequest: [],
        beforeError: [],
        beforeRedirect: [],
        beforeRetry: [],
        afterResponse: []
      },
      followRedirect: true,
      maxRedirects: 10,
      cache: undefined,
      throwHttpErrors: true,
      username: '',
      password: '',
      http2: false,
      allowGetBody: false,
      headers: {
        'user-agent': 'got (https://github.com/sindresorhus/got)',
        'accept-encoding': 'gzip, deflate, br'
      },
      methodRewriting: false,
      dnsLookupIpVersion: undefined,
      parseJson: [Function: parse],
      stringifyJson: [Function: stringify],
      retry: {
        limit: 2,
        methods: [ 'GET', 'PUT', 'HEAD', 'DELETE', 'OPTIONS', 'TRACE' ],
        statusCodes: [
          408, 413, 429, 500,
          502, 503, 504, 521,
          522, 524
        ],
        errorCodes: [
          'ETIMEDOUT',
          'ECONNRESET',
          'EADDRINUSE',
          'ECONNREFUSED',
          'EPIPE',
          'ENOTFOUND',
          'ENETUNREACH',
          'EAI_AGAIN'
        ],
        maxRetryAfter: undefined,
        calculateDelay: [Function: calculateDelay],
        backoffLimit: Infinity,
        noise: 100
      },
      localAddress: undefined,
      method: 'GET',
      createConnection: undefined,
      cacheOptions: {
        shared: undefined,
        cacheHeuristic: undefined,
        immutableMinTimeToLive: undefined,
        ignoreCargoCult: undefined
      },
      https: {
        alpnProtocols: undefined,
        rejectUnauthorized: undefined,
        checkServerIdentity: undefined,
        certificateAuthority: undefined,
        key: undefined,
        certificate: undefined,
        passphrase: undefined,
        pfx: undefined,
        ciphers: undefined,
        honorCipherOrder: undefined,
        minVersion: undefined,
        maxVersion: undefined,
        signatureAlgorithms: undefined,
        tlsSessionLifetime: undefined,
        dhparam: undefined,
        ecdhCurve: undefined,
        certificateRevocationLists: undefined
      },
      encoding: undefined,
      resolveBodyOnly: false,
      isStream: true,
      responseType: 'text',
      url: <ref *1> URL {
        [Symbol(context)]: URLContext {
          flags: 400,
          scheme: 'https:',
          username: '',
          password: '',
          host: 'codeload.github.com',
          port: null,
          path: [ 'icdevs', 'candy_library', 'zip', 'v0.1.12' ],
          query: null,
          fragment: null
        },
        [Symbol(query)]: URLSearchParams {
          [Symbol(query)]: [],
          [Symbol(context)]: [Circular *1]
        }
      },
      pagination: {
        transform: [Function: transform],
        paginate: [Function: paginate],
        filter: [Function: filter],
        shouldContinue: [Function: shouldContinue],
        countLimit: Infinity,
        backoff: 0,
        requestLimit: 10000,
        stackAllItems: false
      },
      setHost: true,
      maxHeaderSize: undefined,
      signal: undefined,
      enableUnixSockets: false
    },
    _merging: false,
    _init: [ { isStream: true } ]
  }
}
ZenVoich commented 10 months ago

@skilesare unfortunately this cannot be fixed on the mops side because mops uses dhall-to-json package which is actually compiled binary.

I can suggest to use matchers v1.3.0:

matchers = "https://github.com/kritzcreek/motoko-matchers#v1.3.0"
skilesare commented 10 months ago

Hmm...but the file is there and available....is there something about github that hides it behind an archive instead of exposing it? The issue is that we've updated all our libraries 0.1.3, but other libraries that we don't control have not.

ZenVoich commented 10 months ago

Could you please share your mops.toml file contents so I can investigate this deeper

skilesare commented 10 months ago

See below:

As a bit of context, we use the migration pattern so that old canister can be upgraded in a methodical way. This means that as we upgrade to candy library 2 in version 0.1.4, we have to leave the code in for candy library 1.1(which references the troublesome kritzcreek version of matches). This was not a problem for a very long time and just started popping up about a month ago. I can get the library from https://github.com/kritzcreek/vessel-package-set/releases/tag/mo-0.5.7-20210211 . Is there some place I can unzip it in the cache in the short term so that I can get past this?

[package] name = "origyn-nft" version = "0.1.5" description = "The reference implementation for the ORIGYN NFT." repository = "https://github.com/ORIGYN_SA/origyn_nft"

[dependencies] base = "0.8.7" array = "https://github.com/aviate-labs/array.mo#v0.2.1" crypto = "https://github.com/aviate-labs/crypto.mo#v0.3.1" hash = "https://github.com/aviate-labs/hash.mo#v0.1.0" encoding = "https://github.com/aviate-labs/encoding.mo#v0.4.1" matchers = "https://github.com/kritzcreek/motoko-matchers#v1.3.0" candy_0_1_10 = "https://github.com/icdevs/candy_library#v0.1.10" candy_0_1_12 = "https://github.com/icdevs/candy_library#v0.1.12" candy = "https://github.com/icdevs/candy_library#v0.1.12" principalmo = "https://github.com/aviate-labs/principal.mo#v0.2.6" ext = "https://github.com/skilesare/extendable-token#v0.1.0" httpparser = "https://github.com/NatLabs/http-parser.mo#v0.1.2" http = "https://github.com/aviate-labs/http.mo#v0.1.0" json = "https://github.com/aviate-labs/json.mo#v0.2.1" stablebuffer_0_2_0 = "https://github.com/skilesare/StableBuffer#v0.2.0" droute_client = "https://github.com/ORIGYN-SA/droute-client#v0.1.0" map_6_0_0 = "https://github.com/ZhenyaUsenko/motoko-hash-map#v6.0.0" map_7_0_0 = "https://github.com/ZhenyaUsenko/motoko-hash-map#v7.0.0" map7 = "https://github.com/ZhenyaUsenko/motoko-hash-map#v7.0.0" map_8_1_0 = "https://github.com/ZhenyaUsenko/motoko-hash-map#v8.1.0" map = "https://github.com/ZhenyaUsenko/motoko-hash-map#v7.0.0" stablebuffer = "https://github.com/skilesare/StableBuffer#v0.2.0" canistergeek = "https://github.com/ORIGYN-SA/canistergeek-motoko#nft_0_1_4" canistergeekold = "https://github.com/ORIGYN-SA/canistergeek-motoko#main" icrc17_kyc = "https://github.com/ORIGYN-SA/kyc.mo#master" candy_0_2_0 = "https://github.com/icdevs/candy_library#0.2.0" stableBTree = "https://github.com/sardariuss/MotokoStableBTree#main" star = "0.1.0"

ZenVoich commented 10 months ago

I changed errors logging in mops 0.31.2 to hide extra stack, now it should be easier understand what goes wrong. Also dhall-to-json errors now will be hidden on mops sources.

dhall-to-json error can be ignored, because you have matchers = "https://github.com/kritzcreek/motoko-matchers#v1.3.0" in mops.toml so matchers will be resolved to v1.3.0.

And there is missing GitHub tag v0.1.12 in repo https://github.com/icdevs/candy_library

I think adding missing v0.1.12 tag and updating mops to 0.31.2 should help.

skilesare commented 10 months ago

This fixed our issue. Thanks! ᐧ

On Wed, Oct 25, 2023 at 1:20 AM Zen Voich @.***> wrote:

I changed errors logging in mops 0.31.2 to hide extra stack, now it should be easier understand what goes wrong. Also dhall-to-json errors now will be hidden on mops sources.

dhall-to-json error can be ignored, because you have matchers = " https://github.com/kritzcreek/motoko-matchers#v1.3.0" in mops.toml so matchers will be resolved to v1.3.0.

And there is missing GitHub tag v0.1.12 in repo https://github.com/icdevs/candy_library

I think adding missing v0.1.12 tag and updating mops to 0.31.2 should help.

— Reply to this email directly, view it on GitHub https://github.com/ZenVoich/mops/issues/161#issuecomment-1778588497, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAE5CO2PYZPXHFIWLHOBEEDYBCVTRAVCNFSM6AAAAAA6MGX2IWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONZYGU4DQNBZG4 . You are receiving this because you were mentioned.Message ID: @.***>

-- Austin Fatheree twitter: @afat http://twitter.com/afat