<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>problems-solutions on Ainab's Journal</title><link>https://www.ainab.site/categories/problems-solutions/</link><description>Recent content in problems-solutions on Ainab's Journal</description><generator>Hugo -- gohugo.io</generator><language>en-us</language><lastBuildDate>Tue, 20 Sep 2022 00:00:00 +0000</lastBuildDate><atom:link href="https://www.ainab.site/categories/problems-solutions/index.xml" rel="self" type="application/rss+xml"/><item><title>Debug PHPUnit in Docker using PHPStorm</title><link>https://www.ainab.site/posts/debug-phpunit-with-phpstorm-and-docker/</link><pubDate>Tue, 20 Sep 2022 00:00:00 +0000</pubDate><guid>https://www.ainab.site/posts/debug-phpunit-with-phpstorm-and-docker/</guid><description>Problem I have a Docker setup that consists of:
A container that runs PHP A container that runs a MySQL database I am using PHPStorm for development and I would like to debug my PHPUnit tests that run inside of Docker container #1. However, when I try to do this, I get an error:
PDOException : SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo for tms-api-mysql failed: Name or service not known /var/www/html/vendor/illuminate/database/Connectors/Connector.</description></item><item><title>Gitlab CI/CD job is not showing up</title><link>https://www.ainab.site/posts/gitlab-ci-cd-not-showing-up/</link><pubDate>Wed, 31 Aug 2022 00:00:00 +0000</pubDate><guid>https://www.ainab.site/posts/gitlab-ci-cd-not-showing-up/</guid><description>This happened to me today: A Gitlab CI/CD job in a valid stage without any dependencies or rules was not showing up in my Gitlab CI/CD pipeline. It looked like this:
# Incorrect, job does NOT show up in pipeline as it is seen as a job template .e2e: image: cypress/browsers:node12.14.1-chrome85-ff81 stage: .post artifacts: when: always paths: - cypress/videos/**/*.mp4 - cypress/screenshots/**/*.png expire_in: 3 day script: - npm ci - npm run test:e2e After some experimenting I found out that the name of the job was the culprit.</description></item><item><title>Where is Gitlab's test coverage parsing setting</title><link>https://www.ainab.site/posts/where-is-gitlabs-test-coverage-parsing-setting/</link><pubDate>Thu, 23 Jun 2022 00:00:00 +0000</pubDate><guid>https://www.ainab.site/posts/where-is-gitlabs-test-coverage-parsing-setting/</guid><description>Today, I wanted to set the regular expression for my test coverage results in Gitlab.
According to Gitlab&amp;rsquo;s documentation image/svg+xml , I should be able to do that in the test coverage parsing setting in my project settings, by navigating to Settings &amp;gt; CI/CD &amp;gt; General pipelines.
Problem However, I could not find the setting there. So where can I set the regular expression for the test coverage parsing setting in Gitlab?</description></item><item><title>Setup Gitlab token for private composer packages</title><link>https://www.ainab.site/posts/setup-gitlab-token-for-private-composer-packages/</link><pubDate>Mon, 02 May 2022 00:00:00 +0000</pubDate><guid>https://www.ainab.site/posts/setup-gitlab-token-for-private-composer-packages/</guid><description>Have you ever received the following error?
[Composer\Downloader\TransportException] The &amp;quot;https://gitlab.my-gitlab-instance.com/api/v4/group/666/-/packages/composer/packages.json&amp;quot; file could not be downloaded (HTTP/2 404 ): {&amp;quot;message&amp;quot;:&amp;quot;404 Group Not Found&amp;quot;} I have, and it has kept me from doing my work several times. The readme files of several projects give some attention to this issue, but you might not be working in those specific projects when you encounter these terrible issues. This is why I wrote this short instructions post on Confluence; hopefully Confluence&amp;rsquo;s search feature will find this post everytime I (or you) run into the same ol' story and forget how to solve it.</description></item><item><title>Turn off Oblivion head bobbing</title><link>https://www.ainab.site/posts/oblivion-fix-head-bobbing/</link><pubDate>Fri, 15 Apr 2022 00:00:00 +0000</pubDate><guid>https://www.ainab.site/posts/oblivion-fix-head-bobbing/</guid><description>Every now and then I like to play my beloved Oblivion. To keep things interesting I have installed quite some mods over the years. At one point, however, my head started bobbing while walking and it seemed like I was in crouching mode when standing still. The problem persisted even until after I installed all my mods. Eventually I found the culprit, but to help other possible victims, I will list possible solutions to the problem of not being able to turn off head bobbing:</description></item><item><title>How to move an off-screen application window in Windows 11</title><link>https://www.ainab.site/posts/how-to-move-an-off-screen-application-window-in-windows-11/</link><pubDate>Wed, 09 Feb 2022 00:00:00 +0000</pubDate><guid>https://www.ainab.site/posts/how-to-move-an-off-screen-application-window-in-windows-11/</guid><description>As I frequently disconnect and connect monitors from and to my laptop, a bug(?) in Windows 11 causes the windows of application to disappear sometimes. This usually happens with [Zettlr](https://www.zettlr.com/), my note-taking app of choice. This frustrated me endlessly, as I want my notes to be easily accessible. But now I think I found a solution to make the window appear again.
Simply press alt + space whenever the disappeared window is active.</description></item><item><title>Add JavaScript to a custom block in Wordpress</title><link>https://www.ainab.site/posts/add-javascript-to-a-custom-block-in-wordpress/</link><pubDate>Sun, 23 Jan 2022 00:00:00 +0000</pubDate><guid>https://www.ainab.site/posts/add-javascript-to-a-custom-block-in-wordpress/</guid><description>Using Wordpress custom blocks, I&amp;rsquo;m currently trying to create a popover component that contains a button and a hidden content. The hidden content should appear when the user clicks on or hovers over the button (on the frontend of the website, not in the block editor).
Problem However, when I add an onClick or onHover to the button, the event handler is not executed.
Additionally, trying to use the useState hook to store the display state of the popover crashes my block editor.</description></item><item><title>SQL error with code 40531 when trying to fetch schema in Azure Database Sync</title><link>https://www.ainab.site/posts/sql-error-with-code-40531-when-trying-to-fetch-schema-in-azure-database-sync/</link><pubDate>Mon, 20 Dec 2021 00:00:00 +0000</pubDate><guid>https://www.ainab.site/posts/sql-error-with-code-40531-when-trying-to-fetch-schema-in-azure-database-sync/</guid><description>As I was trying to sync my Hub database to my Member database in Azure Database Sync, I got this error when trying to fetch the schema of the Hub database:
Getting schema information for the database failed with the exception &amp;quot;Failed to connect to server databasename-0182730712073.database.windows.net.Inner exception: SqlException ID: {someGuid}, Error Code: -2146232060 - SqlError Number:40531, Message: SQL error with code 40531 For more information, provide tracing ID ‘{someGuid}’ to customer support.</description></item><item><title>Behat: context class not found and can not be used.</title><link>https://www.ainab.site/posts/behat-context-class-not-found-and-can-not-be-used/</link><pubDate>Wed, 15 Dec 2021 00:00:00 +0000</pubDate><guid>https://www.ainab.site/posts/behat-context-class-not-found-and-can-not-be-used/</guid><description>If you are using Behat for testing your PHP application and you encounter the following error after trying to run your tests:
In UninitializedContextEnvironment.php line 44: Tests\\Feature\\Behat\\Context\\Account\\MyOldContext\\ context class not found and can not be used. Do not forget to remove your obsolete Behat Context file (MyOldContext in this case) from your behat.yml configuration file:
default: suites: default: paths: - &amp;#39;%paths.base%/tests/Feature/Behat/features&amp;#39; contexts: - Tests\\Feature\\Behat\\Context\\ApplicationContext # Remove the old context file - Tests\\Feature\\Behat\\Context\\MyOldContext - Tests\\Feature\\Behat\\Context\\EmailContext - Behat\\MinkExtension\\Context\\MinkContext - behatch:context:browser - behatch:context:debug - behatch:context:system - behatch:context:json - behatch:context:rest</description></item><item><title>Create an Azure SQL Server login and connect a user to it</title><link>https://www.ainab.site/posts/create-an-azure-sql-server-login-and-connect-a-user-to-it/</link><pubDate>Wed, 08 Dec 2021 00:00:00 +0000</pubDate><guid>https://www.ainab.site/posts/create-an-azure-sql-server-login-and-connect-a-user-to-it/</guid><description>In my previous post image/svg+xml I showed how you can convert a .bak file to a DAC file and how to fix any errors that may appear. For the same job, I had to add some new SQL logins and users after the migration of the database. This post serves as a notebook for how to do that.
\-- Execute this query in the &amp;#34;master&amp;#34; database -- Create new login CREATE LOGIN \[new-login\] WITH PASSWORD = &amp;#39;complex-password&amp;#39; GO -- Execute these queries in the target database -- Create a user and connect it to the login CREATE USER \[new-user\] FOR LOGIN \[new-login\] -- Create a role to execute stored procedures CREATE ROLE \[db\_executor\] AUTHORIZATION \[dbo\] GO GRANT EXECUTE TO \[db\_executor\] GO -- Give the user read/write/execute rights sp\_addrolemember @rolename = &amp;#39;tc\_execute&amp;#39;, @membername = &amp;#39;new-user&amp;#39; GO sp\_addrolemember @rolename = &amp;#39;db\_datareader&amp;#39;, @membername = &amp;#39;new-user&amp;#39; GO sp\_addrolemember @rolename = &amp;#39;db\_datawriter&amp;#39;, @membername = &amp;#39;new-user&amp;#39; GO -- Check if roles have been assigned to the user correctly SELECT UserType=&amp;#39;Role&amp;#39;, DatabaseUserName = &amp;#39;{Role Members}&amp;#39;, LoginName = DP2.</description></item><item><title>Fix a SQL database before exporting to a DAC .bacpac file</title><link>https://www.ainab.site/posts/fix-a-sql-database-before-exporting-to-a-dac-bacpac-file/</link><pubDate>Wed, 01 Dec 2021 00:00:00 +0000</pubDate><guid>https://www.ainab.site/posts/fix-a-sql-database-before-exporting-to-a-dac-bacpac-file/</guid><description>When you want to migrate an old (on-premise) SQL database to an Azure SQL database, you need to export the database to a DAC .bacpac file. Such an export also includes schemas, views and users/logins. It is easy to receive errors when attempting to make a .bacpac export. In this post, I sum up the errors I received and a way to fix them.
1. Drop Windows users In my case, the database that I wanted to migrate contained references to Windows users.</description></item><item><title>Wordpress cannot send emails to email addresses on its own domain</title><link>https://www.ainab.site/posts/wordpress-cannot-send-emails-to-email-addresses-on-its-own-domain/</link><pubDate>Sun, 28 Nov 2021 00:00:00 +0000</pubDate><guid>https://www.ainab.site/posts/wordpress-cannot-send-emails-to-email-addresses-on-its-own-domain/</guid><description>Imagine the following situation: You have a Wordpress website hosted on example.com. The host has a Plesk configuration panel. Your email is handled by Google Workspace. MX records have been configured for this in Plesk, as described here image/svg+xml . The website has a contact form that should send an email to you, the owner of the website, on info@example.com.
But&amp;hellip; the emails are not arriving.</description></item><item><title>IOException: Permission denied for .NET application running as a linux service</title><link>https://www.ainab.site/posts/ioexception-permission-denied-for-net-application-running-as-a-linux-service/</link><pubDate>Sat, 13 Nov 2021 00:00:00 +0000</pubDate><guid>https://www.ainab.site/posts/ioexception-permission-denied-for-net-application-running-as-a-linux-service/</guid><description>For an upload feature, my .NET application needs to upload a file to a newly created directory. My application is running as a linux service. Whenever the application tries to create a folder and add the file, I get an IOException:
An unhandled exception occurred while processing the request. IOException: Permission denied.
At first, I though I&amp;rsquo;d just chmod 777 the /var/bots folder and give full write permissions. It worked, but it would probably not be a viable and secure solution for the long term.</description></item><item><title>Github OAuth redirect_uri_mismatch for .NET App behind a Nginx Reverse Proxy</title><link>https://www.ainab.site/posts/github-oauth-redirect_uri_mismatch-for-net-app-behind-a-nginx-reverse-proxy/</link><pubDate>Thu, 11 Nov 2021 00:00:00 +0000</pubDate><guid>https://www.ainab.site/posts/github-oauth-redirect_uri_mismatch-for-net-app-behind-a-nginx-reverse-proxy/</guid><description>Let&amp;rsquo;s say we have a .NET app running on an virtual machine. The app uses Github OAuth for authentication. Inside the virtual machine, the app runs on http://127.0.0.1:5000. The app should be available on https://example.com, so I have created an entry in nginx to send all requests towards https://example.com to http://127.0.0.1:5000:
server { server\_name example.org www.example.org; listen 80; listen 443; location / { proxy\_pass https://127.0.0.1:5001/; } } So this works. My website can be reached from https://example.</description></item><item><title>How to add a search bar to an Upptime status page</title><link>https://www.ainab.site/posts/how-to-add-a-search-bar-to-an-upptime-status-page/</link><pubDate>Thu, 23 Sep 2021 00:00:00 +0000</pubDate><guid>https://www.ainab.site/posts/how-to-add-a-search-bar-to-an-upptime-status-page/</guid><description>Upptime image/svg+xml is a very neat tool that allows you to track the status of your websites and creates Github issues whenever a site has downtime. The extra neat aspect of Upptime is that it works entirely on Github. No hosting or cloud provider is necessary whatsoever, it all runs using Github Actions and Github Pages.
Upptime is not perfect (yet) though. It misses some features that would make it perfect for me.</description></item><item><title>Force HTTPS on your WordPress website</title><link>https://www.ainab.site/posts/force-https-on-your-wordpress-website/</link><pubDate>Tue, 21 Sep 2021 00:00:00 +0000</pubDate><guid>https://www.ainab.site/posts/force-https-on-your-wordpress-website/</guid><description>You have finally installed that SSL certificate to your website and now the website keeps hanging in an unsafe http connection. What is up with that?
To force a HTTPS connection, we only have to add some lines to the .htaccess file, which is located in the root of the public html folder of your WordPress website:
.htaccess is located in the public html folder of your WordPress website, which is the same folder that contains the wp-admin, wp-content, and wp-includes folder.</description></item><item><title>phpMyAdmin - Error | Incorrect format parameter</title><link>https://www.ainab.site/posts/phpmyadmin-error-incorrect-format-parameter/</link><pubDate>Sun, 15 Aug 2021 00:00:00 +0000</pubDate><guid>https://www.ainab.site/posts/phpmyadmin-error-incorrect-format-parameter/</guid><description>If you are ever trying to import a (large) existing database through phpMyAdmin and you are getting the following error, you might want to check your php.ini file.
\# File: php.ini memory\_limit = 256M post\_max\_size = 128M upload\_max\_filesize = 128M max\_execution\_time = 600 max\_input\_time = 600 Try increasing the values image/svg+xml of the configuration variables until you get successful results.
If you are using Docker to boot up your phpMyAdmin instance, you might also want to check the UPLOAD_LIMIT environment variable in your docker-compose.</description></item><item><title>Typescript module resolution for test files in VS Code</title><link>https://www.ainab.site/posts/typescript-module-resolution-for-test-files-in-vs-code/</link><pubDate>Mon, 09 Aug 2021 00:00:00 +0000</pubDate><guid>https://www.ainab.site/posts/typescript-module-resolution-for-test-files-in-vs-code/</guid><description>In a Typescript project I am working on, I use tsconfig&amp;rsquo;s paths property to create local modules that I can refer to in the project&amp;rsquo;s import without having to type a long relative directory.
E.g. Instead of typing:
import { module } from &amp;#39;../../../modules/module&amp;#39;; I want to type:
import { module } from &amp;#39;@modules/module&amp;#39;; To accomplish this, I have added the paths property to my root-level tsconfig.json file:
// Root-level tsconfig // File: .</description></item><item><title>SyntaxError: Cannot use import statement outside a module</title><link>https://www.ainab.site/posts/syntaxerror-cannot-use-import-statement-outside-a-module/</link><pubDate>Mon, 02 Aug 2021 00:00:00 +0000</pubDate><guid>https://www.ainab.site/posts/syntaxerror-cannot-use-import-statement-outside-a-module/</guid><description>For the secret game I am developing, I needed a database to store User and Profile data. The game&amp;rsquo;s backend server is developed using Node.js and Typescript, and to simplify connecting to the MySQL database, I wanted to use TypeORM.
TypeORM is awesome. Previously, I had to create the database from scratch and I connected to the database directly and subsequently executed carefully prepared sql queries with parameters. With TypeORM I can specify entities, add columns with specific qualities.</description></item><item><title>Sorry, this file type is not permitted for security reasons.</title><link>https://www.ainab.site/posts/sorry-this-file-type-is-not-per-mitted-for-security-reasons/</link><pubDate>Fri, 09 Jul 2021 00:00:00 +0000</pubDate><guid>https://www.ainab.site/posts/sorry-this-file-type-is-not-per-mitted-for-security-reasons/</guid><description>Today, I wanted to upload a WebP image/svg+xml image to a Wordpress website, because we all know WebP is the superior image format image/svg+xml nowadays.
Unfortunately, Wordpress currently (I am using 5.7.2) does not support it. Wordpress 5.8, however, is said to support WebP.
At the moment of writing, Wordpress 5.8 has not been released yet. So, if you cannot wait until the release of Wordpress 5.</description></item><item><title>Joomla: JFolder::create: Infinite loop detected.</title><link>https://www.ainab.site/posts/joomla-jfoldercreate-infinite-loop-detected/</link><pubDate>Sun, 04 Jul 2021 00:00:00 +0000</pubDate><guid>https://www.ainab.site/posts/joomla-jfoldercreate-infinite-loop-detected/</guid><description>Today, I tried to install an extension to a Joomla website I am currently working on. However, I got an error message, saying:
Warning Joomla\CMS\Filesystem\Folder::create: Infitinite loop detected. Error Unable to find install package
A quick search on Google taught me it has something to do with the file permissions on the logs and tmp folders. They need to be writable. So, using Filezilla, I set the file permissions of these folders to 777:</description></item><item><title>Base table or view not found: 1146 Table doesn't exist</title><link>https://www.ainab.site/posts/base-table-or-view-not-found-1146-table-doesnt-exist/</link><pubDate>Tue, 25 May 2021 00:00:00 +0000</pubDate><guid>https://www.ainab.site/posts/base-table-or-view-not-found-1146-table-doesnt-exist/</guid><description>When trying to use a Filament resource while also using Doctrine as an ORM, one might encounter the following error:
Illuminate\Database\QueryException SQLSTATE[42S02]: Base table or view not found: 1146 Table 'underhold.suppliers' doesn't exist (SQL: select * from `suppliers` where `id` = 8 limit 1) http://localhost/admin/resources/suppliers/8/edit In my case, the database table did not have a plural name and was simply named supplier. To let filament know what the correct table name is, I extended my model from Eloquent and specified the table name from within the model:</description></item><item><title>Relative path font import issues in Webpack 5</title><link>https://www.ainab.site/posts/relative-path-font-import-issues-in-webpack-5/</link><pubDate>Tue, 25 May 2021 00:00:00 +0000</pubDate><guid>https://www.ainab.site/posts/relative-path-font-import-issues-in-webpack-5/</guid><description>This is mainly a note to myself that I can use as a reference when a future me is making the same mistake again.
As I am creating the Wordpress theme for this website, I ran into some issues when trying to import the font that is currently used in the website&amp;rsquo;s title heading.
My folder structure is as follows:
src - css - fonts dist - css - fonts And I import my font like this:</description></item></channel></rss>