Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.


Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Bookmarks
  • Search
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

Cloudron Forum

Apps | Demo | Docs | Install
  1. Cloudron Forum
  2. Surfer
  3. Surfer CLI 5.11.0 fails to upload

Surfer CLI 5.11.0 fails to upload

Scheduled Pinned Locked Moved Solved Surfer
17 Posts 4 Posters 2.8k Views 3 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • nebulonN Offline
    nebulonN Offline
    nebulon
    Staff
    wrote on last edited by
    #6

    Interesting behavior. For a start I've published the latest cli version to npm (so cloudron-surfer@5.12.1 )
    This version has the syncing/uploading parts rewritten to avoid re-uploading unchanged files.
    Could you update this and see where it breaks then? 🙂

    fbartelsF 1 Reply Last reply
    0
    • nebulonN nebulon

      Interesting behavior. For a start I've published the latest cli version to npm (so cloudron-surfer@5.12.1 )
      This version has the syncing/uploading parts rewritten to avoid re-uploading unchanged files.
      Could you update this and see where it breaks then? 🙂

      fbartelsF Offline
      fbartelsF Offline
      fbartels
      App Dev
      wrote on last edited by
      #7

      Updating is easy.

      + surfer --version
      5.12.1
      + stat public/.
        File: public/.
        Size: 242       	Blocks: 0          IO Block: 4096   directory
      Device: 21h/33d	Inode: 4999809     Links: 1
      Access: (0755/drwxr-xr-x)  Uid: (    0/    root)   Gid: (    0/    root)
      Access: 1754-08-30 22:43:41.000000000
      Modify: 2020-12-09 13:41:18.000000000
      Change: 2020-12-09 13:41:18.000000000
      
      + touch public/
      + surfer put --token $SURFTOKEN --server blog.9wd.eu public/* /
      Using server https://blog.9wd.eu
      /usr/local/lib/node_modules/cloudron-surfer/cli/actions.js:324
                      if (remote.filePath !== path.join(absoluteDestPath, local.filePath)) return false;
                                                                                ^
      
      TypeError: Cannot read property 'filePath' of undefined
          at /usr/local/lib/node_modules/cloudron-surfer/cli/actions.js:324:75
          at Array.find (<anonymous>)
          at /usr/local/lib/node_modules/cloudron-surfer/cli/actions.js:323:33
          at Array.filter (<anonymous>)
          at /usr/local/lib/node_modules/cloudron-surfer/cli/actions.js:322:36
          at Request.callback (/usr/local/lib/node_modules/cloudron-surfer/node_modules/superagent/lib/node/index.js:894:12)
          at /usr/local/lib/node_modules/cloudron-surfer/node_modules/superagent/lib/node/index.js:1127:20
          at IncomingMessage.<anonymous> (/usr/local/lib/node_modules/cloudron-surfer/node_modules/superagent/lib/node/parsers/json.js:22:7)
          at Stream.emit (events.js:326:22)
          at Unzip.<anonymous> (/usr/local/lib/node_modules/cloudron-surfer/node_modules/superagent/lib/node/unzip.js:53:12)
      
      1 Reply Last reply
      0
      • nebulonN Offline
        nebulonN Offline
        nebulon
        Staff
        wrote on last edited by
        #8

        Hm looking at the code I can't seem to figure out how that could ever be undefined, I need to debug this and thus be able to reproduce it. Do you have any idea how we could do that?
        Given the other atime issue, I am a bit worried about either the node version in your image or some other stripped down dependency causing this. I don't want to put code guards in to just not make it crash without understanding the root cause.

        I guess I have to spin up a node:lts-alpine3.12 container and see if I can reproduce this, or do you have your exact setup as a public image I could just docker pull?

        fbartelsF 1 Reply Last reply
        0
        • nebulonN nebulon

          Hm looking at the code I can't seem to figure out how that could ever be undefined, I need to debug this and thus be able to reproduce it. Do you have any idea how we could do that?
          Given the other atime issue, I am a bit worried about either the node version in your image or some other stripped down dependency causing this. I don't want to put code guards in to just not make it crash without understanding the root cause.

          I guess I have to spin up a node:lts-alpine3.12 container and see if I can reproduce this, or do you have your exact setup as a public image I could just docker pull?

          fbartelsF Offline
          fbartelsF Offline
          fbartels
          App Dev
          wrote on last edited by
          #9

          The timestamp issue seems to be already known for Hugo (which is what I am using for my blog): https://github.com/gohugoio/hugo/issues/6161

          You could pull my image from https://hub.docker.com/r/fbartels/cloudron-surfer.

          If you think this could have something to do with the alpine image I am also open to converting it into a Debian based one.

          nebulonN 1 Reply Last reply
          0
          • fbartelsF fbartels

            The timestamp issue seems to be already known for Hugo (which is what I am using for my blog): https://github.com/gohugoio/hugo/issues/6161

            You could pull my image from https://hub.docker.com/r/fbartels/cloudron-surfer.

            If you think this could have something to do with the alpine image I am also open to converting it into a Debian based one.

            nebulonN Offline
            nebulonN Offline
            nebulon
            Staff
            wrote on last edited by
            #10

            @fbartels who do you run surfer within that image in your case? Is there a volume mounted into the container which you then run the surfer put against?

            V fbartelsF 2 Replies Last reply
            0
            • nebulonN nebulon

              @fbartels who do you run surfer within that image in your case? Is there a volume mounted into the container which you then run the surfer put against?

              V Offline
              V Offline
              vjvanjungg
              wrote on last edited by
              #11

              @nebulon Also experiencing this issue (Surfer CLI 5.12.1). Seems to happen with Hugo. Last I tried with Gridsome it worked.

              /usr/local/lib/node_modules/cloudron-surfer/cli/actions.js:324
                              if (remote.filePath !== path.join(absoluteDestPath, local.filePath)) return false;
                                                                                        ^
              TypeError: Cannot read property 'filePath' of undefined
                  at /usr/local/lib/node_modules/cloudron-surfer/cli/actions.js:324:75
                  at Array.find (<anonymous>)
                  at /usr/local/lib/node_modules/cloudron-surfer/cli/actions.js:323:33
                  at Array.filter (<anonymous>)
                  at /usr/local/lib/node_modules/cloudron-surfer/cli/actions.js:322:36
                  at Request.callback (/usr/local/lib/node_modules/cloudron-surfer/node_modules/superagent/lib/node/index.js:894:12)
                  at /usr/local/lib/node_modules/cloudron-surfer/node_modules/superagent/lib/node/index.js:1127:20
                  at IncomingMessage.<anonymous> (/usr/local/lib/node_modules/cloudron-surfer/node_modules/superagent/lib/node/parsers/json.js:22:7)
                  at Stream.emit (events.js:315:20)
                  at Unzip.<anonymous> (/usr/local/lib/node_modules/cloudron-surfer/node_modules/superagent/lib/node/unzip.js:53:12)
              
              1 Reply Last reply
              0
              • nebulonN Offline
                nebulonN Offline
                nebulon
                Staff
                wrote on last edited by
                #12

                Hm I can't really reproduce this on my side, neither with using @fbartels alpine based image nor otherwise.

                Maybe I am misunderstanding the use-case though, so if I simply run:

                run fbartels/cloudron-surfer:5.12.1 surfer put --server https://files.nebulon.space  --token $TOKEN /var/ /
                

                this works just fine.

                1 Reply Last reply
                0
                • nebulonN nebulon

                  @fbartels who do you run surfer within that image in your case? Is there a volume mounted into the container which you then run the surfer put against?

                  fbartelsF Offline
                  fbartelsF Offline
                  fbartels
                  App Dev
                  wrote on last edited by
                  #13

                  In my case the surfer container is run as part of a Drone pipeline, so the pwd is /drone/src at the time of execution. Based on @vjvanjungg comment I also tried it now directly on my system and while an almost blank Hugo blog succeeds in uploading with the server cli, a build of my blog shows the exact same error (maybe that makes it easier to debug, since I can then easily modify files).

                  @nebulon said in Surfer CLI 5.11.0 fails to upload:

                  Maybe I am misunderstanding the use-case though, so if I simply run:

                  yes, almost. except that I am using a * to upload all files in that folder.

                  Hmm. also their example site uploads just fine... https://github.com/gohugoio/hugoBasicExample. So it must be something in relation to the file that get generated for my blog.

                  1 Reply Last reply
                  0
                  • girishG Offline
                    girishG Offline
                    girish
                    Staff
                    wrote on last edited by
                    #14

                    @nebulon Could it be crash is because of https://git.cloudron.io/cloudron/surfer/-/blob/master/cli/actions.js#L56 ? It should be returning tmp ? Because it then gets passed to concat (as undefined) and thus the crash ?

                    nebulonN 1 Reply Last reply
                    0
                    • girishG girish

                      @nebulon Could it be crash is because of https://git.cloudron.io/cloudron/surfer/-/blob/master/cli/actions.js#L56 ? It should be returning tmp ? Because it then gets passed to concat (as undefined) and thus the crash ?

                      nebulonN Offline
                      nebulonN Offline
                      nebulon
                      Staff
                      wrote on last edited by
                      #15

                      @girish that must be it! I will prepare a new update for the cli then.

                      1 Reply Last reply
                      0
                      • nebulonN Offline
                        nebulonN Offline
                        nebulon
                        Staff
                        wrote on last edited by
                        #16

                        At least for the undefined bug this should then hopefully be fixed with cloudron-surfer@5.12.2 cli.

                        fbartelsF 1 Reply Last reply
                        3
                        • nebulonN nebulon

                          At least for the undefined bug this should then hopefully be fixed with cloudron-surfer@5.12.2 cli.

                          fbartelsF Offline
                          fbartelsF Offline
                          fbartels
                          App Dev
                          wrote on last edited by
                          #17

                          @nebulon thanks! Indeed the upload now succeeds with the new version. For the wrong timestamp i'll just touch the folder once before calling surfer. Maybe it eventually gets fixed in hugo itself.

                          1 Reply Last reply
                          0
                          Reply
                          • Reply as topic
                          Log in to reply
                          • Oldest to Newest
                          • Newest to Oldest
                          • Most Votes


                          • Login

                          • Don't have an account? Register

                          • Login or register to search.
                          • First post
                            Last post
                          0
                          • Categories
                          • Recent
                          • Tags
                          • Popular
                          • Bookmarks
                          • Search