Skip to content

"as_ptr" Error When Invoking Locally #17

Open
@JimLynchCodes

Description

@JimLynchCodes

Hello again! 👋

Just wanted to throw an issue up documentation this different error I'm getting.

I'm trying to run it locally using the default serverless.yml settings when scaffolding a project...

When I run sls invoke local -f hello it is failing with this error that points at the "as_ptr" call...

Running "serverless" from node_modules
Serverless: Deprecation Notice: bin/serverless is deprecated, use bin/serverless.js instead
            More Info: https://www.serverless.com/framework/docs/deprecations/#BIN_SERVERLESS
Serverless: Building Rust hello func...
Serverless: Running containerized build
   Compiling unicode-xid v0.2.2
   Compiling autocfg v1.1.0
   Compiling serde_derive v1.0.136
   Compiling serde v1.0.136
   Compiling log v0.4.14
   Compiling memchr v2.4.1
   Compiling futures-core v0.3.21
   Compiling slab v0.4.5
   Compiling futures-sink v0.3.21
   Compiling futures-task v0.3.21
   Compiling futures-channel v0.3.21
   Compiling futures-util v0.3.21
   Compiling futures-io v0.3.21
   Compiling cc v1.0.73
   Compiling matches v0.1.9
   Compiling try-lock v0.2.3
   Compiling crossbeam-utils v0.8.7
   Compiling crc32fast v1.3.2
   Compiling tower-service v0.3.1
   Compiling version_check v0.9.4
   Compiling adler v1.0.2
   Compiling serde_json v1.0.79
   Compiling ryu v1.0.9
   Compiling ppv-lite86 v0.2.16
   Compiling bitflags v1.3.2
   Compiling minimal-lexical v0.2.1
   Compiling tinyvec_macros v0.1.0
   Compiling byteorder v1.4.3
   Compiling tower-layer v0.3.1
   Compiling unicode-bidi v0.3.7
   Compiling bytes v0.5.6
   Compiling pin-project-lite v0.1.12
   Compiling indexmap v1.8.0
   Compiling num-traits v0.2.14
   Compiling miniz_oxide v0.4.4
   Compiling num-integer v0.1.44
   Compiling tracing-core v0.1.22
   Compiling form_urlencoded v1.0.1
   Compiling tinyvec v1.5.1
   Compiling nom v7.1.0
   Compiling proc-macro2 v1.0.36
   Compiling openssl-sys v0.9.72
error[E0599]: no function or associated item named `as_ptr` found for struct `std::sync::Arc<_>` in the current scope
  --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-task-0.3.21/src/waker_ref.rs:58:20
   |
58 |     let ptr = Arc::as_ptr(wake).cast::<()>();
   |                    ^^^^^^ function or associated item not found in `std::sync::Arc<_>`

error: aborting due to previous error

For more information about this error, try `rustc --explain E0599`.
error: could not compile `futures-task`.

To learn more, run the command again with --verbose.
warning: build failed, waiting for other jobs to finish...
error: build failed
Serverless: Rust build encountered an error: undefined 1.
 
  Error --------------------------------------------------
 
  Error: 
      at /Users/jim/Git-Projects/joke-fetcher-crab-lamb/node_modules/serverless-rust/index.js:289:15
      at Array.forEach (<anonymous>)
      at RustPlugin.build (/Users/jim/Git-Projects/joke-fetcher-crab-lamb/node_modules/serverless-rust/index.js:269:22)
      at /Users/jim/Git-Projects/joke-fetcher-crab-lamb/node_modules/serverless/lib/classes/PluginManager.js:476:55
      at tryCatcher (/Users/jim/Git-Projects/joke-fetcher-crab-lamb/node_modules/bluebird/js/release/util.js:16:23)
      at Object.gotValue (/Users/jim/Git-Projects/joke-fetcher-crab-lamb/node_modules/bluebird/js/release/reduce.js:168:18)
      at Object.gotAccum (/Users/jim/Git-Projects/joke-fetcher-crab-lamb/node_modules/bluebird/js/release/reduce.js:155:25)
      at Object.tryCatcher (/Users/jim/Git-Projects/joke-fetcher-crab-lamb/node_modules/bluebird/js/release/util.js:16:23)
      at Promise._settlePromiseFromHandler (/Users/jim/Git-Projects/joke-fetcher-crab-lamb/node_modules/bluebird/js/release/promise.js:547:31)
      at Promise._settlePromise (/Users/jim/Git-Projects/joke-fetcher-crab-lamb/node_modules/bluebird/js/release/promise.js:604:18)
      at Promise._settlePromise0 (/Users/jim/Git-Projects/joke-fetcher-crab-lamb/node_modules/bluebird/js/release/promise.js:649:10)
      at Promise._settlePromises (/Users/jim/Git-Projects/joke-fetcher-crab-lamb/node_modules/bluebird/js/release/promise.js:729:18)
      at _drainQueueStep (/Users/jim/Git-Projects/joke-fetcher-crab-lamb/node_modules/bluebird/js/release/async.js:93:12)
      at _drainQueue (/Users/jim/Git-Projects/joke-fetcher-crab-lamb/node_modules/bluebird/js/release/async.js:86:9)
      at Async._drainQueues (/Users/jim/Git-Projects/joke-fetcher-crab-lamb/node_modules/bluebird/js/release/async.js:102:5)
      at Immediate.Async.drainQueues [as _onImmediate] (/Users/jim/Git-Projects/joke-fetcher-crab-lamb/node_modules/bluebird/js/release/async.js:15:14)
      at processImmediate (node:internal/timers:464:21)
 
     For debugging logs, run again after setting the "SLS_DEBUG=*" environment variable.
 
  Get Support --------------------------------------------
     Docs:          docs.serverless.com
     Bugs:          github.com/serverless/serverless/issues
     Issues:        forum.serverless.com
 
  Your Environment Information ---------------------------
     Operating System:          darwin
     Node Version:              16.13.2
     Framework Version:         1.74.1
     Plugin Version:            3.6.15
     SDK Version:               2.3.1
     Components Version:        2.31.10

I am on a mac and have docker desktop app running...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions