Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installation fails: "Failure - Main Use Node.js ${{ matrix.node-version }}" #1342

Closed
mStirner opened this issue Sep 12, 2022 · 7 comments
Closed
Labels
kind/bug Something isn't working stale

Comments

@mStirner
Copy link

Bug report info

act version:            0.2.31
GOOS:                   linux
GOARCH:                 amd64
NumCPU:                 8
Docker host:            DOCKER_HOST environment variable is unset/empty.
Sockets found:
	/var/run/docker.sock
Config files:           
	/home/marc/.actrc:
		-P ubuntu-latest=catthehacker/ubuntu:act-latest
		-P ubuntu-22.04=catthehacker/ubuntu:act-22.04
		-P ubuntu-20.04=catthehacker/ubuntu:act-20.04
		-P ubuntu-18.04=catthehacker/ubuntu:act-18.04
Build info:
	Go version:            go1.18.5
	Module path:           github.com/nektos/act
	Main version:          (devel)
	Main path:             github.com/nektos/act
	Main checksum:         
	Build settings:
		-compiler:            gc
		-ldflags:             -s -w -X main.version=0.2.31 -X main.commit=a20b1d4669d8d032fe35347bd3cfdae58b4d1d97 -X main.date=2022-09-01T02:56:14Z -X main.builtBy=goreleaser
		CGO_ENABLED:          0
		GOARCH:               amd64
		GOOS:                 linux
		GOAMD64:              v1
		vcs:                  git
		vcs.revision:         a20b1d4669d8d032fe35347bd3cfdae58b4d1d97
		vcs.time:             2022-08-31T18:41:56Z
		vcs.modified:         false
Docker Engine:
	Engine version:        20.10.17
	Engine runtime:        runc
	Cgroup version:        1
	Cgroup driver:         cgroupfs
	Storage driver:        overlay2
	Registry URI:          https://index.docker.io/v1/
	OS:                    Ubuntu 18.04.6 LTS
	OS type:               linux
	OS version:            18.04
	OS arch:               x86_64
	OS kernel:             5.4.0-124-generic
	OS CPU:                8
	OS memory:             15818 MB
	Security options:
		name=apparmor
		name=seccomp,profile=default

Command used with act

./bin/act

Describe issue

First run failed, After selecting the image size (medium) and pulling some images the command failed.

[Node.js CI/build-12]   💬  ::debug::npm path is /root/.npm
[Node.js CI/build-12]   💬  ::debug::followSymbolicLinks 'true'
[Node.js CI/build-12]   💬  ::debug::followSymbolicLinks 'true'
[Node.js CI/build-12]   💬  ::debug::implicitDescendants 'true'
[Node.js CI/build-12]   💬  ::debug::matchDirectories 'true'
[Node.js CI/build-12]   💬  ::debug::omitBrokenSymbolicLinks 'true'
[Node.js CI/build-12]   💬  ::debug::Search path '/home/marc/projects/OpenHaus/backend/package-lock.json'
[Node.js CI/build-12]   💬  ::debug::/home/marc/projects/OpenHaus/backend/package-lock.json
[Node.js CI/build-12]   💬  ::debug::Found 1 files to hash.
[Node.js CI/build-12]   💬  ::debug::primary key is node-cache-Linux-npm-6a6de438d85da130366ee2d81de922af638507baee1b1a330b14f4b2f3964962
[Node.js CI/build-12]   💾  ::save-state name=CACHE_KEY::node-cache-Linux-npm-6a6de438d85da130366ee2d81de922af638507baee1b1a330b14f4b2f3964962
[Node.js CI/build-12]   💬  ::debug::Resolved Keys:
[Node.js CI/build-12]   💬  ::debug::["node-cache-Linux-npm-6a6de438d85da130366ee2d81de922af638507baee1b1a330b14f4b2f3964962"]
[Node.js CI/build-12]   💬  ::debug::Checking zstd --version
[Node.js CI/build-12]   💬  ::debug::*** zstd command line interface 64-bits v1.4.4, by Yann Collet ***
[Node.js CI/build-12]   💬  ::debug::getCacheEntry - Attempt 1 of 2 failed with error: Cache Service Url not found, unable to restore cache.
[Node.js CI/build-12]   💬  ::debug::getCacheEntry - Attempt 2 of 2 failed with error: Cache Service Url not found, unable to restore cache.
[Node.js CI/build-12]   ❗  ::error::getCacheEntry failed: Cache Service Url not found, unable to restore cache.
[Node.js CI/build-12]   ❌  Failure - Main Use Node.js ${{ matrix.node-version }}
[Node.js CI/build-12] exitcode '1': failure
[Node.js CI/build-12] 🏁  Job failed
Error: Job 'build' failed

I think the important part from the output above is:
[Node.js CI/build-12] ❌ Failure - Main Use Node.js ${{ matrix.node-version }}

Link to GitHub repository

No response

Workflow content

# This workflow will do a clean install of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: Node.js CI

on:
    push:
        branches: [main, dev]
    pull_request:
        branches: [main, dev]

jobs:
    build:
        #runs-on: [ubuntu-18.04, ubuntu-latest]
        runs-on: ${{ matrix.os }}

        # httpbin for helper/request
        services:
            httpbin:
                image: kennethreitz/httpbin
                ports: 
                    - 80:80

        strategy:
            matrix:
                os: [ubuntu-18.04, ubuntu-latest]
                node-version: [16.x, 17.x]           # See supported Node.js release schedule at https://nodejs.org/en/about/releases/
                mongodb-version: ["4.2", "4.4", "5.0"]

        steps:
            - uses: actions/checkout@v2

            # mongodb setup
            - name: Start MongoDB
              uses: supercharge/mongodb-github-action@1.7.0
              with:
                  mongodb-version: ${{ matrix.mongodb-version }}            

            # node.js setup
            - name: Use Node.js ${{ matrix.node-version }}
              uses: actions/setup-node@v2
              with:
                  node-version: ${{ matrix.node-version }}
                  cache: "npm"
            - run: npm ci
            - run: npm run build --if-present
            - run: npm run lint
            - run: npm test

Relevant log output

[Node.js CI/build-12] [DEBUG] Found revision: fac31df6fc08e1b9bf38cdc095342f70bd7675d4
[Node.js CI/build-12] [DEBUG] HEAD points to 'fac31df6fc08e1b9bf38cdc095342f70bd7675d4'
[Node.js CI/build-12] [DEBUG] using github ref: refs/heads/dev
[Node.js CI/build-12] [DEBUG] Found revision: fac31df6fc08e1b9bf38cdc095342f70bd7675d4
[Node.js CI/build-12] [DEBUG] evaluating expression 'success()'
[Node.js CI/build-12] [DEBUG] expression 'success()' evaluated to 'false'
[Node.js CI/build-12] [DEBUG] Skipping step 'Use Node.js ${{ matrix.node-version }}' due to 'success()'
[Node.js CI/build-12] [DEBUG] skipping post step for 'actions/checkout@v2': no action model available
[Node.js CI/build-12] 🏁  Job failed
[Node.js CI/build-12] [DEBUG] Loading slug from git directory '/home/marc/projects/OpenHaus/backend/.git'
[Node.js CI/build-12] [DEBUG] Loading revision from git directory '/home/marc/projects/OpenHaus/backend/.git'
[Node.js CI/build-12] [DEBUG] Found revision: fac31df6fc08e1b9bf38cdc095342f70bd7675d4
[Node.js CI/build-12] [DEBUG] HEAD points to 'fac31df6fc08e1b9bf38cdc095342f70bd7675d4'
[Node.js CI/build-12] [DEBUG] using github ref: refs/heads/dev
[Node.js CI/build-12] [DEBUG] Found revision: fac31df6fc08e1b9bf38cdc095342f70bd7675d4

Additional information

OS: Ubuntu 18.04 x64 LTS

@mStirner mStirner added the kind/bug Something isn't working label Sep 12, 2022
@ChristopherHX
Copy link
Contributor

actions/cache and it's actions/toolkit api are not supported in act.

See #285, #329

If you are ok to disable cache, while using act try this

            - name: Use Node.js ${{ matrix.node-version }}
              uses: actions/setup-node@v2
              with:
                  node-version: ${{ matrix.node-version }}
                  cache: ${{ !env.ACT && 'npm' || '' }} # Disable cache for nektos/act

I built an act replacement with an actions/cache api server, it is technically possible to have this feature. No plans to add this feature to act from my side

@KnisterPeter
Copy link
Member

It's as well doable with plain act, if you run an API compatible server.

@mStirner
Copy link
Author

Thank you. Seems like it works now.
But what i observed is that the jobs fail localy, but runs fine on github.

