softprops / serverless-rust

⚑ πŸ¦€ a serverless framework plugin for rustlang applications
https://www.npmjs.com/package/serverless-rust
MIT License
542 stars 82 forks source link

error: undefined 1 #19

Open Seeker14491 opened 5 years ago

Seeker14491 commented 5 years ago

πŸ› Bug description

An error is generated when running the serverless deploy command. I'm trying to run the serverless-aws-rust template.

πŸ‘Ÿ Steps to reproduce

Steps taken:

PS C:\Users\seekr\Desktop> serverless install --url https://github.com/softprops/serverless-aws-rust --name my-new-app
Serverless: Downloading and installing "serverless-aws-rust"...
Serverless: Successfully installed "my-new-app"
PS C:\Users\seekr\Desktop> cd .\my-new-app\
PS C:\Users\seekr\Desktop\my-new-app> npm install

> spawn-sync@1.0.15 postinstall C:\Users\seekr\Desktop\my-new-app\node_modules\spawn-sync
> node postinstall

> serverless@1.35.0 postinstall C:\Users\seekr\Desktop\my-new-app\node_modules\serverless
> node ./scripts/postinstall.js

npm WARN my-new-app@ No repository field.
npm WARN my-new-app@ No license field.

added 446 packages from 293 contributors and audited 2111 packages in 15.402s
found 0 vulnerabilities

PS C:\Users\seekr\Desktop\my-new-app> serverless deploy
Serverless: WARNING: Missing "tenant" and "app" properties in serverless.yml. Without these properties, you can not publish the service to the Serverless Platform.
Serverless: Building native Rust hello func...
   Compiling semver-parser v0.7.0
   Compiling libc v0.2.44
   Compiling rand_core v0.3.0
   Compiling void v1.0.2
   Compiling nodrop v0.1.13
   Compiling cfg-if v0.1.6
   Compiling stable_deref_trait v1.1.1
   Compiling byteorder v1.2.7
   Compiling lazy_static v1.2.0
   Compiling scopeguard v0.3.3
   Compiling memoffset v0.2.1
   Compiling lazycell v1.2.1
   Compiling proc-macro2 v0.4.24
   Compiling slab v0.4.1
   Compiling futures v0.1.25
   Compiling unicode-xid v0.1.0
   Compiling num-traits v0.2.6
   Compiling cc v1.0.25
   Compiling itoa v0.4.3
   Compiling num-integer v0.1.39
   Compiling serde v1.0.81
   Compiling httparse v1.3.3
   Compiling ryu v0.2.7
   Compiling fnv v1.0.6
   Compiling indexmap v1.0.2
   Compiling string v0.1.2
   Compiling try-lock v0.2.2
   Compiling rustc-demangle v0.1.9
   Compiling rand_core v0.2.2
   Compiling rand_isaac v0.1.1
   Compiling rand_xorshift v0.1.0
   Compiling rand_hc v0.1.0
   Compiling semver v0.9.0
   Compiling unreachable v1.0.0
   Compiling crossbeam-utils v0.6.2
   Compiling log v0.4.6
   Compiling arrayvec v0.4.8
   Compiling owning_ref v0.4.0
   Compiling tokio-executor v0.1.5
   Compiling backtrace-sys v0.1.24
   Compiling smallvec v0.6.7
   Compiling rustc_version v0.2.3
   Compiling want v0.0.6
   Compiling crossbeam-epoch v0.6.1
   Compiling lock_api v0.1.5
   Compiling tokio-current-thread v0.1.4
   Compiling tokio-timer v0.2.8
   Compiling iovec v0.1.2
   Compiling rand v0.5.5
   Compiling net2 v0.2.33
   Compiling num_cpus v1.8.0
   Compiling time v0.1.40
   Compiling parking_lot_core v0.3.1
   Compiling rand_pcg v0.1.1
   Compiling rand_chacha v0.1.0
   Compiling rand v0.6.1
   Compiling crossbeam-deque v0.6.2
   Compiling quote v0.6.10
   Compiling serde_json v1.0.33
   Compiling bytes v0.4.11
   Compiling mio v0.6.16
   Compiling futures-cpupool v0.1.8
   Compiling chrono v0.4.6
   Compiling syn v0.15.22
   Compiling tokio-io v0.1.10
   Compiling http v0.1.14
   Compiling backtrace v0.3.9
   Compiling mio-uds v0.6.7
   Compiling simple_logger v1.0.1
   Compiling tokio-codec v0.1.1
   Compiling h2 v0.1.14
   Compiling serde_derive v1.0.81
   Compiling parking_lot v0.6.4
   Compiling tokio-reactor v0.1.7
   Compiling tokio-threadpool v0.1.9
   Compiling tokio-uds v0.2.4
   Compiling tokio-tcp v0.1.2
   Compiling tokio-udp v0.1.3
   Compiling tokio-fs v0.1.4
   Compiling tokio v0.1.13
   Compiling hyper v0.12.17
   Compiling lambda_runtime_client v0.1.0
   Compiling lambda_runtime v0.1.0
   Compiling hello v0.1.0 (/code)
    Finished release [optimized] target(s) in 2m 52s
Serverless: Dockerized Rust build encountered an error: undefined 1.

  Error --------------------------------------------------

     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 -----------------------------
     OS:                     win32
     Node Version:           11.5.0
     Serverless Version:     1.35.1

Rerunning the serverless deploy command with the SLS_DEBUG env variable set to * yields this stack trace:

Error
    at functions.forEach.funcName (C:\Users\seekr\Desktop\my-new-app\node_modules\serverless-rust\index.js:106:15)
    at Array.forEach (<anonymous>)
    at RustPlugin.build (C:\Users\seekr\Desktop\my-new-app\node_modules\serverless-rust\index.js:90:22)
    at BbPromise.reduce (C:\Users\seekr\AppData\Roaming\npm\node_modules\serverless\lib\classes\PluginManager.js:391:55)
From previous event:
    at PluginManager.invoke (C:\Users\seekr\AppData\Roaming\npm\node_modules\serverless\lib\classes\PluginManager.js:391:22)
    at PluginManager.spawn (C:\Users\seekr\AppData\Roaming\npm\node_modules\serverless\lib\classes\PluginManager.js:409:17)
    at Deploy.BbPromise.bind.then (C:\Users\seekr\AppData\Roaming\npm\node_modules\serverless\lib\plugins\deploy\deploy.js:117:50)
From previous event:
    at Object.before:deploy:deploy [as hook] (C:\Users\seekr\AppData\Roaming\npm\node_modules\serverless\lib\plugins\deploy\deploy.js:107:10)
    at BbPromise.reduce (C:\Users\seekr\AppData\Roaming\npm\node_modules\serverless\lib\classes\PluginManager.js:391:55)
From previous event:
    at PluginManager.invoke (C:\Users\seekr\AppData\Roaming\npm\node_modules\serverless\lib\classes\PluginManager.js:391:22)
    at PluginManager.run (C:\Users\seekr\AppData\Roaming\npm\node_modules\serverless\lib\classes\PluginManager.js:422:17)
    at variables.populateService.then.then (C:\Users\seekr\AppData\Roaming\npm\node_modules\serverless\lib\Serverless.js:157:33)
    at processImmediate (timers.js:632:19)
    at process.topLevelDomainCallback (domain.js:120:23)
From previous event:
    at Serverless.run (C:\Users\seekr\AppData\Roaming\npm\node_modules\serverless\lib\Serverless.js:144:8)
    at serverless.init.then (C:\Users\seekr\AppData\Roaming\npm\node_modules\serverless\bin\serverless:44:28)

🌍 Your environment

Windows 10 x64

serverless version: 1.35.1

rust-plugin version: 0.2.0

softprops commented 5 years ago

I'm tracking a related issue that may be the source of this problem here https://github.com/softprops/lambda-rust/issues/2 so far it appears to only affect windows users. Let me know of the symptoms listed there seem familiar.

In the mean time I'll leave this issue open for visibility

softprops commented 4 years ago

supporting docker with windows was kind of a pain since I didn't have a good way to test. The latest release has an experimental option to build locally without docker which may help https://github.com/softprops/serverless-rust#-experimental-local-builds Of not I do have integration tests which testing building and running on a windows vm

qhkm commented 3 years ago

Can confirm that this issue is not being resolved yet. Got the same error when trying to deploy rust serverless today.

Finished release [optimized] target(s) in 34.45s
objcopy: st8nPDiH: debuglink section already exists
mv: 'metis-diagnosis' and 'bootstrap' are the same file
Serverless: Rust build encountered an error: undefined 1.

  Error --------------------------------------------------

  Error
      at /workspace/node_modules/serverless-rust/index.js:289:15
      at Array.forEach (<anonymous>)
      at RustPlugin.build (/workspace/node_modules/serverless-rust/index.js:269:22)
  From previous event:
      at PluginManager.invoke (/workspace/node_modules/serverless/lib/classes/PluginManager.js:483:22)
      at PluginManager.spawn (/workspace/node_modules/serverless/lib/classes/PluginManager.js:503:17)
      at /workspace/node_modules/serverless/lib/plugins/deploy/deploy.js:112:50
  From previous event:
      at Object.before:deploy:deploy [as hook] (/workspace/node_modules/serverless/lib/plugins/deploy/deploy.js:102:22)
      at /workspace/node_modules/serverless/lib/classes/PluginManager.js:483:55
  From previous event:
      at PluginManager.invoke (/workspace/node_modules/serverless/lib/classes/PluginManager.js:483:22)
      at /workspace/node_modules/serverless/lib/classes/PluginManager.js:518:24
  From previous event:
      at PluginManager.run (/workspace/node_modules/serverless/lib/classes/PluginManager.js:518:8)
      at /workspace/node_modules/serverless/lib/Serverless.js:133:33
  From previous event:
      at Serverless.run (/workspace/node_modules/serverless/lib/Serverless.js:120:74)
      at /workspace/node_modules/serverless/bin/serverless.js:87:26
      at processImmediate (internal/timers.js:461:21)
  From previous event:
      at Object.<anonymous> (/workspace/node_modules/serverless/bin/serverless.js:87:4)
      at Module._compile (internal/modules/cjs/loader.js:999:30)
      at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
      at Module.load (internal/modules/cjs/loader.js:863:32)
      at Function.Module._load (internal/modules/cjs/loader.js:708:14)
      at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12)
      at internal/main/run_main_module.js:17:47