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

Error while deploying to Netlify #175

Closed
kaknut opened this issue Oct 27, 2020 · 12 comments
Closed

Error while deploying to Netlify #175

kaknut opened this issue Oct 27, 2020 · 12 comments

Comments

@kaknut
Copy link

kaknut commented Oct 27, 2020

Hey, I'm getting an error while deploying to Netlify. Can you please check?

I tried both (forking then deploying or just using the deploy to Netlify button), got an error.

8:23:42 PM: Build ready to start
8:23:43 PM: build-image version: b0258b965567defc4a2d7e2f2dec2e00c8f73ad6
8:23:43 PM: build-image tag: v3.4.1
8:23:43 PM: buildbot version: cdc66b02d86506251d3343610a77385376c8c035
8:23:43 PM: Fetching cached dependencies
8:23:44 PM: Failed to fetch cache, continuing with build
8:23:44 PM: Starting to prepare the repo for build
8:23:44 PM: No cached dependencies found. Cloning fresh repo
8:23:44 PM: git clone https://github.com/kaknut/Ackee
8:23:45 PM: Preparing Git Reference refs/heads/master
8:23:46 PM: Different functions path detected, going to use the one specified in the Netlify configuration file: 'functions' versus '' in the Netlify UI
8:23:46 PM: Starting build script
8:23:47 PM: Installing dependencies
8:23:47 PM: Python version set to 2.7
8:23:48 PM: Downloading and installing node v14.9.0...
8:23:48 PM: Downloading https://nodejs.org/dist/v14.9.0/node-v14.9.0-linux-x64.tar.xz...
8:23:49 PM: Computing checksum with sha256sum
8:23:49 PM: Checksums matched!
8:23:52 PM: Now using node v14.9.0 (npm v6.14.8)
8:23:52 PM: Started restoring cached build plugins
8:23:52 PM: Finished restoring cached build plugins
8:23:52 PM: Attempting ruby version 2.7.1, read from environment
8:23:53 PM: Using ruby version 2.7.1
8:23:54 PM: Using PHP version 5.6
8:23:54 PM: 5.2 is already installed.
8:23:54 PM: Using Swift version 5.2
8:23:54 PM: Started restoring cached node modules
8:23:54 PM: Finished restoring cached node modules
8:23:54 PM: Started restoring cached yarn cache
8:23:54 PM: Finished restoring cached yarn cache
8:23:54 PM: Installing yarn at version 1.22.4
8:23:54 PM: Installing Yarn!
8:23:54 PM: > Downloading tarball...
8:23:54 PM: [1/2]: https://yarnpkg.com/downloads/1.22.4/yarn-v1.22.4.tar.gz --> /tmp/yarn.tar.gz.YzQPn3twup
8:23:54 PM: % Total % Received % Xferd Average Speed Time Time Time Current
8:23:54 PM: Dload Upload Total Spent Left Speed
8:23:54 PM: 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
8:23:54 PM: 100 80 100 80 0 0 249 0 --:--:-- --:--:-- --:--:-- 250
8:23:54 PM: 100 93 100 93 0 0 150 0 --:--:-- --:--:-- --:--:-- 150
8:23:55 PM: 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
8:23:55 PM: 100 643 100 643 0 0 731 0 --:--:-- --:--:-- --:--:-- 2747
8:23:55 PM: 100 1215k 100 1215k 0 0 956k 0 0:00:01 0:00:01 --:--:-- 956k
8:23:55 PM: [2/2]: https://yarnpkg.com/downloads/1.22.4/yarn-v1.22.4.tar.gz.asc --> /tmp/yarn.tar.gz.YzQPn3twup.asc
8:23:55 PM: 100 84 100 84 0 0 3083 0 --:--:-- --:--:-- --:--:-- 3083
8:23:55 PM: 100 97 100 97 0 0 1787 0 --:--:-- --:--:-- --:--:-- 1787
8:23:55 PM: 100 647 100 647 0 0 7506 0 --:--:-- --:--:-- --:--:-- 7506
8:23:55 PM: 100 1028 100 1028 0 0 8140 0 --:--:-- --:--:-- --:--:-- 8140
8:23:55 PM: > Verifying integrity...
8:23:55 PM: gpg: Signature made Mon 09 Mar 2020 03:52:13 PM UTC using RSA key ID 69475BAA
8:23:55 PM: gpg: Good signature from "Yarn Packaging yarn@dan.cx"
8:23:55 PM: gpg: WARNING: This key is not certified with a trusted signature!
8:23:55 PM: gpg: There is no indication that the signature belongs to the owner.
8:23:55 PM: Primary key fingerprint: 72EC F46A 56B4 AD39 C907 BBB7 1646 B01B 86E5 0310
8:23:55 PM: Subkey fingerprint: 6D98 490C 6F1A CDDD 448E 4595 4F77 6793 6947 5BAA
8:23:55 PM: > GPG signature looks good
8:23:55 PM: > Extracting to ~/.yarn...
8:23:55 PM: > Adding to $PATH...
8:23:56 PM: > Successfully installed Yarn 1.22.4! Please open another terminal where the yarn command will now be available.
8:23:56 PM: Installing NPM modules using Yarn version 1.22.4
8:23:56 PM: yarn install v1.22.4
8:23:56 PM: [1/5] Validating package.json...
8:23:56 PM: [2/5] Resolving packages...
8:23:57 PM: [3/5] Fetching packages...
8:24:23 PM: info fsevents@2.1.3: The platform "linux" is incompatible with this module.
8:24:23 PM: info "fsevents@2.1.3" is an optional dependency and failed compatibility check. Excluding it from installation.
8:24:23 PM: [4/5] Linking dependencies...
8:24:23 PM: warning "apollo-server-lambda > apollo-server-core > graphql-upload@8.1.0" has incorrect peer dependency "graphql@0.13.1 - 14".
8:24:23 PM: warning "graphql-tools > @graphql-tools/links > apollo-upload-client@14.1.2" has unmet peer dependency "subscriptions-transport-ws@^0.9.0".
8:24:29 PM: [5/5] Building fresh packages...
8:24:31 PM: Done in 34.83s.
8:24:31 PM: NPM modules installed using Yarn
8:24:31 PM: Started restoring cached go cache
8:24:32 PM: Finished restoring cached go cache
8:24:32 PM: go version go1.14.4 linux/amd64
8:24:32 PM: go version go1.14.4 linux/amd64
8:24:32 PM: Installing missing commands
8:24:32 PM: Verify run directory
8:24:33 PM: ​
8:24:33 PM: ┌─────────────────────────────┐
8:24:33 PM: │ Netlify Build │
8:24:33 PM: └─────────────────────────────┘
8:24:33 PM: ​
8:24:33 PM: ❯ Version
8:24:33 PM: @netlify/build 5.0.3
8:24:33 PM: ​
8:24:33 PM: ❯ Flags
8:24:33 PM: deployId: 5f983476330b59ad74205623
8:24:33 PM: mode: buildbot
8:24:33 PM: ​
8:24:33 PM: ❯ Current directory
8:24:33 PM: /opt/build/repo
8:24:33 PM: ​
8:24:33 PM: ❯ Config file
8:24:33 PM: /opt/build/repo/netlify.toml
8:24:33 PM: ​
8:24:33 PM: ❯ Context
8:24:33 PM: production
8:24:34 PM: ​
8:24:34 PM: ┌────────────────────────────────────┐
8:24:34 PM: │ 1. build.command from netlify.toml │
8:24:34 PM: └────────────────────────────────────┘
8:24:34 PM: ​
8:24:34 PM: $ yarn build
8:24:34 PM: yarn run v1.22.4
8:24:34 PM: $ node build.js
8:24:34 PM: internal/modules/cjs/loader.js:895
8:24:34 PM: throw err;
8:24:34 PM: ^
8:24:34 PM: Error: Cannot find module 'rosid-handler-sass'
8:24:34 PM: Require stack:
8:24:34 PM: - /opt/build/repo/build.js
8:24:34 PM: at Function.Module._resolveFilename (internal/modules/cjs/loader.js:892:15)
8:24:34 PM: at Function.Module._load (internal/modules/cjs/loader.js:742:27)
8:24:34 PM: at Module.require (internal/modules/cjs/loader.js:964:19)
8:24:34 PM: at require (internal/modules/cjs/helpers.js:88:18)
8:24:34 PM: at Object. (/opt/build/repo/build.js:7:14)
8:24:34 PM: at Module._compile (internal/modules/cjs/loader.js:1075:30)
8:24:34 PM: at Object.Module._extensions..js (internal/modules/cjs/loader.js:1096:10)
8:24:34 PM: at Module.load (internal/modules/cjs/loader.js:940:32)
8:24:34 PM: at Function.Module._load (internal/modules/cjs/loader.js:781:14)
8:24:34 PM: at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12) {
8:24:34 PM: code: 'MODULE_NOT_FOUND',
8:24:34 PM: requireStack: [ '/opt/build/repo/build.js' ]
8:24:34 PM: }
8:24:34 PM: error Command failed with exit code 1.
8:24:34 PM: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
8:24:34 PM: ​
8:24:34 PM: ┌─────────────────────────────┐
8:24:34 PM: │ "build.command" failed │
8:24:34 PM: └─────────────────────────────┘
8:24:34 PM: ​
8:24:34 PM: Error message
8:24:34 PM: Command failed with exit code 1: yarn build
8:24:34 PM: ​
8:24:34 PM: Error location
8:24:34 PM: In build.command from netlify.toml:
8:24:34 PM: yarn build
8:24:34 PM: ​
8:24:34 PM: Resolved config
8:24:34 PM: build:
8:24:34 PM: command: yarn build
8:24:34 PM: commandOrigin: config
8:24:34 PM: environment:
8:24:34 PM: - ACKEE_ALLOW_ORIGIN
8:24:34 PM: - ACKEE_MONGODB
8:24:34 PM: - ACKEE_PASSWORD
8:24:34 PM: - ACKEE_PORT
8:24:34 PM: - ACKEE_TTL
8:24:34 PM: - ACKEE_USERNAME
8:24:34 PM: - NODE_VERSION
8:24:34 PM: - NODE_ENV
8:24:34 PM: functions: /opt/build/repo/functions
8:24:34 PM: publish: /opt/build/repo/dist
8:24:34 PM: redirects:
8:24:34 PM: - force: true
8:24:34 PM: from: /api
8:24:34 PM: status: 200
8:24:34 PM: to: /.netlify/functions/api
8:24:34 PM: Caching artifacts
8:24:34 PM: Started saving node modules
8:24:34 PM: Finished saving node modules
8:24:34 PM: Started saving build plugins
8:24:34 PM: Finished saving build plugins
8:24:34 PM: Started saving yarn cache
8:24:34 PM: Finished saving yarn cache
8:24:34 PM: Started saving pip cache
8:24:34 PM: Finished saving pip cache
8:24:34 PM: Started saving emacs cask dependencies
8:24:34 PM: Finished saving emacs cask dependencies
8:24:34 PM: Started saving maven dependencies
8:24:34 PM: Finished saving maven dependencies
8:24:34 PM: Started saving boot dependencies
8:24:34 PM: Finished saving boot dependencies
8:24:34 PM: Started saving go dependencies
8:24:34 PM: Finished saving go dependencies
8:24:38 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
8:24:38 PM: Failing build: Failed to build site
8:24:38 PM: Failed during stage 'building site': Build script returned non-zero exit code: 2
8:24:38 PM: Finished processing build request in 54.844624693s

@electerious
Copy link
Owner

I guess it's because rosid-handler-sass is part of the devDependencies, but shouldn't be, because you need it to start Ackee. Will fix this later today!

@kaknut
Copy link
Author

kaknut commented Oct 28, 2020 via email

@electerious
Copy link
Owner

I've released Ackee v2.1.1. Please let me know if this fixes the issue! :)

@kaknut
Copy link
Author

kaknut commented Oct 29, 2020

Thanks a lot, it deployed but there is another issue.

CORS header does get * value for tracker.js but when /api is called the no CORS header is present. This blocks Ackee from tracking.

@kaknut
Copy link
Author

kaknut commented Oct 29, 2020

Looks like cors header for /api needs to be set as an http response from api.js itself as Netlify functions follows /.Netlify which isn't managed by us.

@electerious
Copy link
Owner

It looks like ACKEE_ALLOW_ORIGIN isn't currently used in the serverless part of Ackee. Not sure if it's better to use the header options provided by Netlify anyway.

Need to give it another try. Thanks for letting me know!

@kaknut
Copy link
Author

kaknut commented Oct 30, 2020

Actually netlify.toml [headers] won't work on Ackee API (serverless functions).

The only way around is to respond with response headers (cors), have been trying (not a pro coder, trying what on the web). Nothing worked for me. Will let you know if I could find a way.

electerious added a commit that referenced this issue Nov 1, 2020
@electerious
Copy link
Owner

Ackee v2.2 is out. I've made several fixes and everything seems to work fine now! Thanks again for letting me know! Feel free to re-open the issue if I missed anything.

@kaknut
Copy link
Author

kaknut commented Nov 1, 2020

I just redeployed the latest version (using deploy to Netlify button), still facing the CORS issue.

@electerious
Copy link
Owner

What have you entered for ACKEE_ALLOW_ORIGIN? I've tested it with *.

@kaknut
Copy link
Author

kaknut commented Nov 2, 2020 via email

@kaknut
Copy link
Author

kaknut commented Nov 2, 2020

Got it.. * works. Had added "*".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants