discord / gamesdk-and-dispatch

Public issue tracker for the Discord Game SDK and Dispatch
22 stars 7 forks source link

thread 'main' panicked when executed in github actions #65

Closed PeaceDealer closed 4 years ago

PeaceDealer commented 4 years ago

Describe the bug When executing the dispatch program inside a github action workflow the following error is thrown:

thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', src/libcore/option.rs:347:21
stack backtrace:
   0:     0x556ac3d643fb - backtrace::backtrace::libunwind::trace::h034f17449c8f06d2
                               at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.29/src/backtrace/libunwind.rs:88
   1:     0x556ac3d643fb - backtrace::backtrace::trace_unsynchronized::h88fceba984274b2d
                               at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.29/src/backtrace/mod.rs:66
   2:     0x556ac3d643fb - std::sys_common::backtrace::_print::h113a7251db1bb0bb
                               at src/libstd/sys_common/backtrace.rs:47
   3:     0x556ac3d643fb - std::sys_common::backtrace::print::he1709f3e64aa1331
                               at src/libstd/sys_common/backtrace.rs:36
   4:     0x556ac3d643fb - std::panicking::default_hook::{{closure}}::h4c7c19a95acf509e
                               at src/libstd/panicking.rs:198
   5:     0x556ac3d640fc - std::panicking::default_hook::haf2a960f108a3f30
                               at src/libstd/panicking.rs:212
   6:     0x556ac3d64b70 - std::panicking::rust_panic_with_hook::h89241749267406d1
                               at src/libstd/panicking.rs:475
   7:     0x556ac3d646f2 - std::panicking::continue_panic_fmt::h2e3cd0630ee3b20c
                               at src/libstd/panicking.rs:382
   8:     0x556ac3d645d6 - rust_begin_unwind
                               at src/libstd/panicking.rs:309
   9:     0x556ac3d8716d - core::panicking::panic_fmt::hbd9001b67b6e597c
                               at src/libcore/panicking.rs:85
  10:     0x556ac3d870ac - core::panicking::panic::he483004d7e992d33
                               at src/libcore/panicking.rs:49
  11:     0x556ac3cb4678 - openssl::ssl::connector::ctx::he7250ad86014e9ff
  12:     0x556ac3cb46b4 - openssl::ssl::connector::SslConnectorBuilder::new::h1dce545fdab46f91
  13:     0x556ac3cb2a7a - native_tls::TlsConnector::builder::h809864e2f9510e10
  14:     0x556ac3c3de86 - reqwest::async_impl::client::ClientBuilder::new::hb0b2cd5162e2dc00
  15:     0x556ac3c3125a - reqwest::client::ClientBuilder::new::h9809e62c45f18949
  16:     0x556ac3874701 - dispatch::credentials::make_client::h9b25c81fdfbfa927
  17:     0x556ac3876949 - dispatch::credentials::create::ha73837dfd27f0e83
  18:     0x556ac3600930 - dispatch_cli::cmd::login::exec::h681cc76b460b8d90
  19:     0x556ac357a3ec - dispatch_cli::cmd::exec::h35238af2dcf442b6
  20:     0x556ac355e843 - dispatch::main::hc9686b27d1db3653
  21:     0x556ac355cbc3 - std::rt::lang_start::{{closure}}::hceb10ad19f23aabc
  22:     0x556ac3d64573 - std::rt::lang_start_internal::{{closure}}::h3be3cde5d166e4dd
                               at src/libstd/rt.rs:49
  23:     0x556ac3d64573 - std::panicking::try::do_call::h7b76c74d123f5ca6
                               at src/libstd/panicking.rs:294
  24:     0x556ac3d6ee1a - __rust_maybe_catch_panic
                               at src/libpanic_unwind/lib.rs:85
  25:     0x556ac3d6513d - std::panicking::try::hcc2d7d9a75b4b064
                               at src/libstd/panicking.rs:273
  26:     0x556ac3d6513d - std::panic::catch_unwind::h77c5e75c63053cdb
                               at src/libstd/panic.rs:388
  27:     0x556ac3d6513d - std::rt::lang_start_internal::hff2edc0b2c56ef35
                               at src/libstd/rt.rs:48
  28:     0x556ac355f022 - main
  29:     0x7f50cb303b97 - __libc_start_main
  30:     0x556ac3556f7a - _start
  31:                0x0 - <unknown>
##[error]Process completed with exit code 101.

Steps to reproduce Steps to reproduce the behavior:

  1. Commit the Linux binary to your github & a template credentials.json i.e.
    {
    "BotCredentials": {
    "application_id": ":application_id",
    "token": ":token"
    }
    }
  2. Put your application id & bot token into 2 secrets: DISCORD_APPLICATION_ID & DISCORD_BOT_TOKEN. (or put straight into credentials.json if you dare)
  3. Create a github workflow along the lines

    pushBranchToDiscordDispatch:
    name: Push builds to discord dispatch
    runs-on: ubuntu-latest
    #  needs: buildForSomePlatforms
    steps:
    - name: Checkout code
      uses: actions/checkout@v2
      with:
        lfs: true
    
    #  - name: Get binaries from build job
    #    uses: actions/download-artifact@v1
    #    with:
    #      name: Build
    
    - name: Manipulate files to prepare dispatch
      run: |
        ls -la ./
        mkdir ~/.dispatch
        cp ./Discord-Dispatch/credentials.json ~/.dispatch/credentials.json
        sed "s/:application_id/${{secrets.DISCORD_APPLICATION_ID}}/" ~/.dispatch/credentials.json > ~/.dispatch/credentials.json
        sed "s/:token/${{secrets.DISCORD_BOT_TOKEN}}/" ~/.dispatch/credentials.json > ~/.dispatch/credentials.json
        chmod +x ./Discord-Dispatch/dispatch
    
    - name: Log into discord dispatch
      env:
        RUST_BACKTRACE: full
      run: |
        ./Discord-Dispatch/dispatch login

Expected behavior To be logged in

Implementation specifics

sylveon commented 4 years ago

Duplicate of #18

Jump-Suit commented 4 years ago

In Discord Developers, msciotti has linked a newer Dispatch version which should resolve that issue here: https://cdn.discordapp.com/attachments/337744475600322572/696856787093028884/dispatch Message reference: https://discordapp.com/channels/613425648685547541/613425905708171300/703157937387864135 This isn't definitive to say this patch WILL work, it seems hit or miss with other linux users so hope for the best!

PeaceDealer commented 4 years ago

This version did solve the problem, but it doesn't seem to be picking up on my ~/.dispatch/credentials.json

PeaceDealer commented 4 years ago

nope, thats on me, no need to login. Ill just close this up here then. Thanks for the help