Laravel HTTP Code Error 413 - Trying to solve with Provided SOlution but failing
lightshire
PROOP

2 years ago

A solution was provided previously on adding an nginx file + a toml file

attached is the toml file shown

[variables]
UPLOAD_MAX_FILESIZE = '100M'
POST_MAX_SIZE = '100M'

[phases.setup]
cmds = ['UPLOAD_INI_PATH=$(find /nix/store/*-php-*/lib -name php.ini | rev | cut -c 9- | rev)/upload.ini; echo "upload_max_filesize=${UPLOAD_MAX_FILESIZE};" >> $UPLOAD_INI_PATH; echo "post_max_size=${POST_MAX_SIZE};" >> $UPLOAD_INI_PATH']
#11 ERROR: process "/bin/bash -ol pipefail -c UPLOAD_INI_PATH=$(find /nix/store/*-php-*/lib -name php.ini | rev | cut -c 9- | rev)/upload.ini; echo \"upload_max_filesize=${UPLOAD_MAX_FILESIZE};\" >> $UPLOAD_INI_PATH; echo \"post_max_size=${POST_MAX_SIZE};\" >> $UPLOAD_INI_PATH" did not complete successfully: exit code: 1

-----

> [ 7/14] RUN  UPLOAD_INI_PATH=$(find /nix/store/*-php-*/lib -name php.ini | rev | cut -c 9- | rev)/upload.ini; echo "upload_max_filesize=100M;" >> $UPLOAD_INI_PATH; echo "post_max_size=100M;" >> $UPLOAD_INI_PATH:

0.306 /bin/bash: line 1: $UPLOAD_INI_PATH: ambiguous redirect

0.306 /bin/bash: line 1: $UPLOAD_INI_PATH: ambiguous redirect

-----



Dockerfile:16

-------------------

14 |     # setup phase

15 |     COPY . /app/.

16 | >>> RUN  UPLOAD_INI_PATH=$(find /nix/store/*-php-*/lib -name php.ini | rev | cut -c 9- | rev)/upload.ini; echo "upload_max_filesize=${UPLOAD_MAX_FILESIZE};" >> $UPLOAD_INI_PATH; echo "post_max_size=${POST_MAX_SIZE};" >> $UPLOAD_INI_PATH

17 |

18 |     # install phase

-------------------

ERROR: failed to solve: process "/bin/bash -ol pipefail -c UPLOAD_INI_PATH=$(find /nix/store/*-php-*/lib -name php.ini | rev | cut -c 9- | rev)/upload.ini; echo \"upload_max_filesize=${UPLOAD_MAX_FILESIZE};\" >> $UPLOAD_INI_PATH; echo \"post_max_size=${POST_MAX_SIZE};\" >> $UPLOAD_INI_PATH" did not complete successfully: exit code: 1

This is a basic laravel application. Let me know if you need anything else to help

Solved

14 Replies

lightshire
PROOP

2 years ago

Sorry, I think its not possible to edit here's my updated build log

#2 [internal] load metadata for ghcr.io/railwayapp/nixpacks:ubuntu-1707782610



#2 DONE 0.7s





#3 [internal] load .dockerignore

#3 transferring context: 2B done

#3 DONE 0.0s



#4 [ 1/14] FROM ghcr.io/railwayapp/nixpacks:ubuntu-1707782610@sha256:8f4b0fd95dc3311cf9a59f236d8d7d7f956fe21a2a1d64b53c82f12c4e859f09

#4 DONE 0.0s





#5 [internal] load build context



#5 transferring context: 10.47MB 0.1s done

#5 DONE 0.1s



#6 [ 2/14] WORKDIR /app/

#6 CACHED





#7 [ 3/14] COPY .nixpacks/nixpkgs-5148520bfab61f99fd25fb9ff7bfbb50dad3c9db.nix .nixpacks/nixpkgs-5148520bfab61f99fd25fb9ff7bfbb50dad3c9db.nix

#7 CACHED



#8 [ 4/14] RUN nix-env -if .nixpacks/nixpkgs-5148520bfab61f99fd25fb9ff7bfbb50dad3c9db.nix && nix-collect-garbage -d

#8 CACHED



#9 [ 5/14] COPY .nixpacks/assets /assets/

#9 CACHED



#10 [ 6/14] COPY . /app/.



#10 DONE 0.2s





#11 [ 7/14] RUN  UPLOAD_INI_PATH=$(find /nix/store/*-php-*/lib -name php.ini | rev | cut -c 9- | rev)/upload.ini; echo "upload_max_filesize=100M;" >> $UPLOAD_INI_PATH; echo "post_max_size=100M;" >> $UPLOAD_INI_PATH



#11 0.306 /bin/bash: line 1: $UPLOAD_INI_PATH: ambiguous redirect

#11 0.306 /bin/bash: line 1: $UPLOAD_INI_PATH: ambiguous redirect



#11 ERROR: process "/bin/bash -ol pipefail -c UPLOAD_INI_PATH=$(find /nix/store/*-php-*/lib -name php.ini | rev | cut -c 9- | rev)/upload.ini; echo \"upload_max_filesize=${UPLOAD_MAX_FILESIZE};\" >> $UPLOAD_INI_PATH; echo \"post_max_size=${POST_MAX_SIZE};\" >> $UPLOAD_INI_PATH" did not complete successfully: exit code: 1

-----

> [ 7/14] RUN  UPLOAD_INI_PATH=$(find /nix/store/*-php-*/lib -name php.ini | rev | cut -c 9- | rev)/upload.ini; echo "upload_max_filesize=100M;" >> $UPLOAD_INI_PATH; echo "post_max_size=100M;" >> $UPLOAD_INI_PATH:

0.306 /bin/bash: line 1: $UPLOAD_INI_PATH: ambiguous redirect

0.306 /bin/bash: line 1: $UPLOAD_INI_PATH: ambiguous redirect

-----



Dockerfile:16

-------------------

14 |     # setup phase

15 |     COPY . /app/.

16 | >>> RUN  UPLOAD_INI_PATH=$(find /nix/store/*-php-*/lib -name php.ini | rev | cut -c 9- | rev)/upload.ini; echo "upload_max_filesize=${UPLOAD_MAX_FILESIZE};" >> $UPLOAD_INI_PATH; echo "post_max_size=${POST_MAX_SIZE};" >> $UPLOAD_INI_PATH

17 |

18 |     # install phase

-------------------

ERROR: failed to solve: process "/bin/bash -ol pipefail -c UPLOAD_INI_PATH=$(find /nix/store/*-php-*/lib -name php.ini | rev | cut -c 9- | rev)/upload.ini; echo \"upload_max_filesize=${UPLOAD_MAX_FILESIZE};\" >> $UPLOAD_INI_PATH; echo \"post_max_size=${POST_MAX_SIZE};\" >> $UPLOAD_INI_PATH" did not complete successfully: exit code: 1



Error: Docker build failed

2 years ago

Please use this to attach your build logs -

https://bookmarklets.up.railway.app/log-downloader/


lightshire
PROOP

2 years ago

Aplogies, here it is.

Attachments


2 years ago

Please attach your composer.json file.


lightshire
PROOP

2 years ago

here you go

Attachments


2 years ago

Okay, will try to reproduce.


lightshire
PROOP

2 years ago

Thank you @brody


2 years ago

I was able to reproduce the issue with your compose file, identified the issue, and updated the nixpacks.toml file -

https://gist.githubusercontent.com/brody192/ed12b50fd39e373a28d75f25b100a87d/raw/31fce3bee187544740e9f04d64ed9acd67c844ee/nixpacks.toml

Please let me know if this works for you.


lightshire
PROOP

2 years ago

Thank you, will do


lightshire
PROOP

2 years ago

I just passed the build mark, its working.

What was the issue?


lightshire
PROOP

2 years ago

Its built!. Thanks!!


2 years ago

The setup command dynamically picks a php path to insert a upload.ini file with the increased upload limit settings, but the previous command did not take into account the possibility of there being two paths returned, the new command will now only use the first of any of the returned path to create the upload.ini file with the increased values.


lightshire
PROOP

2 years ago

Thank you for this!


2 years ago

It may have built, but let me know if you can now upload files larger than 1MB.


Status changed to Solved Railway almost 2 years ago


Loading...