[Node.js CI/build-11] 🏁  Job failed
|       ✔ Should fire after 100ms (100ms)
|       ✔ Should fire immediatly
| 
|   System
|     system/hooks
|       ✔ use(); should always pass as last argument a "next" function
|     system/middleware
|       ✔ has a "use" function
|       ✔ has a "start" function
|       ✔ has a "catch" function
|       use(); function
|         ✔ should throw a error if "next" first/error argument is anything other than Error/undefined/null
|         ✔ basic flow
|         ✔ use(); should always pass as last argument a "next" function
|         ✔ use(); should pass arguments
|         ✔ use(); modifie passed arguments
|         ✔ use(); do not modifie un-passed arguments to "next()"
|       start(); function
|         ✔ start(); should execute callback
|         ✔ should pass arguments to callback
|       catch(); function
|         ✔ catch(); passed error to "next()"
|     system/component
|       base
|         - should have following properties
|           ✔ should have property .events
|           ✔ should have property .hooks
|           ✔ should have property .ready
|         - should have following methods
|           ✔ should have method init
|       common
|         - should have following properties
|           ✔ should have property .logger
|         - should have following methods
|           ✔ should have method _defineMethod
|       component
|         - should have following properties
|           ✔ should have property .items
|           ✔ should have property .collection
|           ✔ should have property .schema
|         - should have following methods
|           ✔ should have method "get"
|           ✔ should have method "add"
|           ✔ should have method "update"
|           ✔ should have method "remove"
|           ✔ should have method "find"
|         - should *not* have other items than the following  (excluding native object properties)
|           ✔ have allowed item/propertie/method: ready
|           ✔ have allowed item/propertie/method: events
|           ✔ have allowed item/propertie/method: hooks
|           ✔ have allowed item/propertie/method: logger
|           ✔ have allowed item/propertie/method: items
|           ✔ have allowed item/propertie/method: collection
|           ✔ have allowed item/propertie/method: schema
|           ✔ have allowed item/propertie/method: add
|           ✔ have allowed item/propertie/method: get
|           ✔ have allowed item/propertie/method: remove
|           ✔ have allowed item/propertie/method: update
|           ✔ have allowed item/propertie/method: find
|           ✔ have allowed item/propertie/method: _defineMethod
|           ✔ have allowed item/propertie/method: _mapMethod
|           ✔ have allowed item/propertie/method: _ready
|           ✔ have allowed item/propertie/method: init
| 
| 
|   88 passing (771ms)
|   3 failing
| 
|   1) Helper functions
|        helper/request
|          - [GET] Return http status code 200:
|      Uncaught TypeError: Cannot destructure property 'status' of 'undefined' as it is undefined.
|       at /home/marc/projects/OpenHaus/backend/tests/helper/test.request.js:9:56
|       at /home/marc/projects/OpenHaus/backend/helper/request.js:98:13
|       at ClientRequest.<anonymous> (helper/request.js:52:9)
|       at ClientRequest.emit (node:events:527:28)
|       at Socket.socketErrorListener (node:_http_client:454:9)
|       at Socket.emit (node:events:527:28)
|       at emitErrorNT (node:internal/streams/destroy:164:8)
|       at emitErrorCloseNT (node:internal/streams/destroy:129:3)
|       at processTicksAndRejections (node:internal/process/task_queues:83:21)
| 
|   2) Helper functions
|        helper/request
|          - [GET] Do not follow redirect:
|      Uncaught TypeError: Cannot destructure property 'status' of 'undefined' as it is undefined.
|       at /home/marc/projects/OpenHaus/backend/tests/helper/test.request.js:22:20
|       at /home/marc/projects/OpenHaus/backend/helper/request.js:98:13
|       at ClientRequest.<anonymous> (helper/request.js:52:9)
|       at ClientRequest.emit (node:events:527:28)
|       at Socket.socketErrorListener (node:_http_client:454:9)
|       at Socket.emit (node:events:527:28)
|       at emitErrorNT (node:internal/streams/destroy:164:8)
|       at emitErrorCloseNT (node:internal/streams/destroy:129:3)
|       at processTicksAndRejections (node:internal/process/task_queues:83:21)
| 
|   3) Helper functions
|        helper/request
|          - [GET] Follow redirect:
|      Uncaught TypeError: Cannot destructure property 'body' of 'undefined' as it is undefined.
|       at /home/marc/projects/OpenHaus/backend/tests/helper/test.request.js:36:20
|       at /home/marc/projects/OpenHaus/backend/helper/request.js:98:13
|       at ClientRequest.<anonymous> (helper/request.js:52:9)
|       at ClientRequest.emit (node:events:527:28)
|       at Socket.socketErrorListener (node:_http_client:454:9)
|       at Socket.emit (node:events:527:28)
|       at emitErrorNT (node:internal/streams/destroy:164:8)
|       at emitErrorCloseNT (node:internal/streams/destroy:129:3)
|       at processTicksAndRejections (node:internal/process/task_queues:83:21)
| 
| 
| 
[Node.js CI/build-12]   ❌  Failure - Main npm test
[Node.js CI/build-12] exitcode '3': failure
[Node.js CI/build-12] 🏁  Job failed
Error: Job 'build' failed

Successful: https://github.com/mStirner/backend/actions/runs/3033506191/jobs/4881775372

For me it looks like the service "httpbin" with the image "kennethreitz/httpbin" is not started.
Can you please tell me why?

@ChristopherHX
Copy link
Contributor

ChristopherHX commented Sep 13, 2022

Services are not currently implemented in act.
This needs work existing PR's

Edit Removed mentioning my other project, see edits if you really want to see it.

It's as well doable with plain act, if you run an API compatible server.

I even think someone has created a docker image for that.

@mStirner
Copy link
Author

Thank you very much for that clarification.

@ChristopherHX
Copy link
Contributor

@ChristopherHX ChristopherHX reopened this Sep 15, 2022
@github-actions
Copy link
Contributor

Issue is stale and will be closed in 14 days unless there is new activity

@github-actions github-actions bot added the stale label Oct 16, 2022
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Oct 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working stale
Projects
None yet
Development

No branches or pull requests

3 participants