Home Forums Support 403 Forbidden only when adding gateway

This topic contains 20 replies, has 2 voices, and was last updated by  Hillel Coren 6 months, 1 week ago.

Viewing 21 posts - 1 through 21 (of 21 total)
  • Author
    Posts
  • #19971

    ad_87
    Participant

    Hi

    I’m self hosting running v4.5.11.

    When I try to add a payment gateway I get a 403 Forbidden page. The rest of Invoice Ninja works fine. This is the only page where I get this error.

    From the laravel-error log:

    [2019-03-12 00:00:38] production.ERROR: ***Illuminate\Contracts\Encryption\DecryptException*** [0] : /home/XXXXX/public_html/invoice/vendor/laravel/framework/src/Illuminate/Encryption/Encrypter.php [Line 180] => The payload is invalid. {“context”:”PHP”,”user_id”:1,”account_id”:”1″,”user_name”:”XXXXX”,”method”:”GET”,”user_agent”:”Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:65.0) Gecko/20100101 Firefox/65.0″,”locale”:”en”,”ip”:”XXXXX”,”count”:11,”is_console”:”no”,”is_api”:”no”,”db_server”:”mysql”,”url”:”settings/online_payments”} []

    [2019-03-12 00:03:24] production.ERROR: ***Illuminate\Contracts\Encryption\DecryptException*** [0] : /home/XXXXX/public_html/invoice/vendor/laravel/framework/src/Illuminate/Encryption/Encrypter.php [Line 180] => The payload is invalid. {“context”:”PHP”,”user_id”:1,”account_id”:”1″,”user_name”:”XXXXX”,”method”:”GET”,”user_agent”:”Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:65.0) Gecko/20100101 Firefox/65.0″,”locale”:”en”,”ip”:”XXXXX”,”count”:14,”is_console”:”no”,”is_api”:”no”,”db_server”:”mysql”,”url”:”api/gateways”} []

    There were other topics I found here with this issue but no solution.
    There was mention (https://www.invoiceninja.com/forums/topic/troubleshooting-a-403-error/) of a mod_security rule causing the problem. However, this doesn’t mean anything to me. Perhaps someone can expand on this?

    Any help is appreciated.

    #19974

    Hillel Coren
    Keymaster

    The encrypter error implies it may be related to the APP_KEY in the .env file, have you moved the app or changed the key value?

    #19975

    ad_87
    Participant

    I actually recently updated the app manually by copying over the new files. I did run into some issues and ended up just deleting the whole invoice ninja folder and extracting the new version in its place.
    I’m still using the same database.

    Prior to updating I had not tried to add a payment gateway, so I can’t say if this issue existed before.

    • This reply was modified 6 months, 1 week ago by  ad_87.
    #19977

    Hillel Coren
    Keymaster

    In the future it would be helpful to share this info when first posting…

    Are there any rows in the account_gateways table?

    #19978

    ad_87
    Participant

    Sorry, didn’t think it was relevant.

    And account_gateways is empty. I haven’t configured any gateways yet. I actually tried to add one manually via phpmyadmin but couldn’t get that to work.
    I’m a little new to all this server and hosting stuff.

    #19979

    Hillel Coren
    Keymaster

    Is there a value set for APP_KEY in the .env file?

    You may want to try setting up a clean install and then transferring over your data.

    #19980

    ad_87
    Participant

    Yes, there is a value. I’m guessing this value is now different from the previous one and hence the conflict?
    Just for future reference, are there any other files that should remain intact when updating?

    As for clean install and transferring, could you please provide basic steps for doing that. Also, wouldn’t what I did with deleting the entire invoice ninja be considered a clean install?

    #19981

    Hillel Coren
    Keymaster

    If there is a row in the table marking it as archived/deleted may help.

    You need to keep the .env file and any documents you uploaded (ie, invoice attachments).

    #19982

    ad_87
    Participant

    account_gateways table? Nothing at all.
    May help with doing what? Sorry, it’s a little vague.

    Appreciate the help!

    #19983

    Hillel Coren
    Keymaster

    If the table is empty I’m not sure why you’re seeing the error.

    As a next step I’d suggest setting up a clean install of the app.

    #19984

    ad_87
    Participant

    Would it make things easier if I don’t mind losing all data? I haven’t used it much yet.

    #19985

    Hillel Coren
    Keymaster

    You should be able to transfer your data/settings using the JSON import/export.

    #19986

    ad_87
    Participant

    Okay, I just figured out how to JSON export/import via phpmyadmin.

    So, to make sure I understand this correctly, I would export the current database then import it to a new one? Wouldn’t this be the same as keeping the database then just linking back to it with a clean install. Because this is actually what I did when the update failed; I created a whole new invoice ninja then linked to the existing database.

    #19987

    Hillel Coren
    Keymaster

    The JSON export is in the app on Settings > Import/export

    You’d want to test with a blank new database.

    #19988

    ad_87
    Participant

    lol ok, silly me.

    I’ll give it a shot and report back.

    #20001

    ad_87
    Participant

    So I just completely started from new. Clean install and a new database but I’m still getting the same problem 🙁
    I didn’t even import the previous data, just started from new.

    Could it be an issue with proc_open not being enabled? After clean installing and during the initial setup, there was a warning message saying that I need to have proc_open enabled and I wasn’t able to proceed. However, I was somehow able to proceed without enabling it after many failed attempts (not sure how it worked, it was a fluke).
    This actually helped me recall that I had this same proc_open error when I first installed Invoice Ninja many months ago but had forgotten about it (I hadn’t really started using Invoice Ninja until just a few days ago; I was just setting up and preparing it). Even back then I was eventually able to get Invoice Ninja working.

    #20018

    Hillel Coren
    Keymaster

    It’s possible but I’m not sure if it’s the cause, proc_open usually causes problems when trying to update the app.

    #20024

    ad_87
    Participant

    Any other ideas?

    #20028

    Hillel Coren
    Keymaster

    Is it possible the new install isn’t completely clean? You may want to try setting up an totally fresh install on a different server.

    #20067

    ad_87
    Participant

    Well I deleted the Invoice Ninja folder on the server and created a new database. Does that count as completely clean?

    And I don’t exactly have access to another server…

    #20080

    Hillel Coren
    Keymaster

    It should be, in the past other users have had more than one codebase/database and have gotten them mixed up.

    Not sure what else to suggest. It seems like the problem was introduced by an update, starting from scratch should resolve it?

Viewing 21 posts - 1 through 21 (of 21 total)

You must be logged in to reply to this topic.

Posted in: