Giter Site home page Giter Site logo

Comments (19)

incoming-th avatar incoming-th commented on July 17, 2024 2

Did more testings about this error using the Bref readme as sample.

Test 1
create in Windows and deploy from Windows => Internal server error

Test 2
create in Windows, use VirtualBox with LinuxMint with shared folder, deploy from Linux => Internal server error

Test 3
create in Windows, use VirtualBox with LinuxMint with shared folder, copy files into linux, deploy from Linux => Internal server error

Test 4
create in Linux, deploy from Linux => Success

Test 5
create in Windows, deploy from Windows adding the "mode" parameters in serverless.yml as discussed in this thread => Internal server error
I have checked the serverless doc and there is no reference to this "mode" variable (Serverless.yml Reference)

Will continue to investigate as it is important to be able to use Bref from any OS to help having more people interested in it. But for now the best for Windows user (like me) is to develop in dual-boot or use VirtualBox with Ubuntu or LinuxMint or any other flavor to directly develop your app.

from bref.

mnapoli avatar mnapoli commented on July 17, 2024

Hi, you will need to have a look into the logs on cloudwatch (or using vendor/bin/bref logs).

from bref.

g87andres avatar g87andres commented on July 17, 2024

I am getting the same error... here are my logs from cloudwatch

2018-11-05T02:23:18.961Z c2533785-e0a1-11e8-a0d3-edabfbcdb17b Error: spawn EACCES
at exports._errnoException (util.js:1018:11)
at ChildProcess.spawn (internal/child_process.js:319:11)
at exports.spawn (child_process.js:378:9)
at exports.handle (/var/task/handler.js:39:18)

from bref.

mnapoli avatar mnapoli commented on July 17, 2024

@g87andres is it with Laravel too? Have you changed serverless.yml or handler.js in any way? What is your Bref version?

Please try removing the .bref directory and try deploying again.

from bref.

paulycloud avatar paulycloud commented on July 17, 2024

@mnapoli and @g87andres. I have the same cloudwatch error logs as well. After researching online, it has something to do with the read permissions on the zip file generated and upload to S3.

I am using a windows machine. Is there a way to ensure the zip file has the correct read permissions on it?

Some of the suggestions I found were adding the "mode" property to the severless.yml file for this:

mode: 0644 # change mode for all files
 include:
    - handler.js
    - bref.php

from bref.

mnapoli avatar mnapoli commented on July 17, 2024

Oh that's interesting, @g87andres are you on Windows too?

@paulkamau2015 you can edit the serverless.yml file and try that?

from bref.

paulycloud avatar paulycloud commented on July 17, 2024

@mnapoli , I did try updating the serverless.yml but it did not work, unfortunately. the same error appears. I also tried to set the permissions to "everyone" on S3 for the zip file but that did not work as well.

from bref.

g87andres avatar g87andres commented on July 17, 2024

Yes I am on windows as well. If I deploy the same code via a Linux VM everything works fine.

Very odd

from bref.

paulycloud avatar paulycloud commented on July 17, 2024

@mnapoli and @g87andres, Is there anything that can be done for people with windows machines? I would really love to get this working.

from bref.

mnapoli avatar mnapoli commented on July 17, 2024

@paulkamau2015 I have no idea as I do not work with Windows. We have to find a solution together :) Have you looked into the "serverless" project issues to see if there's an open issue there? Feel free to link interesting issues/links here so that others can investigate too.

from bref.

slootjes avatar slootjes commented on July 17, 2024

This is because the php binary needs to be given execute permissions which Windows is unable to do. The solution would be to deploy from a VM or container.

from bref.

mnapoli avatar mnapoli commented on July 17, 2024

Right that seems like a lost cause, though I'm not a Windows expert :/

See adieuadieu/serverless-chrome#21 they seem to have the same problem (I guess they deploy the Chrome binary, and if you deploy from Windows the binary is missing the execution permissions).

Help is welcome!

from bref.

incoming-th avatar incoming-th commented on July 17, 2024

Hi,

Just to unfortunately confirm the same bug. Just followed the sample on the readme and got "Internal server error" from API endpoint.

Then tested directly in lambda and this is what it is shown (not really helpful)

2018-12-04 003371

If this is permission issue from Windows then we need another way to deploy.

Did the exact same tests on Ubuntu and no issue during deploy command, which kind of confirm this is Windows related issue. Maybe create a docker during deployment process to help to deploy to Lambda?

from bref.

incoming-th avatar incoming-th commented on July 17, 2024

More investigations by comparing a ZIP from Windows not working and a ZIP from Linux working.

I think the issue is in the exec flag not set from a Windows ZIP on the php binary and the opcache modules.

@mnapoli Should we continue to investigate this issue or will it be resolved if you change the logic to use a layer in lambda?

2018-12-05 003372

2018-12-05 003373

2018-12-05 003374

from bref.

mnapoli avatar mnapoli commented on July 17, 2024

@mnapoli Should we continue to investigate this issue or will it be resolved if you change the logic to use a layer in lambda?

Yes so in #99 I check out AWS SAM and this is a serious alternative to Serverless. I think it's very likely v0.3 of Bref goes that way. However I don't know if SAM works on Windows?

https://github.com/mnapoli/bref-bootstrap-benchmarks uses SAM btw if you want to try it out.

from bref.

incoming-th avatar incoming-th commented on July 17, 2024

@mnapoli I did not try the 0.3 yet, but for what I read this should resolve this issue once and for all. Correct?

from bref.

mnapoli avatar mnapoli commented on July 17, 2024

At the moment it's not stable at all. But I don't know if AWS SAM is compatible with Windows. If it is then yes it will probably work much better.

from bref.

mnapoli avatar mnapoli commented on July 17, 2024

AWS SAM seems to be compatible with Windows so v0.3 should solve the problem (https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-install-windows.html).

from bref.

mnapoli avatar mnapoli commented on July 17, 2024

I'll close this for now since 0.3 should fix this. If there are still issues let's open a separate issue because the whole discussion here will be obsolete (v0.3 changes a lot of things regarding deployment).

from bref.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.