Jump to content

Invalid Argument Exception


Recommended Posts

Hi all,

 

i have noticed over the last few days i am getting this in my activity log in the admin panel.

 

Everything seems to be working however this appears every now and again.

=====

Exception: InvalidArgumentException: Query string must not include a URI fragment in /home/danumhos/public_html/vendor/zendframework/zend-diactoros/src/Uri.php:386 Stack trace: #0 /home/danumhos/public_html/vendor/zendframework/zend-diactoros/src/ServerRequestFactory.php(280): Zend\Diactoros\Uri->withQuery('language=portug...') #1 /home/danumhos/public_html/vendor/zendframework/zend-diactoros/src/ServerRequestFactory.php(66): Zend\Diactoros\ServerRequestFactory::marshalUriFromServer(Array, Array) #2 /home/danumhos/public_html/vendor/whmcs/whmcs-foundation/lib/Http/Message/ServerRequest.php(0): Zend\Diactoros\ServerRequestFactory::fromGlobals(Array, NULL, NULL, NULL, Array) #3 /home/danumhos/public_html/index.php(0): WHMCS\Http\Message\ServerRequest::fromGlobals() #4 {main}

=====

Has anyone had this issue before and know how i could fix it?

Link to comment
Share on other sites

  • WHMCS Technical Analyst II

Hi @Mark Coates

These entries in the logs indicate that a non-existent knowlegebase or announcement page is being accessed. This could either by a web-spider or a automated bot.

It is not a cause for concern, but you may wish to review your website links to ensure that there are no dead links.

Link to comment
Share on other sites

  • 1 year later...

As SamP said, the warnings are triggered by bots/visitors browsing dead links. To avoid such problems you should force a redirect to another page (e.g. home page) as soon as you detect that they're requesting a dead link. Alternatively you can also run a brutal die(); but in this case you're going to lose a potential visitor that could be interest in your products.

Edited by Kian
Link to comment
Share on other sites

  • 4 months later...

I also got this error and would be grateful for more details on the fix:

Quote

To avoid such problems you should force a redirect to another page (e.g. home page) as soon as you detect that they're requesting a dead link.

How and where to put the redirect - do you mean e.g. a 301 htaccess redirect?  Kindly provide the specifics.  Thanks

Link to comment
Share on other sites

  • 4 months later...

I first encountered this error myself after an update.. i could get into my admin area, and that's where i noticed this in the activity log widget:  "WHMCS\Http\Message\ServerRequest::fromGlobals() #4 {main}" immediately upon discovery i tried to navigate to check possible addons for the issue, and running version 8.0.2 i tried to go to my general settings page, and caught the error myself. Since i caught it in the admin side of things i decided to give it a whirl on the client area... i tried the knowledge base link, and then i got a 404 error.  and thats when i realized that my issue was with friendly URLS... and this was just a side effect.

Check your .htaccess file! if your .htaccess is missing from your whmcs root directory it could very well cause this error.  .htaccess files word recursively in linux, and what this means for anyone who doesn't know much about linux, is that if there is a .htaccess file in your root its rules apply to your ENTIRE site.  and it would effect both the admin area and the client area of the site. 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated