Download
We're evolving to serve you better! This current forum has transitioned to read-only mode. For new discussions, support, and engagement, we've moved to GitHub Discussions.

Publii GitLab Sync error

  • #8099
    Avatar photo[anonymous]

    I am using Publii 040.2 on Mac OS 12.5.1 and had no problems with my GitLab site over the last year until recently.
    Syncing my website to Gitlab now gives the error: “An error occurred while connecting to the server: Response code 400 (Bad Request)”.
    Help is greatly appreciated!

    The file deployment-process.log contains the following:

    [Sun, 21 Aug 2022 16:43:58 GMT] (!) TEXT FILES TO UPLOAD DETECTED
    [Sun, 21 Aug 2022 16:44:03 GMT] (!) COMMIT ERROR: {“name”:”HTTPError”,”timings”:{“start”:1661100238121,”socket”:1661100238130,”lookup”:1661100238130,”connect”:1661100238144,”secureConnect”:1661100238172,”upload”:1661100240689,”response”:1661100243685,”end”:1661100243685,”phases”:{“wait”:9,”dns”:0,”tcp”:14,”tls”:28,”request”:2517,”firstByte”:2996,”download”:0,”total”:5564}},”description”:”A file with this name already exists”}

    #8132
    Avatar photo[anonymous]

    I too have received this exact same error. however, I’m on Linux, specifically Linux lite, an Ubuntu variant. If i have to roll back an update fine but, why is this happening in the first place? It worked perfectly fine before. So if anyone else can help us that would be amazing

    #8182
    Avatar photo[anonymous]

    Hi, can you share your website backup in a private reply?

    #8194
    Avatar photo[anonymous]
    This reply has been marked as private.
    #8195
    Avatar photo[anonymous]
    This reply has been marked as private.
    #8197
    Avatar photo[anonymous]
    This reply has been marked as private.
    #8199
    Avatar photo[anonymous]

    Hi!

    I’m having the same issue on Windows 10 and Publii version 0.40.

    Thanks for your help.

    #8200
    Avatar photo[anonymous]
    This reply has been marked as private.
    #8201
    Avatar photo[anonymous]

    Ok, I have found a reason of the problem – the issue occurs when binary files needs to be uploaded to the Github.

    We will release a hot fix v.0.40.3 in the next week to solve this issue. I will let you know when it will be ready to download.

    #8204
    Avatar photo[anonymous]

    I just noticed that the message in the deployment-process.log is actually different for me. Instead of โ€A file with this name already existsโ€ as noted above, I get “A file with this name doesn’t exist”.

    The whole file’s content is as follows :

    [Sat, 03 Sep 2022 23:25:14 GMT] (!) CLIENT CREATED
    Founded 864 operations to do
    [Sat, 03 Sep 2022 23:25:36 GMT] (!) FILES TO REMOVE DETECTED
    [Sat, 03 Sep 2022 23:25:36 GMT] (!) REMOTE FILE DOWNLOADED
    [Sat, 03 Sep 2022 23:25:37 GMT] (!) COMMIT ERROR: {"name":"HTTPError","timings":{"start":1662247536049,"socket":1662247536050,"lookup":1662247536050,"connect":1662247536173,"secureConnect":1662247536400,"upload":1662247536402,"response":1662247537342,"end":1662247537343,"phases":{"wait":1,"dns":0,"tcp":123,"tls":227,"request":2,"firstByte":940,"download":1,"total":1294}},"description":"A file with this name doesn't exist"}
    

    I added the screenshot of the error message as an attachment.

    #8206
    Avatar photo[anonymous]

    Furthermore, I’m not aware of any binary file in my website’s content. I don’t know if there’s an explanation for it.

    #8212
    Avatar photo[anonymous]

    @iceberg53 – your issue also can come from the same bug. BTW images are also binary files ๐Ÿ™‚

    #8217
    Avatar photo[anonymous]

    Okay.

    I’ll then wait for the hot fix.

    Thanks for your support.

    #8222
    Avatar photo[anonymous]

    Hi,

    The hotfix has been released (v.0.40.3) – I strongly suggest to make a backup of the files on the repository.

    Then you can try to remove public catalog and publii.files.json file and do full resync (I suppose that due fact that repository is probably out of the sync, without removing files it will be impossible out of the box).

    If somethings goes wrong during resync – you will be able to restore previous state of public catalog and publii.files.json file using files from the backup.

    #8240
    Avatar photo[anonymous]

    Now my website synced OK, thank you very much for the hotfix!

    #8262
    Avatar photo[anonymous]

    Thanks for the hot fix.

    I’m ,however, still not able to sync my website and I keep getting the same error message I shared above.

    Testing the connection with the server yielded a result I’ve a hard time understanding.

    The error message states that Publii was able to connect to the server but unable to store files as the repository didn’t exist.

    I don’t understand why as my repository does exist even though I deleted the public folder and the publii.files.json file.

    The access token I used has no expiration date but I preferred creating a new one to make sure that it had nothing to do with it.

    So far, nothing seems to work.

    Any hint about solving this problem is very welcome.

    Thanks in advance.

    #8267
    Avatar photo[anonymous]

    Possible reasons:

    1) you have a typo in the repository name,
    2) given user has no access to the necessary repository
    3) your API key has no access to read/write repository data

    #8294
    Avatar photo[anonymous]

    Considering your suggestions, I tried to figure out what wasn’t working properly. I checked my repository name for a typo, I’m the owner of the repository and my access token has an api scope.

    I googled a bit and found that such an error might be related to my ssh keys. I then generated new ssh keys and added them to my Gitlab account, but it still didn’t work.

    Afterwards, I created a new repository with a gitlab-ci.yml and tried deploying. It worked flawlessly.

    I tried many other scenarios with my existing repo and the new one to figure out the problem.

    Ultimately, I concluded that as long as my target repo name is exactly the same as my username, I would keep getting the same error.

    I just had to rename my repository to be able to deploy.

    Thanks for your support and for developing Publii. I really like it.

    #8295
    Avatar photo[anonymous]

    Thanks for your feedback – I will check why repository name the same as user name can lead to the issues, and I will try to fix it in v.0.41 if possible ๐Ÿ™‚